|
@@ -30,6 +30,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="productionLineNo" column="production_line_no" />
|
|
|
<result property="sliceType" column="slice_type" />
|
|
|
<result property="colourNumber" column="colour_number" />
|
|
|
+ <result property="taskName" column="task_name"/>
|
|
|
+ <result property="lotNumber" column="lot_number"/>
|
|
|
+ <result property="onBoardState" column="on_board_state"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<resultMap type="com.zkqy.business.domain.vo.SaleProductsVo" id="SaleProductsResultAndCustomInfo">
|
|
@@ -65,12 +68,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectSaleProductsVo">
|
|
|
- select id, sale_product_no, sale_order_no, product_no, product_name, product_number, product_weight, product_unit_price, product_amounts, product_notes, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key, process_key, status, production_line_no, slice_type, colour_number,lot_number from {DBNAME}.sale_products
|
|
|
+ select id, sale_product_no, sale_order_no, product_no, product_name, product_number, product_weight, product_unit_price, product_amounts, product_notes, remark, create_by_id, create_by, create_time, update_by_id, update_by, update_time, del_flag, task_process_key, task_node_key, process_key, status, production_line_no, slice_type, colour_number,task_name,lot_number, on_board_state from {DBNAME}.sale_products
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectSaleProductsList" parameterType="com.zkqy.business.domain.SaleProducts" resultMap="SaleProductsResult">
|
|
|
<include refid="selectSaleProductsVo"/>
|
|
|
- <where>
|
|
|
+ where del_flag = '0'
|
|
|
<if test="saleProductNo != null and saleProductNo != ''"> and sale_product_no = #{saleProductNo}</if>
|
|
|
<if test="saleOrderNo != null and saleOrderNo != ''"> and sale_order_no = #{saleOrderNo}</if>
|
|
|
<if test="productNo != null and productNo != ''"> and product_no = #{productNo}</if>
|
|
@@ -90,7 +93,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="sliceType != null and sliceType != ''"> and slice_type = #{sliceType}</if>
|
|
|
<if test="colourNumber != null and colourNumber != ''"> and colour_number = #{colourNumber}</if>
|
|
|
<if test="lotNumber != null and lotNumber != ''"> and lot_number = #{lotNumber}</if>
|
|
|
- </where>
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSaleProductsListAndCustomInfo" parameterType="com.zkqy.business.domain.SaleProducts" resultMap="SaleProductsResultAndCustomInfo">
|
|
@@ -130,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<insert id="insertSaleProducts" parameterType="com.zkqy.business.domain.SaleProducts" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into sale_products
|
|
|
+ insert into {DBNAME}.sale_products
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
<if test="saleProductNo != null">sale_product_no,</if>
|
|
|
<if test="saleOrderNo != null">sale_order_no,</if>
|
|
@@ -145,10 +147,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createById != null">create_by_id,</if>
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
- <if test="updateById != null">update_by_id,</if>
|
|
|
- <if test="updateBy != null">update_by,</if>
|
|
|
- <if test="updateTime != null">update_time,</if>
|
|
|
- <if test="delFlag != null">del_flag,</if>
|
|
|
<if test="taskProcessKey != null">task_process_key,</if>
|
|
|
<if test="taskNodeKey != null">task_node_key,</if>
|
|
|
<if test="processKey != null">process_key,</if>
|
|
@@ -156,6 +154,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="productionLineNo != null">production_line_no,</if>
|
|
|
<if test="sliceType != null">slice_type,</if>
|
|
|
<if test="colourNumber != null">colour_number,</if>
|
|
|
+ <if test="taskName != null">task_name,</if>
|
|
|
+ <if test="lotNumber != null">lot_number,</if>
|
|
|
+ <if test="onBoardState != null">on_board_state,</if>
|
|
|
+ del_flag
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="saleProductNo != null">#{saleProductNo},</if>
|
|
@@ -171,10 +173,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="createById != null">#{createById},</if>
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
- <if test="updateById != null">#{updateById},</if>
|
|
|
- <if test="updateBy != null">#{updateBy},</if>
|
|
|
- <if test="updateTime != null">#{updateTime},</if>
|
|
|
- <if test="delFlag != null">#{delFlag},</if>
|
|
|
<if test="taskProcessKey != null">#{taskProcessKey},</if>
|
|
|
<if test="taskNodeKey != null">#{taskNodeKey},</if>
|
|
|
<if test="processKey != null">#{processKey},</if>
|
|
@@ -182,6 +180,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="productionLineNo != null">#{productionLineNo},</if>
|
|
|
<if test="sliceType != null">#{sliceType},</if>
|
|
|
<if test="colourNumber != null">#{colourNumber},</if>
|
|
|
+ <if test="taskName != null">#{taskName},</if>
|
|
|
+ <if test="lotNumber != null">#{lotNumber},</if>
|
|
|
+ <if test="onBoardState != null">#{onBoardState},</if>
|
|
|
+ '0'
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -198,9 +200,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="productAmounts != null">product_amounts = #{productAmounts},</if>
|
|
|
<if test="productNotes != null">product_notes = #{productNotes},</if>
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
- <if test="createById != null">create_by_id = #{createById},</if>
|
|
|
- <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
- <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
<if test="updateById != null">update_by_id = #{updateById},</if>
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
@@ -212,6 +211,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="productionLineNo != null">production_line_no = #{productionLineNo},</if>
|
|
|
<if test="sliceType != null">slice_type = #{sliceType},</if>
|
|
|
<if test="colourNumber != null">colour_number = #{colourNumber},</if>
|
|
|
+ <if test="taskName != null">task_name = #{taskName},</if>
|
|
|
+ <if test="lotNumber != null">lot_number = #{lotNumber},</if>
|
|
|
+ <if test="onBoardState != null">on_board_state = #{onBoardState},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
@@ -242,6 +244,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="productionLineNo != null">production_line_no = #{productionLineNo},</if>
|
|
|
<if test="sliceType != null">slice_type = #{sliceType},</if>
|
|
|
<if test="colourNumber != null">colour_number = #{colourNumber},</if>
|
|
|
+ <if test="taskName != null">task_name = #{taskName},</if>
|
|
|
+ <if test="lotNumber != null">lot_number = #{lotNumber},</if>
|
|
|
<if test="onBoardState != null">on_board_state = #{onBoardState},</if>
|
|
|
</trim>
|
|
|
where sale_order_no = #{saleOrderNo}
|
|
@@ -321,4 +325,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
AND p.del_flag = '0'
|
|
|
and sp.sale_order_no = #{saleOrderNo}
|
|
|
</select>
|
|
|
+
|
|
|
+ <insert id="batchInsertSaleProducts" parameterType="java.util.List">
|
|
|
+ INSERT INTO {DBNAME}.sale_products (
|
|
|
+ sale_product_no,
|
|
|
+ sale_order_no,
|
|
|
+ product_no,
|
|
|
+ product_name,
|
|
|
+ product_number,
|
|
|
+ product_weight,
|
|
|
+ product_unit_price,
|
|
|
+ product_amounts,
|
|
|
+ product_notes,
|
|
|
+ remark,
|
|
|
+ create_by_id,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ task_process_key,
|
|
|
+ task_node_key,
|
|
|
+ process_key,
|
|
|
+ status,
|
|
|
+ production_line_no,
|
|
|
+ slice_type,
|
|
|
+ colour_number,
|
|
|
+ task_name,
|
|
|
+ lot_number,
|
|
|
+ on_board_state,
|
|
|
+ del_flag
|
|
|
+ ) VALUES
|
|
|
+ <foreach collection="list" item="item" separator=",">
|
|
|
+ (
|
|
|
+ #{item.saleProductNo},
|
|
|
+ #{item.saleOrderNo},
|
|
|
+ #{item.productNo},
|
|
|
+ #{item.productName},
|
|
|
+ #{item.productNumber},
|
|
|
+ #{item.productWeight},
|
|
|
+ #{item.productUnitPrice},
|
|
|
+ #{item.productAmounts},
|
|
|
+ #{item.productNotes},
|
|
|
+ #{item.remark},
|
|
|
+ #{item.createById},
|
|
|
+ #{item.createBy},
|
|
|
+ #{item.createTime},
|
|
|
+ #{item.taskProcessKey},
|
|
|
+ #{item.taskNodeKey},
|
|
|
+ #{item.processKey},
|
|
|
+ #{item.status},
|
|
|
+ #{item.productionLineNo},
|
|
|
+ #{item.sliceType},
|
|
|
+ #{item.colourNumber},
|
|
|
+ #{item.taskName},
|
|
|
+ #{item.lotNumber},
|
|
|
+ #{item.onBoardState},
|
|
|
+ '0'
|
|
|
+ )
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <select id="selectSaleProductsIdsBySaleNo" parameterType="string" resultType="java.lang.Long">
|
|
|
+ select id from {DBNAME}.sale_products where sale_order_no = #{saleOrderNo} and del_flag = '0'
|
|
|
+ </select>
|
|
|
</mapper>
|