You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
186 lines
11 KiB
XML
186 lines
11 KiB
XML
<?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.MesPurchaseReceiveBillMapper">
|
|
|
|
<resultMap type="MesPurchaseReceiveBill" id="MesPurchaseReceiveBillResult">
|
|
<result property="receiveBillId" column="receive_bill_id" />
|
|
<result property="erpId" column="erp_id" />
|
|
<result property="fentryId" column="fentry_id" />
|
|
<result property="billNo" column="bill_no" />
|
|
<result property="poNo" column="po_no" />
|
|
<result property="documentStatus" column="document_status" />
|
|
<result property="materialId" column="material_id" />
|
|
<result property="materialCode" column="material_code" />
|
|
<result property="materialName" column="material_name" />
|
|
<result property="fsBillId" column="fs_bill_id" />
|
|
<result property="fsId" column="fs_id" />
|
|
<result property="actLandAmount" column="act_land_amount" />
|
|
<result property="actReceiveAmount" column="act_receive_amount" />
|
|
<result property="approveDate" column="approve_date" />
|
|
<result property="erpModifyDate" column="erp_modify_date" />
|
|
<result property="purchaseOrgId" column="purchase_org_id" />
|
|
<result property="tondBase" column="tond_base" />
|
|
<result property="price" column="price" />
|
|
<result property="supplierId" column="supplier_id" />
|
|
<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" />
|
|
<result property="materialSpec" column="material_spec" />
|
|
</resultMap>
|
|
|
|
<sql id="selectMesPurchaseReceiveBillVo">
|
|
select receive_bill_id, erp_id, fentry_id, bill_no, po_no, document_status, material_id, material_code, material_name, fs_bill_id, fs_id, act_land_amount, act_receive_amount, approve_date, erp_modify_date, purchase_org_id, tond_base, price, supplier_id, remark, create_by, create_time, update_by, update_time from mes_purchase_receive_bill
|
|
</sql>
|
|
|
|
<select id="selectMesPurchaseReceiveBillList" parameterType="MesPurchaseReceiveBill" resultMap="MesPurchaseReceiveBillResult">
|
|
<include refid="selectMesPurchaseReceiveBillVo"/>
|
|
<where>
|
|
<if test="erpId != null "> and erp_id = #{erpId}</if>
|
|
<if test="fentryId != null "> and fentry_id = #{fentryId}</if>
|
|
<if test="billNo != null and billNo != ''"> and bill_no = #{billNo}</if>
|
|
<if test="poNo != null and poNo != ''"> and po_no = #{poNo}</if>
|
|
<if test="documentStatus != null and documentStatus != ''"> and document_status = #{documentStatus}</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="fsBillId != null and fsBillId != ''"> and fs_bill_id = #{fsBillId}</if>
|
|
<if test="fsId != null and fsId != ''"> and fs_id = #{fsId}</if>
|
|
<if test="actLandAmount != null "> and act_land_amount = #{actLandAmount}</if>
|
|
<if test="actReceiveAmount != null "> and act_receive_amount = #{actReceiveAmount}</if>
|
|
<if test="approveDate != null "> and approve_date = #{approveDate}</if>
|
|
<if test="erpModifyDate != null "> and erp_modify_date = #{erpModifyDate}</if>
|
|
<if test="purchaseOrgId != null "> and purchase_org_id = #{purchaseOrgId}</if>
|
|
<if test="tondBase != null and tondBase != ''"> and tond_base = #{tondBase}</if>
|
|
<if test="price != null "> and price = #{price}</if>
|
|
<if test="supplierId != null "> and supplier_id = #{supplierId}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectMesPurchaseReceiveBillByReceiveBillId" parameterType="Long" resultMap="MesPurchaseReceiveBillResult">
|
|
<include refid="selectMesPurchaseReceiveBillVo"/>
|
|
where receive_bill_id = #{receiveBillId}
|
|
</select>
|
|
|
|
<insert id="insertMesPurchaseReceiveBill" parameterType="MesPurchaseReceiveBill" useGeneratedKeys="true" keyProperty="receiveBillId">
|
|
insert into mes_purchase_receive_bill
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="erpId != null">erp_id,</if>
|
|
<if test="fentryId != null">fentry_id,</if>
|
|
<if test="billNo != null">bill_no,</if>
|
|
<if test="poNo != null">po_no,</if>
|
|
<if test="documentStatus != null">document_status,</if>
|
|
<if test="materialId != null">material_id,</if>
|
|
<if test="materialCode != null and materialCode != ''">material_code,</if>
|
|
<if test="materialName != null">material_name,</if>
|
|
<if test="fsBillId != null">fs_bill_id,</if>
|
|
<if test="fsId != null">fs_id,</if>
|
|
<if test="actLandAmount != null">act_land_amount,</if>
|
|
<if test="actReceiveAmount != null">act_receive_amount,</if>
|
|
<if test="approveDate != null">approve_date,</if>
|
|
<if test="erpModifyDate != null">erp_modify_date,</if>
|
|
<if test="purchaseOrgId != null">purchase_org_id,</if>
|
|
<if test="tondBase != null">tond_base,</if>
|
|
<if test="price != null">price,</if>
|
|
<if test="supplierId != null">supplier_id,</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="erpId != null">#{erpId},</if>
|
|
<if test="fentryId != null">#{fentryId},</if>
|
|
<if test="billNo != null">#{billNo},</if>
|
|
<if test="poNo != null">#{poNo},</if>
|
|
<if test="documentStatus != null">#{documentStatus},</if>
|
|
<if test="materialId != null">#{materialId},</if>
|
|
<if test="materialCode != null and materialCode != ''">#{materialCode},</if>
|
|
<if test="materialName != null">#{materialName},</if>
|
|
<if test="fsBillId != null">#{fsBillId},</if>
|
|
<if test="fsId != null">#{fsId},</if>
|
|
<if test="actLandAmount != null">#{actLandAmount},</if>
|
|
<if test="actReceiveAmount != null">#{actReceiveAmount},</if>
|
|
<if test="approveDate != null">#{approveDate},</if>
|
|
<if test="erpModifyDate != null">#{erpModifyDate},</if>
|
|
<if test="purchaseOrgId != null">#{purchaseOrgId},</if>
|
|
<if test="tondBase != null">#{tondBase},</if>
|
|
<if test="price != null">#{price},</if>
|
|
<if test="supplierId != null">#{supplierId},</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="updateMesPurchaseReceiveBill" parameterType="MesPurchaseReceiveBill">
|
|
update mes_purchase_receive_bill
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="erpId != null">erp_id = #{erpId},</if>
|
|
<if test="fentryId != null">fentry_id = #{fentryId},</if>
|
|
<if test="billNo != null">bill_no = #{billNo},</if>
|
|
<if test="poNo != null">po_no = #{poNo},</if>
|
|
<if test="documentStatus != null">document_status = #{documentStatus},</if>
|
|
<if test="materialId != null">material_id = #{materialId},</if>
|
|
<if test="materialCode != null and materialCode != ''">material_code = #{materialCode},</if>
|
|
<if test="materialName != null">material_name = #{materialName},</if>
|
|
<if test="fsBillId != null">fs_bill_id = #{fsBillId},</if>
|
|
<if test="fsId != null">fs_id = #{fsId},</if>
|
|
<if test="actLandAmount != null">act_land_amount = #{actLandAmount},</if>
|
|
<if test="actReceiveAmount != null">act_receive_amount = #{actReceiveAmount},</if>
|
|
<if test="approveDate != null">approve_date = #{approveDate},</if>
|
|
<if test="erpModifyDate != null">erp_modify_date = #{erpModifyDate},</if>
|
|
<if test="purchaseOrgId != null">purchase_org_id = #{purchaseOrgId},</if>
|
|
<if test="tondBase != null">tond_base = #{tondBase},</if>
|
|
<if test="price != null">price = #{price},</if>
|
|
<if test="supplierId != null">supplier_id = #{supplierId},</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 receive_bill_id = #{receiveBillId}
|
|
</update>
|
|
|
|
<delete id="deleteMesPurchaseReceiveBillByReceiveBillId" parameterType="Long">
|
|
delete from mes_purchase_receive_bill where receive_bill_id = #{receiveBillId}
|
|
</delete>
|
|
|
|
<delete id="deleteMesPurchaseReceiveBillByReceiveBillIds" parameterType="String">
|
|
delete from mes_purchase_receive_bill where receive_bill_id in
|
|
<foreach item="receiveBillId" collection="array" open="(" separator="," close=")">
|
|
#{receiveBillId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectMesPurchaseReceiveBillJoinList" parameterType="MesPurchaseReceiveBill" resultMap="MesPurchaseReceiveBillResult">
|
|
select mprb.receive_bill_id, mprb.erp_id, mprb.fentry_id, mprb.bill_no, mprb.po_no, mprb.document_status,
|
|
mprb.material_id, mbmi.material_code, mbmi.material_name, mbmi.material_spec,mprb.fs_bill_id, mprb.fs_id,
|
|
mprb.act_land_amount, mprb.act_receive_amount, mprb.approve_date, mprb.erp_modify_date,
|
|
mprb.purchase_org_id, mprb.tond_base, mprb.price, mprb.supplier_id, mprb.remark, mprb.create_by,
|
|
mprb.create_time, mprb.update_by, mprb.update_time from mes_purchase_receive_bill mprb
|
|
left join mes_base_material_info mbmi on mprb.material_id=mbmi.erp_id
|
|
|
|
<where>
|
|
<if test="billNo != null and billNo != ''"> and mprb.bill_no like concat('%', #{billNo}, '%')</if>
|
|
<if test="poNo != null and poNo != ''"> and mprb.po_no like concat('%', #{poNo}, '%')</if>
|
|
<if test="materialCode != null and materialCode != ''"> and mbmi.material_code like concat('%', #{materialCode}, '%')</if>
|
|
<if test="materialName != null and materialName != ''"> and mbmi.material_name like concat('%', #{materialName}, '%')</if>
|
|
<if test="materialSpec != null and materialSpec != ''"> and mbmi.material_spec like concat('%', #{materialSpec}, '%')</if>
|
|
</where>
|
|
order by mprb.erp_modify_date desc
|
|
</select>
|
|
</mapper> |