|
|
|
<?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.hw.mes.mapper.MesOrderBindMapper">
|
|
|
|
|
|
|
|
<resultMap type="MesOrderBind" id="MesOrderBindResult">
|
|
|
|
<result property="orderBindId" column="order_bind_id" />
|
|
|
|
<result property="safeFlag" column="safe_flag" />
|
|
|
|
<result property="saleOrderId" column="sale_order_id" />
|
|
|
|
<result property="saleOrderCode" column="sale_order_code" />
|
|
|
|
<result property="productId" column="product_id" />
|
|
|
|
<result property="productCode" column="product_code" />
|
|
|
|
<result property="productName" column="product_name" />
|
|
|
|
<result property="purchaseOrderId" column="purchase_order_id" />
|
|
|
|
<result property="poNo" column="po_no" />
|
|
|
|
<result property="materialId" column="material_id" />
|
|
|
|
<result property="materialCode" column="material_code" />
|
|
|
|
<result property="materialName" column="material_name" />
|
|
|
|
<result property="bindAmount" column="bind_amount" />
|
|
|
|
<result property="barcodeAmount" column="barcode_amount" />
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
<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="selectMesOrderBindVo">
|
|
|
|
select order_bind_id, safe_flag, sale_order_id, sale_order_code, product_id, product_code, product_name, purchase_order_id, po_no, material_id, material_code, material_name, bind_amount, barcode_amount,remark, create_by, create_time, update_by, update_time from mes_order_bind
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectMesOrderBindList" parameterType="MesOrderBind" resultMap="MesOrderBindResult">
|
|
|
|
<include refid="selectMesOrderBindVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="safeFlag != null and safeFlag != ''"> and safe_flag = #{safeFlag}</if>
|
|
|
|
<if test="saleOrderId != null "> and sale_order_id = #{saleOrderId}</if>
|
|
|
|
<if test="saleOrderCode != null and saleOrderCode != ''"> and sale_order_code = #{saleOrderCode}</if>
|
|
|
|
<if test="productId != null "> and product_id = #{productId}</if>
|
|
|
|
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
|
|
|
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
|
|
|
<if test="purchaseOrderId != null "> and purchase_order_id = #{purchaseOrderId}</if>
|
|
|
|
<if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if>
|
|
|
|
<if test="materialId != null "> and material_id = #{materialId}</if>
|
|
|
|
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
|
|
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
|
|
|
|
<if test="bindAmount != null "> and bind_amount = #{bindAmount}</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectMesOrderBindByOrderBindId" parameterType="Long" resultMap="MesOrderBindResult">
|
|
|
|
<include refid="selectMesOrderBindVo"/>
|
|
|
|
where order_bind_id = #{orderBindId}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertMesOrderBind" parameterType="MesOrderBind" useGeneratedKeys="true" keyProperty="orderBindId">
|
|
|
|
insert into mes_order_bind
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="safeFlag != null and safeFlag != ''">safe_flag,</if>
|
|
|
|
<if test="saleOrderId != null">sale_order_id,</if>
|
|
|
|
<if test="saleOrderCode != null">sale_order_code,</if>
|
|
|
|
<if test="productId != null">product_id,</if>
|
|
|
|
<if test="productCode != null">product_code,</if>
|
|
|
|
<if test="productName != null">product_name,</if>
|
|
|
|
<if test="purchaseOrderId != null">purchase_order_id,</if>
|
|
|
|
<if test="poNo != null">po_no,</if>
|
|
|
|
<if test="materialId != null">material_id,</if>
|
|
|
|
<if test="materialCode != null">material_code,</if>
|
|
|
|
<if test="materialName != null">material_name,</if>
|
|
|
|
<if test="bindAmount != null">bind_amount,</if>
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="safeFlag != null and safeFlag != ''">#{safeFlag},</if>
|
|
|
|
<if test="saleOrderId != null">#{saleOrderId},</if>
|
|
|
|
<if test="saleOrderCode != null">#{saleOrderCode},</if>
|
|
|
|
<if test="productId != null">#{productId},</if>
|
|
|
|
<if test="productCode != null">#{productCode},</if>
|
|
|
|
<if test="productName != null">#{productName},</if>
|
|
|
|
<if test="purchaseOrderId != null">#{purchaseOrderId},</if>
|
|
|
|
<if test="poNo != null">#{poNo},</if>
|
|
|
|
<if test="materialId != null">#{materialId},</if>
|
|
|
|
<if test="materialCode != null">#{materialCode},</if>
|
|
|
|
<if test="materialName != null">#{materialName},</if>
|
|
|
|
<if test="bindAmount != null">#{bindAmount},</if>
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateMesOrderBind" parameterType="MesOrderBind">
|
|
|
|
update mes_order_bind
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="safeFlag != null and safeFlag != ''">safe_flag = #{safeFlag},</if>
|
|
|
|
<if test="saleOrderId != null">sale_order_id = #{saleOrderId},</if>
|
|
|
|
<if test="saleOrderCode != null">sale_order_code = #{saleOrderCode},</if>
|
|
|
|
<if test="productId != null">product_id = #{productId},</if>
|
|
|
|
<if test="productCode != null">product_code = #{productCode},</if>
|
|
|
|
<if test="productName != null">product_name = #{productName},</if>
|
|
|
|
<if test="purchaseOrderId != null">purchase_order_id = #{purchaseOrderId},</if>
|
|
|
|
<if test="poNo != null">po_no = #{poNo},</if>
|
|
|
|
<if test="materialId != null">material_id = #{materialId},</if>
|
|
|
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
|
|
|
<if test="materialName != null">material_name = #{materialName},</if>
|
|
|
|
<if test="bindAmount != null">bind_amount = #{bindAmount},</if>
|
|
|
|
<if test="barcodeAmount != null">barcode_amount = #{barcodeAmount},</if>
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
</trim>
|
|
|
|
where order_bind_id = #{orderBindId}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteMesOrderBindByOrderBindId" parameterType="Long">
|
|
|
|
delete from mes_order_bind where order_bind_id = #{orderBindId}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteMesOrderBindByOrderBindIds" parameterType="String">
|
|
|
|
delete from mes_order_bind where order_bind_id in
|
|
|
|
<foreach item="orderBindId" collection="array" open="(" separator="," close=")">
|
|
|
|
#{orderBindId}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|