| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.aps.job.mapper.ApsWorkOrderProcessMapper"> |
| | | |
| | | <resultMap type="ApsWorkOrderProcess" id="ApsWorkOrderProcessResult"> |
| | | <resultMap type="com.aps.job.domain.ApsWorkOrderProcess" id="ApsWorkOrderProcessResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="itemCode" column="item_code" /> |
| | | <result property="docNo" column="doc_no" /> |
| | |
| | | <result property="scrapQty" column="scrap_qty" /> |
| | | <result property="opStatus" column="op_status" /> |
| | | <result property="org" column="org" /> |
| | | <result property="org_code" column="org_code" /> |
| | | <result property="orgCode" column="org_code" /> |
| | | <result property="workCenter" column="workCenter" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectApsWorkOrderProcessVo"> |
| | | select id, item_code, doc_no, op_num, op_id, process_name, standard_time, paln_start_date, plan_complete_date, process_qty, scrap_qty, op_status, org, org_code from aps_work_order_process |
| | | select id, item_code, doc_no, op_num, op_id, process_name, standard_time, paln_start_date, plan_complete_date, process_qty, scrap_qty, op_status, org, org_code, work_center, create_by, create_time, update_by, update_time from aps_work_order_process |
| | | </sql> |
| | | |
| | | <select id="selectApsWorkOrderProcessList" parameterType="ApsWorkOrderProcess" resultMap="ApsWorkOrderProcessResult"> |
| | | <select id="selectApsWorkOrderProcessList" parameterType="com.aps.job.domain.ApsWorkOrderProcess" resultMap="ApsWorkOrderProcessResult"> |
| | | <include refid="selectApsWorkOrderProcessVo"/> |
| | | <where> |
| | | <if test="itemCode != null and itemCode != ''"> and item_code = #{itemCode}</if> |
| | |
| | | <if test="scrapQty != null "> and scrap_qty = #{scrapQty}</if> |
| | | <if test="opStatus != null and opStatus != ''"> and op_status = #{opStatus}</if> |
| | | <if test="org != null and org != ''"> and org = #{org}</if> |
| | | <if test="org_code != null and org_code != ''"> and org_code = #{orgCode}</if> |
| | | <if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if> |
| | | <if test="workCenter != null and workCenter != ''"> and work_center = #{workCenter}</if> |
| | | </where> |
| | | </select> |
| | | |
| | |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertApsWorkOrderProcess" parameterType="ApsWorkOrderProcess"> |
| | | <insert id="insertApsWorkOrderProcess" parameterType="com.aps.job.domain.ApsWorkOrderProcess"> |
| | | insert into aps_work_order_process |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | |
| | | <if test="opStatus != null">op_status,</if> |
| | | <if test="org != null">org,</if> |
| | | <if test="orgCode != null">org_code,</if> |
| | | <if test="workCenter != null">work_center,</if> |
| | | <if test="createBy != null">create_by,</if> |
| | | <if test="createTime != null">create_time,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id},</if> |
| | |
| | | <if test="opStatus != null">#{opStatus},</if> |
| | | <if test="org != null">#{org},</if> |
| | | <if test="orgCode != null">#{orgCode},</if> |
| | | <if test="workCenter != null">#{work_center},</if> |
| | | <if test="createBy != null">#{createBy},</if> |
| | | <if test="createTime != null">#{createTime},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateApsWorkOrderProcess" parameterType="ApsWorkOrderProcess"> |
| | | <update id="updateApsWorkOrderProcess" parameterType="com.aps.job.domain.ApsWorkOrderProcess"> |
| | | update aps_work_order_process |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="itemCode != null">item_code = #{itemCode},</if> |
| | |
| | | <if test="opStatus != null">op_status = #{opStatus},</if> |
| | | <if test="org != null">org = #{org},</if> |
| | | <if test="orgCode != null">org_code = #{orgCode},</if> |
| | | <if test="workCenter != null">work_center = #{workCenter},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | scrap_qty = #{item.scrapQty}, |
| | | op_status = #{item.opStatus}, |
| | | org = #{item.org}, |
| | | org_code = #{item.orgCode} |
| | | org_code = #{item.orgCode}, |
| | | work_center = #{item.workCenter}, |
| | | update_by = #{item.updateBy}, |
| | | update_time = #{item.updateTime} |
| | | WHERE id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <insert id="insertApsWorkOrderProcessBatch"> |
| | | INSERT INTO aps_work_order_process ( |
| | | id, |
| | | item_code, |
| | | doc_no, |
| | | op_num, |
| | |
| | | scrap_qty, |
| | | op_status, |
| | | org, |
| | | org_code |
| | | org_code, |
| | | work_center, |
| | | create_by, |
| | | create_time |
| | | ) VALUES |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.id}, |
| | | #{item.itemCode}, |
| | | #{item.docNo}, |
| | | #{item.opNum}, |
| | |
| | | #{item.scrapQty}, |
| | | #{item.opStatus}, |
| | | #{item.org}, |
| | | #{item.orgCode} |
| | | #{item.orgCode}, |
| | | #{item.workCenter}, |
| | | #{item.createBy}, |
| | | #{item.createTime} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <!-- 插入数据到 aps_process_route --> |
| | | <insert id="insertIntoApsProcessRoute"> |
| | | INSERT INTO aps_process_route ( |
| | | id, |
| | | item_no, |
| | | work_order_no, |
| | | process_number, |
| | | op_id, |
| | | process_name, |
| | | standard_time, |
| | | process_plan_start_day, |
| | | process_plan_end_day, |
| | | process_qty, |
| | | discard_count, |
| | | op_status, |
| | | plant, |
| | | org_code, |
| | | work_center, |
| | | create_time |
| | | ) |
| | | SELECT |
| | | id, |
| | | item_code, |
| | | doc_no, |
| | | op_num, |
| | | op_id, |
| | | process_name, |
| | | standard_time, |
| | | plan_start_date, |
| | | plan_complete_date, |
| | | process_qty, |
| | | scrap_qty, |
| | | op_status, |
| | | org, |
| | | org_code, |
| | | work_center, |
| | | now() |
| | | FROM aps_work_order_process |
| | | </insert> |
| | | |
| | | <!-- 删除 aps_process_route 表中的数据 --> |
| | | <delete id="deleteApsWorkOrderProcess"> |
| | | DELETE FROM aps_work_order_process |
| | | </delete> |
| | | |
| | | <!-- 删除 aps_process_route 表中的数据 --> |
| | | <delete id="deleteApsProcessRoute"> |
| | | DELETE FROM aps_process_route |
| | | </delete> |
| | | |
| | | </mapper> |