Files
FT546MWS/ruoyi-admin/src/main/resources/mapper/check/CheckStockinFinishMapper.xml
2026-01-07 15:37:03 +08:00

197 lines
12 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.ruoyi.check.stockcheckfinish.mapper.CheckStockinFinishMapper">
<resultMap type="CheckStockinFinish" id="CheckStockinFinishResult">
<result property="stockGuid" column="stock_guid" />
<result property="stockCheckId" column="stock_check_id" />
<result property="checkType" column="check_type" />
<result property="createDate" column="create_date" />
<result property="createManId" column="create_man_id" />
<result property="status" column="status" />
<result property="warehouseId" column="warehouse_id" />
<result property="spare5" column="spare5" />
<result property="spare4" column="spare4" />
<result property="spare3" column="spare3" />
<result property="finishDate" column="finish_date" />
<result property="spare2" column="spare2" />
<result property="spare1" column="spare1" />
<result property="erpBill" column="erp_bill" />
<result property="stockSource" column="stock_source" />
<result property="departmentNo" column="department_no" />
<result property="customerNo" column="customer_no" />
<result property="classNo" column="class_no" />
<result property="supplierNo" column="supplier_no" />
</resultMap>
<resultMap type="CheckStockin" id="CheckStockinResult">
<result property="stockGuid" column="stock_guid" />
<result property="stockCheckId" column="stock_check_id" />
<result property="checkType" column="check_type" />
<result property="createDate" column="create_date" />
<result property="createManId" column="create_man_id" />
<result property="status" column="status" />
<result property="warehouseId" column="warehouse_id" />
<result property="finishDate" column="finish_date" />
<result property="erpBill" column="erp_bill" />
<result property="stockSource" column="stock_source" />
<result property="departmentNo" column="department_no" />
<result property="customerNo" column="customer_no" />
<result property="classNo" column="class_no" />
<result property="supplierNo" column="supplier_no" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="warehouseName" column="warehouse_name" />
</resultMap>
<sql id="selectCheckStockinVo">
select stock_guid, stock_check_id, check_type, create_date, create_man_id, status, csf.warehouse_id,warehouse_name, finish_date, erp_bill, stock_source, department_no, customer_no, class_no, supplier_no, spare1, spare2, spare3, spare4, spare5
from check_stockin_finish csf
left join bas_warehouse bw on bw.warehouse_id= csf.warehouse_id
</sql>
<sql id="selectCheckStockinFinishVo">
select stock_guid, stock_check_id, check_type, create_date, create_man_id, status, warehouse_id, spare5, spare4, spare3, finish_date, spare2, spare1, erp_bill, stock_source, department_no, customer_no, class_no, supplier_no from check_stockin_finish
</sql>
<select id="selectCheckStockinFinishList" parameterType="CheckStockinFinish" resultMap="CheckStockinFinishResult">
<include refid="selectCheckStockinFinishVo"/>
<where>
<if test="stockCheckId != null and stockCheckId != ''"> and stock_check_id = #{stockCheckId}</if>
<if test="checkType != null and checkType != ''"> and check_type = #{checkType}</if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="finishDate != null and finishDate != ''"> and finish_date = #{finishDate}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="erpBill != null and erpBill != ''"> and erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
</where>
</select>
<select id="selectCheckStockinFinishByStockGuid" parameterType="String" resultMap="CheckStockinFinishResult">
<include refid="selectCheckStockinFinishVo"/>
where stock_guid = #{stockGuid}
</select>
<select id="selectCheckStockinList" resultMap="CheckStockinResult">
<include refid="selectCheckStockinVo"/>
<where>
<if test="stockCheckId != null and stockCheckId != ''"> and stock_check_id = #{stockCheckId}</if>
<if test="checkType != null and checkType != ''"> and check_type = #{checkType}</if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="warehouseId != null and warehouseId != ''"> and csf.warehouse_id = #{warehouseId}</if>
<if test="finishDate != null and finishDate != ''"> and finish_date = #{finishDate}</if>
<if test="erpBill != null and erpBill != ''"> and erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where>
order by cs.create_date asc
</select>
<insert id="insertCheckStockinFinish" parameterType="CheckStockinFinish">
insert into check_stockin_finish
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stockGuid != null">stock_guid,</if>
<if test="stockCheckId != null and stockCheckId != ''">stock_check_id,</if>
<if test="checkType != null and checkType != ''">check_type,</if>
<if test="createDate != null and createDate != ''">create_date,</if>
<if test="createManId != null">create_man_id,</if>
<if test="status != null and status != ''">status,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare3 != null">spare3,</if>
<if test="finishDate != null">finish_date,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare1 != null">spare1,</if>
<if test="erpBill != null">erp_bill,</if>
<if test="stockSource != null">stock_source,</if>
<if test="departmentNo != null">department_no,</if>
<if test="customerNo != null">customer_no,</if>
<if test="classNo != null">class_no,</if>
<if test="supplierNo != null">supplier_no,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockGuid != null">#{stockGuid},</if>
<if test="stockCheckId != null and stockCheckId != ''">#{stockCheckId},</if>
<if test="checkType != null and checkType != ''">#{checkType},</if>
<if test="createDate != null and createDate != ''">#{createDate},</if>
<if test="createManId != null">#{createManId},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="finishDate != null">#{finishDate},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="erpBill != null">#{erpBill},</if>
<if test="stockSource != null">#{stockSource},</if>
<if test="departmentNo != null">#{departmentNo},</if>
<if test="customerNo != null">#{customerNo},</if>
<if test="classNo != null">#{classNo},</if>
<if test="supplierNo != null">#{supplierNo},</if>
</trim>
</insert>
<update id="updateCheckStockinFinish" parameterType="CheckStockinFinish">
update check_stockin_finish
<trim prefix="SET" suffixOverrides=",">
<if test="stockCheckId != null and stockCheckId != ''">stock_check_id = #{stockCheckId},</if>
<if test="checkType != null and checkType != ''">check_type = #{checkType},</if>
<if test="createDate != null and createDate != ''">create_date = #{createDate},</if>
<if test="createManId != null">create_man_id = #{createManId},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="finishDate != null">finish_date = #{finishDate},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="erpBill != null">erp_bill = #{erpBill},</if>
<if test="stockSource != null">stock_source = #{stockSource},</if>
<if test="departmentNo != null">department_no = #{departmentNo},</if>
<if test="customerNo != null">customer_no = #{customerNo},</if>
<if test="classNo != null">class_no = #{classNo},</if>
<if test="supplierNo != null">supplier_no = #{supplierNo},</if>
</trim>
where stock_guid = #{stockGuid}
</update>
<delete id="deleteCheckStockinFinishByStockGuid" parameterType="String">
delete from check_stockin_finish where stock_guid = #{stockGuid}
</delete>
<delete id="deleteCheckStockinFinishByStockGuids" parameterType="String">
delete from check_stockin_finish where stock_guid in
<foreach item="stockGuid" collection="array" open="(" separator="," close=")">
#{stockGuid}
</foreach>
</delete>
</mapper>