186 lines
9.9 KiB
XML
186 lines
9.9 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.stockcheck.mapper.CheckStockinMapper">
|
|
|
|
<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="departmentName" column="department_name" />
|
|
<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 cs.stock_guid,
|
|
cs.stock_check_id,
|
|
cs.check_type,
|
|
cs.create_date,
|
|
cs.create_man_id,
|
|
cs.status,
|
|
cs.warehouse_id,
|
|
cs.finish_date,
|
|
cs.erp_bill,
|
|
cs.stock_source,
|
|
cs.department_no,
|
|
cs.customer_no,
|
|
cs.class_no,
|
|
cs.supplier_no,
|
|
cs.spare1,
|
|
cs.spare2,
|
|
cs.spare3,
|
|
cs.spare4,
|
|
cs.spare5,
|
|
bw.warehouse_name,
|
|
sd.dept_name as department_name
|
|
from check_stockin cs
|
|
left join bas_warehouse bw on cs.warehouse_id = bw.warehouse_id
|
|
left join sys_dept sd on cs.department_no = sd.dept_id
|
|
</sql>
|
|
|
|
<select id="selectCheckStockinList" parameterType="CheckStockin" resultMap="CheckStockinResult">
|
|
<include refid="selectCheckStockinVo"/>
|
|
<where>
|
|
<if test="stockCheckId != null and stockCheckId != ''"> and cs.stock_check_id = #{stockCheckId}</if>
|
|
<if test="checkType != null and checkType != ''"> and cs.check_type = #{checkType}</if>
|
|
<if test="createDate != null and createDate != ''"> and cs.create_date = #{createDate}</if>
|
|
<if test="createManId != null and createManId != ''"> and cs.create_man_id = #{createManId}</if>
|
|
<if test="status != null and status != ''"> and cs.status = #{status}</if>
|
|
<if test="warehouseId != null and warehouseId != ''"> and cs.warehouse_id = #{warehouseId}</if>
|
|
<if test="finishDate != null and finishDate != ''"> and cs.finish_date = #{finishDate}</if>
|
|
<if test="erpBill != null and erpBill != ''"> and cs.erp_bill = #{erpBill}</if>
|
|
<if test="stockSource != null and stockSource != ''"> and cs.stock_source = #{stockSource}</if>
|
|
<if test="departmentNo != null and departmentNo != ''"> and cs.department_no = #{departmentNo}</if>
|
|
<if test="customerNo != null and customerNo != ''"> and cs.customer_no = #{customerNo}</if>
|
|
<if test="classNo != null and classNo != ''"> and cs.class_no = #{classNo}</if>
|
|
<if test="supplierNo != null and supplierNo != ''"> and cs.supplier_no = #{supplierNo}</if>
|
|
<if test="spare1 != null and spare1 != ''"> and cs.spare1 = #{spare1}</if>
|
|
<if test="spare2 != null and spare2 != ''"> and cs.spare2 = #{spare2}</if>
|
|
<if test="spare3 != null and spare3 != ''"> and cs.spare3 = #{spare3}</if>
|
|
<if test="spare4 != null and spare4 != ''"> and cs.spare4 = #{spare4}</if>
|
|
<if test="spare5 != null and spare5 != ''"> and cs.spare5 = #{spare5}</if>
|
|
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
|
|
${params.warehouseDataScope}
|
|
</if>
|
|
</where>
|
|
order by cs.create_date asc
|
|
</select>
|
|
|
|
<select id="selectCheckStockinByStockGuid" parameterType="String" resultMap="CheckStockinResult">
|
|
<include refid="selectCheckStockinVo"/>
|
|
where stock_guid = #{stockGuid}
|
|
</select>
|
|
<select id="autoAllot" parameterType="java.util.Map" statementType="CALLABLE">
|
|
{
|
|
call proc_check_auto_allocation(
|
|
#{v_stock_check_detail_id,mode=IN,jdbcType=VARCHAR},
|
|
#{v_result,mode=OUT,jdbcType=VARCHAR},
|
|
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
|
)
|
|
}
|
|
</select>
|
|
|
|
<insert id="insertCheckStockin" parameterType="CheckStockin">
|
|
insert into check_stockin
|
|
<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="finishDate != null">finish_date,</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>
|
|
<if test="spare1 != null">spare1,</if>
|
|
<if test="spare2 != null">spare2,</if>
|
|
<if test="spare3 != null">spare3,</if>
|
|
<if test="spare4 != null">spare4,</if>
|
|
<if test="spare5 != null">spare5,</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="finishDate != null">#{finishDate},</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>
|
|
<if test="spare1 != null">#{spare1},</if>
|
|
<if test="spare2 != null">#{spare2},</if>
|
|
<if test="spare3 != null">#{spare3},</if>
|
|
<if test="spare4 != null">#{spare4},</if>
|
|
<if test="spare5 != null">#{spare5},</if>
|
|
</trim>
|
|
</insert>
|
|
<insert id="insertCheckStockinHistory">
|
|
insert into check_stockin_finish
|
|
select * from check_stockin where stock_guid = #{stockGuid}
|
|
</insert>
|
|
|
|
<update id="updateCheckStockin" parameterType="CheckStockin">
|
|
update check_stockin
|
|
<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="finishDate != null">finish_date = #{finishDate},</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>
|
|
<if test="spare1 != null">spare1 = #{spare1},</if>
|
|
<if test="spare2 != null">spare2 = #{spare2},</if>
|
|
<if test="spare3 != null">spare3 = #{spare3},</if>
|
|
<if test="spare4 != null">spare4 = #{spare4},</if>
|
|
<if test="spare5 != null">spare5 = #{spare5},</if>
|
|
</trim>
|
|
where stock_guid = #{stockGuid}
|
|
</update>
|
|
|
|
<delete id="deleteCheckStockinByStockGuid" parameterType="String">
|
|
delete from check_stockin where stock_guid = #{stockGuid}
|
|
</delete>
|
|
|
|
<delete id="deleteCheckStockinByStockGuids" parameterType="String">
|
|
delete from check_stockin where stock_guid in
|
|
<foreach item="stockGuid" collection="array" open="(" separator="," close=")">
|
|
#{stockGuid}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|