<?xml version="1.0" encoding="UTF-8" ?>
|
<!DOCTYPE mapper
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.aps.job.mapper.ApsStandardProcessRouteLineJobMapper">
|
|
<resultMap type="com.aps.job.domain.ApsStandardProcessRouteLineJob" id="ApsStandardProcessRouteLineJobResult">
|
<result property="id" column="id" />
|
<result property="routeId" column="route_id" />
|
<result property="routeNum" column="route_num" />
|
<result property="routeName" column="route_name" />
|
<result property="startDate" column="start_date" />
|
<result property="endDate" column="end_date" />
|
<result property="createTime" column="create_time" />
|
<result property="orgCode" column="org_code" />
|
<result property="shopCode" column="shop_code" />
|
<result property="productivityModel" column="productivity_model" />
|
<result property="designCapacity" column="design_capacity" />
|
<result property="delFlag" column="del_flag" />
|
<result property="createBy" column="create_by" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="routeCode" column="route_code" />
|
<result property="standardTime" column="standard_time" />
|
</resultMap>
|
|
<sql id="selectApsStandardProcessRouteLineJobVo">
|
select id, route_id, route_num, route_name, start_date, end_date, create_time, org_code, shop_code, productivity_model, design_capacity, del_flag, create_by, update_by, update_time, route_code, standard_time from aps_standard_process_route_line_job
|
</sql>
|
|
<select id="selectApsStandardProcessRouteLineJobList" parameterType="com.aps.job.domain.ApsStandardProcessRouteLineJob" resultMap="ApsStandardProcessRouteLineJobResult">
|
<include refid="selectApsStandardProcessRouteLineJobVo"/>
|
<where>
|
<if test="routeId != null and routeId != ''"> and route_id = #{routeId}</if>
|
<if test="routeNum != null and routeNum != ''"> and route_num = #{routeNum}</if>
|
<if test="routeName != null and routeName != ''"> and route_name like concat('%', #{routeName}, '%')</if>
|
<if test="startDate != null "> and start_date = #{startDate}</if>
|
<if test="endDate != null "> and end_date = #{endDate}</if>
|
<if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if>
|
<if test="shopCode != null and shopCode != ''"> and shop_code = #{shopCode}</if>
|
<if test="productivityModel != null and productivityModel != ''"> and productivity_model = #{productivityModel}</if>
|
<if test="designCapacity != null "> and design_capacity = #{designCapacity}</if>
|
</where>
|
</select>
|
|
<select id="selectApsStandardProcessRouteLineJobById" parameterType="Long" resultMap="ApsStandardProcessRouteLineJobResult">
|
<include refid="selectApsStandardProcessRouteLineJobVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertApsStandardProcessRouteLineJob" parameterType="com.aps.job.domain.ApsStandardProcessRouteLineJob">
|
insert into aps_standard_process_route_line_job
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="routeId != null">route_id,</if>
|
<if test="routeNum != null">route_num,</if>
|
<if test="routeName != null">route_name,</if>
|
<if test="startDate != null">start_date,</if>
|
<if test="endDate != null">end_date,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="orgCode != null">org_code,</if>
|
<if test="shopCode != null">shop_code,</if>
|
<if test="productivityModel != null">productivity_model,</if>
|
<if test="designCapacity != null">design_capacity,</if>
|
<if test="delFlag != null">del_flag,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="routeId != null">#{routeId},</if>
|
<if test="routeNum != null">#{routeNum},</if>
|
<if test="routeName != null">#{routeName},</if>
|
<if test="startDate != null">#{startDate},</if>
|
<if test="endDate != null">#{endDate},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="orgCode != null">#{orgCode},</if>
|
<if test="shopCode != null">#{shopCode},</if>
|
<if test="productivityModel != null">#{productivityModel},</if>
|
<if test="designCapacity != null">#{designCapacity},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
</trim>
|
</insert>
|
|
<update id="updateApsStandardProcessRouteLineJob" parameterType="com.aps.job.domain.ApsStandardProcessRouteLineJob">
|
update aps_standard_process_route_line_job
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="routeId != null">route_id = #{routeId},</if>
|
<if test="routeNum != null">route_num = #{routeNum},</if>
|
<if test="routeName != null">route_name = #{routeName},</if>
|
<if test="startDate != null">start_date = #{startDate},</if>
|
<if test="endDate != null">end_date = #{endDate},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="orgCode != null">org_code = #{orgCode},</if>
|
<if test="shopCode != null">shop_code = #{shopCode},</if>
|
<if test="productivityModel != null">productivity_model = #{productivityModel},</if>
|
<if test="designCapacity != null">design_capacity = #{designCapacity},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteApsStandardProcessRouteLineJobById" parameterType="Long">
|
delete from aps_standard_process_route_line_job where id = #{id}
|
</delete>
|
|
<delete id="deleteApsStandardProcessRouteLineJobByIds" parameterType="String">
|
delete from aps_standard_process_route_line_job where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<insert id="insertProcessRouteLineBatch">
|
INSERT INTO aps_standard_process_route_line_job (
|
id,
|
route_id,
|
route_num,
|
route_name,
|
route_code,
|
start_date,
|
end_date,
|
org_code,
|
shop_code,
|
standard_time,
|
create_by,
|
create_time
|
) VALUES
|
<foreach collection="list" item="item" separator=",">
|
(
|
#{item.id},
|
#{item.routeId},
|
#{item.routeNum},
|
#{item.routeName},
|
#{item.routeCode},
|
#{item.startDate},
|
#{item.endDate},
|
#{item.orgCode},
|
#{item.shopCode},
|
#{item.standardTime},
|
#{item.createBy},
|
now()
|
)
|
</foreach>
|
</insert>
|
|
<!-- 插入数据到 aps_bom_header -->
|
<insert id="insertIntoProcessRouteLine">
|
INSERT INTO aps_standard_process_route_line (
|
id,
|
route_id,
|
route_num,
|
route_name,
|
route_code,
|
start_date,
|
end_date,
|
org_code,
|
shop_code,
|
standard_time,
|
create_by,
|
create_time
|
)
|
SELECT
|
id,
|
route_id,
|
route_num,
|
route_name,
|
route_code,
|
start_date,
|
end_date,
|
org_code,
|
shop_code,
|
standard_time,
|
create_by,
|
now()
|
FROM aps_standard_process_route_line_job
|
</insert>
|
|
<!-- 删除 aps_standard_process_route_line 表中的数据 -->
|
<delete id="deleteProcessRouteLine">
|
DELETE FROM aps_standard_process_route_line
|
</delete>
|
|
<!-- 删除 aps_standard_process_route_line_job 表中的数据 -->
|
<delete id="deleteProcessRouteLineJob">
|
DELETE FROM aps_standard_process_route_line_job
|
</delete>
|
|
</mapper>
|