盘点差异,入库联查字段修改,历史单据作业查询

This commit is contained in:
liuhanqing
2025-05-29 08:41:12 +08:00
parent 91d042e4e5
commit 4e4c64439c
50 changed files with 2477 additions and 336 deletions

View File

@@ -0,0 +1,117 @@
<?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.difference.mapper.CheckDifferenceRecordMapper">
<resultMap type="CheckDifferenceRecord" id="CheckDifferenceRecordResult">
<result property="checkGuid" column="check_guid" />
<result property="checkStockDetailId" column="check_stock_detail_id" />
<result property="stockId" column="stock_id" />
<result property="trayCode" column="tray_code" />
<result property="cargoSpaceId" column="cargo_space_id" />
<result property="productId" column="product_id" />
<result property="lotNo" column="lot_no" />
<result property="supplier" column="supplier" />
<result property="customer" column="customer" />
<result property="oldQuantity" column="old_quantity" />
<result property="newQuantity" column="new_quantity" />
<result property="recordType" column="record_type" />
<result property="createTime" column="create_time" />
<result property="productGuid" column="product_guid" />
</resultMap>
<sql id="selectCheckDifferenceRecordVo">
select check_guid, check_stock_detail_id, stock_id, tray_code, cargo_space_id, product_id, lot_no, supplier, customer, old_quantity, new_quantity, record_type, create_time, product_guid from check_difference_record
</sql>
<select id="selectCheckDifferenceRecordList" parameterType="CheckDifferenceRecord" resultMap="CheckDifferenceRecordResult">
<include refid="selectCheckDifferenceRecordVo"/>
<where>
<if test="checkStockDetailId != null and checkStockDetailId != ''"> and check_stock_detail_id = #{checkStockDetailId}</if>
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="supplier != null and supplier != ''"> and supplier = #{supplier}</if>
<if test="customer != null and customer != ''"> and customer = #{customer}</if>
<if test="oldQuantity != null and oldQuantity != ''"> and old_quantity = #{oldQuantity}</if>
<if test="newQuantity != null and newQuantity != ''"> and new_quantity = #{newQuantity}</if>
<if test="recordType != null "> and record_type = #{recordType}</if>
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
</where>
</select>
<select id="selectCheckDifferenceRecordByCheckGuid" parameterType="String" resultMap="CheckDifferenceRecordResult">
<include refid="selectCheckDifferenceRecordVo"/>
where check_guid = #{checkGuid}
</select>
<insert id="insertCheckDifferenceRecord" parameterType="CheckDifferenceRecord">
insert into check_difference_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkGuid != null">check_guid,</if>
<if test="checkStockDetailId != null">check_stock_detail_id,</if>
<if test="stockId != null">stock_id,</if>
<if test="trayCode != null">tray_code,</if>
<if test="cargoSpaceId != null">cargo_space_id,</if>
<if test="productId != null">product_id,</if>
<if test="lotNo != null">lot_no,</if>
<if test="supplier != null">supplier,</if>
<if test="customer != null">customer,</if>
<if test="oldQuantity != null">old_quantity,</if>
<if test="newQuantity != null">new_quantity,</if>
<if test="recordType != null">record_type,</if>
<if test="createTime != null">create_time,</if>
<if test="productGuid != null">product_guid,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkGuid != null">#{checkGuid},</if>
<if test="checkStockDetailId != null">#{checkStockDetailId},</if>
<if test="stockId != null">#{stockId},</if>
<if test="trayCode != null">#{trayCode},</if>
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
<if test="productId != null">#{productId},</if>
<if test="lotNo != null">#{lotNo},</if>
<if test="supplier != null">#{supplier},</if>
<if test="customer != null">#{customer},</if>
<if test="oldQuantity != null">#{oldQuantity},</if>
<if test="newQuantity != null">#{newQuantity},</if>
<if test="recordType != null">#{recordType},</if>
<if test="createTime != null">#{createTime},</if>
<if test="productGuid != null">#{productGuid},</if>
</trim>
</insert>
<update id="updateCheckDifferenceRecord" parameterType="CheckDifferenceRecord">
update check_difference_record
<trim prefix="SET" suffixOverrides=",">
<if test="checkStockDetailId != null">check_stock_detail_id = #{checkStockDetailId},</if>
<if test="stockId != null">stock_id = #{stockId},</if>
<if test="trayCode != null">tray_code = #{trayCode},</if>
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="lotNo != null">lot_no = #{lotNo},</if>
<if test="supplier != null">supplier = #{supplier},</if>
<if test="customer != null">customer = #{customer},</if>
<if test="oldQuantity != null">old_quantity = #{oldQuantity},</if>
<if test="newQuantity != null">new_quantity = #{newQuantity},</if>
<if test="recordType != null">record_type = #{recordType},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="productGuid != null">product_guid = #{productGuid},</if>
</trim>
where check_guid = #{checkGuid}
</update>
<delete id="deleteCheckDifferenceRecordByCheckGuid" parameterType="String">
delete from check_difference_record where check_guid = #{checkGuid}
</delete>
<delete id="deleteCheckDifferenceRecordByCheckGuids" parameterType="String">
delete from check_difference_record where check_guid in
<foreach item="checkGuid" collection="array" open="(" separator="," close=")">
#{checkGuid}
</foreach>
</delete>
</mapper>

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.in.stockindetailfinish.mapper.InStockinDetailFinishMapper">
<resultMap type="InStockinDetailFinish" id="InStockinDetailFinishResult">
<result property="stockinDetailId" column="stockin_detail_id" />
<result property="stockinGuid" column="stockin_guid" />
@@ -36,14 +36,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="scanNumX" column="scan_num_x" />
<result property="scanNumJ" column="scan_num_j" />
</resultMap>
<resultMap type="InStockinDetail" id="InStockinDetailResult">
<result property="stockinDetailId" column="stockin_detail_id" />
<result property="stockinGuid" column="stockin_guid" />
<result property="stockinId" column="stockin_id" />
<result property="lotNo" column="lot_no" />
<result property="productGuid" column="product_guid" />
<result property="productId" column="product_id" />
<result property="quantity" column="quantity" />
<result property="quantityX" column="quantity_x" />
<result property="quantityJ" column="quantity_j" />
<result property="price" column="price" />
<result property="cargoNo" column="cargo_no" />
<result property="remark" column="remark" />
<result property="assignNum" column="assign_num" />
<result property="assignNumX" column="assign_num_x" />
<result property="assignNumJ" column="assign_num_j" />
<result property="printDate" column="print_date" />
<result property="stockStatus" column="stock_status" />
<result property="supplierId" column="supplier_id" />
<result property="customerId" column="customer_id" />
<result property="unit" column="unit" />
<result property="spec" column="spec" />
<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="spare6" column="spare6" />
<result property="scanNum" column="scan_num" />
<result property="scanNumX" column="scan_num_x" />
<result property="scanNumJ" column="scan_num_j" />
</resultMap>
<sql id="selectInStockinDetailFinishVo">
select stockin_detail_id, stockin_guid, stockin_id, lot_no, product_guid, product_id, quantity, quantity_x, quantity_j, price, cargo_no, remark, assign_num, assign_num_x, assign_num_j, print_date, stock_status, supplier_id, customer_id, unit, spec, spare1, spare2, spare3, spare4, spare5, spare6, scan_num, scan_num_x, scan_num_j from in_stockin_detail_finish
</sql>
<select id="selectInStockinDetailFinishList" parameterType="InStockinDetailFinish" resultMap="InStockinDetailFinishResult">
<include refid="selectInStockinDetailFinishVo"/>
<where>
<where>
<if test="stockinGuid != null and stockinGuid != ''"> and stockin_guid = #{stockinGuid}</if>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
@@ -74,11 +105,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="scanNumJ != null and scanNumJ != ''"> and scan_num_j = #{scanNumJ}</if>
</where>
</select>
<select id="selectInStockinDetailFinishByStockinDetailId" parameterType="String" resultMap="InStockinDetailFinishResult">
<include refid="selectInStockinDetailFinishVo"/>
where stockin_detail_id = #{stockinDetailId}
</select>
<select id="selectInStockinDetailFinishListByInStockinDetail"
resultMap="InStockinDetailResult">
<include refid="selectInStockinDetailFinishVo"/>
<where>
<if test="stockinGuid != null and stockinGuid != ''"> and stockin_guid = #{stockinGuid}</if>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if>
<if test="quantityX != null and quantityX != ''"> and quantity_x = #{quantityX}</if>
<if test="quantityJ != null and quantityJ != ''"> and quantity_j = #{quantityJ}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no = #{cargoNo}</if>
<if test="assignNum != null and assignNum != ''"> and assign_num = #{assignNum}</if>
<if test="assignNumX != null and assignNumX != ''"> and assign_num_x = #{assignNumX}</if>
<if test="assignNumJ != null and assignNumJ != ''"> and assign_num_j = #{assignNumJ}</if>
<if test="printDate != null and printDate != ''"> and print_date = #{printDate}</if>
<if test="stockStatus != null and stockStatus != ''"> and stock_status = #{stockStatus}</if>
<if test="supplierId != null and supplierId != ''"> and supplier_id = #{supplierId}</if>
<if test="customerId != null and customerId != ''"> and customer_id = #{customerId}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="spec != null and spec != ''"> and spec = #{spec}</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="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
<if test="scanNum != null and scanNum != ''"> and scan_num = #{scanNum}</if>
<if test="scanNumX != null and scanNumX != ''"> and scan_num_x = #{scanNumX}</if>
<if test="scanNumJ != null and scanNumJ != ''"> and scan_num_j = #{scanNumJ}</if>
</where>
</select>
<insert id="insertInStockinDetailFinish" parameterType="InStockinDetailFinish">
insert into in_stockin_detail_finish
@@ -189,9 +254,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteInStockinDetailFinishByStockinDetailIds" parameterType="String">
delete from in_stockin_detail_finish where stockin_detail_id in
delete from in_stockin_detail_finish where stockin_detail_id in
<foreach item="stockinDetailId" collection="array" open="(" separator="," close=")">
#{stockinDetailId}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.in.stockinfinish.mapper.InStockinFinishMapper">
<resultMap type="InStockinFinish" id="InStockinFinishResult">
<result property="stockinGuid" column="stockin_guid" />
<result property="stockinId" column="stockin_id" />
@@ -26,37 +26,112 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare5" column="spare5" />
</resultMap>
<resultMap type="InStockin" id="InStockinResult">
<result property="stockinGuid" column="stockin_guid" />
<result property="stockinId" column="stockin_id" />
<result property="inType" column="in_type" />
<result property="createDate" column="create_date" />
<result property="createManId" column="create_man_id" />
<result property="createManName" column="user_name" />
<result property="status" column="status" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" />
<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="dept_name" />
<result property="customerNo" column="customer_no" />
<result property="classNo" column="class_no" />
<result property="supplierNo" column="supplier_no" />
<result property="supplierName" column="supplier_name" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare4" column="spare4" />
<result property="spare3" column="spare3" />
<result property="spare5" column="spare5" />
</resultMap>
<sql id="selectInStockinFinishVo">
select stockin_guid, stockin_id, in_type, create_date, create_man_id, status, warehouse_id, finish_date, erp_bill, stock_source, department_no, customer_no, class_no, supplier_no, spare1, spare2, spare3, spare4, spare5 from in_stockin_finish
</sql>
select is2.stockin_guid,
is2.stockin_id,
is2.in_type,
is2.create_date,
is2.create_man_id,
is2.status,
is2.warehouse_id,
is2.finish_date,
is2.erp_bill,
is2.stock_source,
is2.department_no,
is2.customer_no,
is2.class_no,
is2.supplier_no,
is2.spare1,
is2.spare2,
is2.spare4,
is2.spare3,
is2.spare5,
bw.warehouse_name,
bs.supplier_name,
sd.dept_name ,
su.user_name
from in_stockin_finish is2
left join bas_warehouse bw on is2.warehouse_id = bw.warehouse_id
left join bas_supplier bs on bs.supplier_no = is2.supplier_no
left join sys_dept sd on is2.department_no = sd.dept_id
left join sys_user su on su.user_id = is2.create_man_id</sql>
<select id="selectInStockinFinishList" parameterType="InStockinFinish" resultMap="InStockinFinishResult">
<include refid="selectInStockinFinishVo"/>
<where>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and in_type = #{inType}</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="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>
<where>
<if test="stockinId != null and stockinId != ''"> and is2.stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and is2.in_type = #{inType}</if>
<if test="createDate != null and createDate != ''"> and is2.create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and is2.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and is2.status = #{status}</if>
<if test="warehouseId != null and warehouseId != ''"> and is2.warehouse_id = #{warehouseId}</if>
<if test="finishDate != null and finishDate != ''"> and is2.finish_date = #{finishDate}</if>
<if test="erpBill != null and erpBill != ''"> and is2.erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and is2.stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and is2.department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and is2.customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and is2.class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and is2.supplier_no = #{supplierNo}</if>
<if test="spare1 != null and spare1 != ''"> and is2.spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and is2.spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and is2.spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and is2.spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and is2.spare5 = #{spare5}</if>
</where>
</select>
<select id="selectInStockinFinishByStockinGuid" parameterType="String" resultMap="InStockinFinishResult">
<include refid="selectInStockinFinishVo"/>
where stockin_guid = #{stockinGuid}
where is2.stockin_guid = #{stockinGuid}
</select>
<select id="selectInStockinFinishListByInStockin" resultMap="InStockinResult">
<include refid="selectInStockinFinishVo"/>
<where>
<if test="stockinId != null and stockinId != ''"> and is2.stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and is2.in_type = #{inType}</if>
<if test="createDate != null and createDate != ''"> and is2.create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and is2.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and is2.status = #{status}</if>
<if test="warehouseId != null and warehouseId != ''"> and is2.warehouse_id = #{warehouseId}</if>
<if test="finishDate != null and finishDate != ''"> and is2.finish_date = #{finishDate}</if>
<if test="erpBill != null and erpBill != ''"> and is2.erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and is2.stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and is2.department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and is2.customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and is2.class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and is2.supplier_no = #{supplierNo}</if>
<if test="spare1 != null and spare1 != ''"> and is2.spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and is2.spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and is2.spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and is2.spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and is2.spare5 = #{spare5}</if>
</where>
</select>
<insert id="insertInStockinFinish" parameterType="InStockinFinish">
@@ -135,9 +210,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteInStockinFinishByStockinGuids" parameterType="String">
delete from in_stockin_finish where stockin_guid in
delete from in_stockin_finish where stockin_guid in
<foreach item="stockinGuid" collection="array" open="(" separator="," close=")">
#{stockinGuid}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -10,15 +10,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inType" column="in_type" />
<result property="createDate" column="create_date" />
<result property="createManId" column="create_man_id" />
<result property="createManName" column="user_name" />
<result property="status" column="status" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" />
<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="dept_name" />
<result property="customerNo" column="customer_no" />
<result property="classNo" column="class_no" />
<result property="supplierNo" column="supplier_no" />
<result property="supplierName" column="supplier_name" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare4" column="spare4" />
@@ -27,36 +31,63 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectInStockinVo">
select stockin_guid, stockin_id, in_type, create_date, create_man_id, status, warehouse_id, finish_date, erp_bill, stock_source, department_no, customer_no, class_no, supplier_no, spare1, spare2, spare4, spare3, spare5 from in_stockin
select is2.stockin_guid,
is2.stockin_id,
is2.in_type,
is2.create_date,
is2.create_man_id,
is2.status,
is2.warehouse_id,
is2.finish_date,
is2.erp_bill,
is2.stock_source,
is2.department_no,
is2.customer_no,
is2.class_no,
is2.supplier_no,
is2.spare1,
is2.spare2,
is2.spare4,
is2.spare3,
is2.spare5,
bw.warehouse_name,
bs.supplier_name,
sd.dept_name ,
su.user_name
from in_stockin is2
left join bas_warehouse bw on is2.warehouse_id = bw.warehouse_id
left join bas_supplier bs on bs.supplier_no = is2.supplier_no
left join sys_dept sd on is2.department_no = sd.dept_id
left join sys_user su on su.user_id = is2.create_man_id
</sql>
<select id="selectInStockinList" parameterType="InStockin" resultMap="InStockinResult">
<include refid="selectInStockinVo"/>
<where>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and in_type = #{inType}</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="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="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="stockinId != null and stockinId != ''"> and is2.stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and is2.in_type = #{inType}</if>
<if test="createDate != null and createDate != ''"> and is2.create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and is2.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and is2.status = #{status}</if>
<if test="warehouseId != null and warehouseId != ''"> and is2.warehouse_id = #{warehouseId}</if>
<if test="finishDate != null and finishDate != ''"> and is2.finish_date = #{finishDate}</if>
<if test="erpBill != null and erpBill != ''"> and is2.erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and is2.stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and is2.department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and is2.customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and is2.class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and is2.supplier_no = #{supplierNo}</if>
<if test="spare1 != null and spare1 != ''"> and is2.spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and is2.spare2 = #{spare2}</if>
<if test="spare4 != null and spare4 != ''"> and is2.spare4 = #{spare4}</if>
<if test="spare3 != null and spare3 != ''"> and is2.spare3 = #{spare3}</if>
<if test="spare5 != null and spare5 != ''"> and is2.spare5 = #{spare5}</if>
</where>
</select>
<select id="selectInStockinByStockinGuid" parameterType="String" resultMap="InStockinResult">
<include refid="selectInStockinVo"/>
where stockin_guid = #{stockinGuid}
where is2.stockin_guid = #{stockinGuid}
</select>
<insert id="insertInStockin" parameterType="InStockin">

View File

@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="cargoSpaceName" column="cargo_space_name" />
<result property="targetCargoSpaceName" column="target_cargo_space_name" />
<result property="warehouseName" column="warehouse_name" />
<result property="departmentName" column="dept_name" />
</resultMap>
<sql id="selectMydoJobVo">
@@ -45,13 +46,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
mj.exit_id, mj.class_id, mj.warehouse_id, mj.fault_flag,
bs.supplier_name as supplier_name, bc.customer_name as customer_name,
bcs.cargo_space_name as cargo_space_name, bcst.cargo_space_name as target_cargo_space_name,
bw.warehouse_name as warehouse_name
bw.warehouse_name as warehouse_name,sd.dept_name
from mydo_job mj
left join bas_supplier bs on mj.supplier_id = bs.id
left join bas_customer bc on mj.customer_id = bc.id
left join bas_cargo_space bcs on mj.cargo_space_id = bcs.cargo_space_id
left join bas_cargo_space bcst on mj.target_cargo_space_id = bcst.cargo_space_id
left join bas_warehouse bw on mj.warehouse_id = bw.warehouse_id
left join sys_dept sd on mj.department_id = sd.dept_id
</sql>

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.receive.stockindetailfinish.mapper.ReceiveStockinDetailFinishMapper">
<resultMap type="ReceiveStockinDetailFinish" id="ReceiveStockinDetailFinishResult">
<result property="stockinDetailId" column="stockin_detail_id" />
<result property="stockinGuid" column="stockin_guid" />
@@ -33,6 +33,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
</resultMap>
<resultMap type="ReceiveStockinDetail" id="ReceiveStockinDetailResult">
<result property="stockinDetailId" column="stockin_detail_id" />
<result property="stockinGuid" column="stockin_guid" />
<result property="stockinId" column="stockin_id" />
<result property="lotNo" column="lot_no" />
<result property="productGuid" column="product_guid" />
<result property="productId" column="product_id" />
<result property="quantity" column="quantity" />
<result property="quantityX" column="quantity_x" />
<result property="quantityJ" column="quantity_j" />
<result property="price" column="price" />
<result property="cargoNo" column="cargo_no" />
<result property="remark" column="remark" />
<result property="assignNum" column="assign_num" />
<result property="assignNumX" column="assign_num_x" />
<result property="assignNumJ" column="assign_num_j" />
<result property="printDate" column="print_date" />
<result property="stockStatus" column="stock_status" />
<result property="supplierId" column="supplier_id" />
<result property="customerId" column="customer_id" />
<result property="unit" column="unit" />
<result property="spec" column="spec" />
<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="spare6" column="spare6" />
</resultMap>
<sql id="selectReceiveStockinDetailFinishVo">
select stockin_detail_id, stockin_guid, stockin_id, lot_no, product_guid, product_id, quantity, quantity_x, quantity_j, price, cargo_no, remark, assign_num, assign_num_x, assign_num_j, print_date, stock_status, supplier_id, customer_id, unit, spec, spare1, spare2, spare3, spare4, spare5, spare6 from receive_stockin_detail_finish
@@ -40,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectReceiveStockinDetailFinishList" parameterType="ReceiveStockinDetailFinish" resultMap="ReceiveStockinDetailFinishResult">
<include refid="selectReceiveStockinDetailFinishVo"/>
<where>
<where>
<if test="stockinGuid != null and stockinGuid != ''"> and stockin_guid = #{stockinGuid}</if>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
@@ -68,11 +97,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
</where>
</select>
<select id="selectReceiveStockinDetailFinishByStockinDetailId" parameterType="String" resultMap="ReceiveStockinDetailFinishResult">
<include refid="selectReceiveStockinDetailFinishVo"/>
where stockin_detail_id = #{stockinDetailId}
</select>
<select id="selectReceiveStockinDetailList"
resultMap="ReceiveStockinDetailResult">
<include refid="selectReceiveStockinDetailFinishVo"/>
<where>
<if test="stockinGuid != null and stockinGuid != ''"> and stockin_guid = #{stockinGuid}</if>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="productGuid != null and productGuid != ''"> and product_guid = #{productGuid}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if>
<if test="quantityX != null and quantityX != ''"> and quantity_x = #{quantityX}</if>
<if test="quantityJ != null and quantityJ != ''"> and quantity_j = #{quantityJ}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no = #{cargoNo}</if>
<if test="assignNum != null and assignNum != ''"> and assign_num = #{assignNum}</if>
<if test="assignNumX != null and assignNumX != ''"> and assign_num_x = #{assignNumX}</if>
<if test="assignNumJ != null and assignNumJ != ''"> and assign_num_j = #{assignNumJ}</if>
<if test="printDate != null and printDate != ''"> and print_date = #{printDate}</if>
<if test="stockStatus != null and stockStatus != ''"> and stock_status = #{stockStatus}</if>
<if test="supplierId != null and supplierId != ''"> and supplier_id = #{supplierId}</if>
<if test="customerId != null and customerId != ''"> and customer_id = #{customerId}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="spec != null and spec != ''"> and spec = #{spec}</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="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
</where>
</select>
<insert id="insertReceiveStockinDetailFinish" parameterType="ReceiveStockinDetailFinish">
insert into receive_stockin_detail_finish
@@ -174,9 +234,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteReceiveStockinDetailFinishByStockinDetailIds" parameterType="String">
delete from receive_stockin_detail_finish where stockin_detail_id in
delete from receive_stockin_detail_finish where stockin_detail_id in
<foreach item="stockinDetailId" collection="array" open="(" separator="," close=")">
#{stockinDetailId}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.receive.stockinfinish.mapper.ReceiveStockinFinishMapper">
<resultMap type="ReceiveStockinFinish" id="ReceiveStockinFinishResult">
<result property="stockinGuid" column="stockin_guid" />
<result property="stockinId" column="stockin_id" />
@@ -25,39 +25,115 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="classNo" column="class_no" />
<result property="supplierNo" column="supplier_no" />
</resultMap>
<resultMap type="ReceiveStockin" id="ReceiveStockinResult">
<result property="stockinGuid" column="stockin_guid" />
<result property="stockinId" column="stockin_id" />
<result property="inType" column="in_type" />
<result property="createDate" column="create_date" />
<result property="createManId" column="create_man_id" />
<result property="createManName" column="user_name" />
<result property="status" column="status" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" />
<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="departmentName" column="dept_name" />
<result property="customerNo" column="customer_no" />
<result property="classNo" column="class_no" />
<result property="supplierNo" column="supplier_no" />
<result property="supplierName" column="supplier_name" />
</resultMap>
<sql id="selectReceiveStockinFinishVo">
select stockin_guid, stockin_id, in_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 receive_stockin_finish
select
rs.stockin_guid ,
rs.stockin_id ,
rs.in_type ,
rs.create_date ,
rs.create_man_id ,
rs.status ,
rs.warehouse_id ,
bw.warehouse_name ,
rs.spare5 ,
rs.spare4 ,
rs.spare3 ,
rs.finish_date ,
rs.spare2 ,
rs.spare1,
rs.erp_bill ,
rs.stock_source,
rs.department_no,
rs.customer_no,
rs.class_no,
rs.supplier_no,
bs.supplier_name,
sd.dept_name,
su.user_name
from receive_stockin_finish rs
left join bas_warehouse bw on rs.warehouse_id = bw.warehouse_id
left join bas_supplier bs on rs.supplier_no = bs.supplier_no
left join sys_dept sd on rs.department_no = sd.dept_id
left join sys_user su on su.user_id = rs.create_man_id
</sql>
<select id="selectReceiveStockinFinishList" parameterType="ReceiveStockinFinish" resultMap="ReceiveStockinFinishResult">
<include refid="selectReceiveStockinFinishVo"/>
<where>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and in_type = #{inType}</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>
<if test="stockinId != null and stockinId != ''"> and rs.stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and rs.in_type = #{inType}</if>
<if test="createDate != null and createDate != ''"> and rs.create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and rs.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and rs.status = #{status}</if>
<if test="warehouseId != null and warehouseId != ''"> and rs.warehouse_id = #{warehouseId}</if>
<if test="spare5 != null and spare5 != ''"> and rs.spare5 = #{spare5}</if>
<if test="spare4 != null and spare4 != ''"> and rs.spare4 = #{spare4}</if>
<if test="spare3 != null and spare3 != ''"> and rs.spare3 = #{spare3}</if>
<if test="finishDate != null and finishDate != ''"> and rs.finish_date = #{finishDate}</if>
<if test="spare2 != null and spare2 != ''"> and rs.spare2 = #{spare2}</if>
<if test="spare1 != null and spare1 != ''"> and rs.spare1 = #{spare1}</if>
<if test="erpBill != null and erpBill != ''"> and rs.erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and rs.stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and rs.department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and rs.customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and rs.class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and rs.supplier_no = #{supplierNo}</if>
</where>
</select>
<select id="selectReceiveStockinFinishByStockinGuid" parameterType="String" resultMap="ReceiveStockinFinishResult">
<include refid="selectReceiveStockinFinishVo"/>
where stockin_guid = #{stockinGuid}
</select>
<select id="selectReceiveStockinList" resultMap="ReceiveStockinResult">
<include refid="selectReceiveStockinFinishVo"/>
<where>
<if test="stockinId != null and stockinId != ''"> and rs.stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and rs.in_type = #{inType}</if>
<if test="createDate != null and createDate != ''"> and rs.create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and rs.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and rs.status = #{status}</if>
<if test="warehouseId != null and warehouseId != ''"> and rs.warehouse_id = #{warehouseId}</if>
<if test="spare5 != null and spare5 != ''"> and rs.spare5 = #{spare5}</if>
<if test="spare4 != null and spare4 != ''"> and rs.spare4 = #{spare4}</if>
<if test="spare3 != null and spare3 != ''"> and rs.spare3 = #{spare3}</if>
<if test="finishDate != null and finishDate != ''"> and rs.finish_date = #{finishDate}</if>
<if test="spare2 != null and spare2 != ''"> and rs.spare2 = #{spare2}</if>
<if test="spare1 != null and spare1 != ''"> and rs.spare1 = #{spare1}</if>
<if test="erpBill != null and erpBill != ''"> and rs.erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and rs.stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and rs.department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and rs.customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and rs.class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and rs.supplier_no = #{supplierNo}</if>
</where>
</select>
<insert id="insertReceiveStockinFinish" parameterType="ReceiveStockinFinish">
insert into receive_stockin_finish
@@ -135,9 +211,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteReceiveStockinFinishByStockinGuids" parameterType="String">
delete from receive_stockin_finish where stockin_guid in
delete from receive_stockin_finish where stockin_guid in
<foreach item="stockinGuid" collection="array" open="(" separator="," close=")">
#{stockinGuid}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -10,8 +10,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inType" column="in_type" />
<result property="createDate" column="create_date" />
<result property="createManId" column="create_man_id" />
<result property="createManName" column="user_name" />
<result property="status" column="status" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" />
<result property="spare5" column="spare5" />
<result property="spare4" column="spare4" />
<result property="spare3" column="spare3" />
@@ -21,42 +23,73 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="erpBill" column="erp_bill" />
<result property="stockSource" column="stock_source" />
<result property="departmentNo" column="department_no" />
<result property="departmentName" column="dept_name" />
<result property="customerNo" column="customer_no" />
<result property="classNo" column="class_no" />
<result property="supplierNo" column="supplier_no" />
<result property="supplierName" column="supplier_name" />
</resultMap>
<sql id="selectReceiveStockinVo">
select stockin_guid, stockin_id, in_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 receive_stockin
select
rs.stockin_guid ,
rs.stockin_id ,
rs.in_type ,
rs.create_date ,
rs.create_man_id ,
rs.status ,
rs.warehouse_id ,
bw.warehouse_name ,
rs.spare5 ,
rs.spare4 ,
rs.spare3 ,
rs.finish_date ,
rs.spare2 ,
rs.spare1,
rs.erp_bill ,
rs.stock_source,
rs.department_no,
rs.customer_no,
rs.class_no,
rs.supplier_no,
bs.supplier_name,
sd.dept_name,
su.user_name
from receive_stockin rs
left join bas_warehouse bw on rs.warehouse_id = bw.warehouse_id
left join bas_supplier bs on rs.supplier_no = bs.supplier_no
left join sys_dept sd on rs.department_no = sd.dept_id
left join sys_user su on su.user_id = rs.create_man_id
</sql>
<select id="selectReceiveStockinList" parameterType="ReceiveStockin" resultMap="ReceiveStockinResult">
<include refid="selectReceiveStockinVo"/>
<where>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and in_type = #{inType}</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>
<if test="stockinId != null and stockinId != ''"> and rs.stockin_id = #{stockinId}</if>
<if test="inType != null and inType != ''"> and rs.in_type = #{inType}</if>
<if test="createDate != null and createDate != ''"> and rs.create_date = #{createDate}</if>
<if test="createManId != null and createManId != ''"> and rs.create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and rs.status = #{status}</if>
<if test="warehouseId != null and warehouseId != ''"> and rs.warehouse_id = #{warehouseId}</if>
<if test="spare5 != null and spare5 != ''"> and rs.spare5 = #{spare5}</if>
<if test="spare4 != null and spare4 != ''"> and rs.spare4 = #{spare4}</if>
<if test="spare3 != null and spare3 != ''"> and rs.spare3 = #{spare3}</if>
<if test="finishDate != null and finishDate != ''"> and rs.finish_date = #{finishDate}</if>
<if test="spare2 != null and spare2 != ''"> and rs.spare2 = #{spare2}</if>
<if test="spare1 != null and spare1 != ''"> and rs.spare1 = #{spare1}</if>
<if test="erpBill != null and erpBill != ''"> and rs.erp_bill = #{erpBill}</if>
<if test="stockSource != null and stockSource != ''"> and rs.stock_source = #{stockSource}</if>
<if test="departmentNo != null and departmentNo != ''"> and rs.department_no = #{departmentNo}</if>
<if test="customerNo != null and customerNo != ''"> and rs.customer_no = #{customerNo}</if>
<if test="classNo != null and classNo != ''"> and rs.class_no = #{classNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and rs.supplier_no = #{supplierNo}</if>
</where>
</select>
<select id="selectReceiveStockinByStockinGuid" parameterType="String" resultMap="ReceiveStockinResult">
<include refid="selectReceiveStockinVo"/>
where stockin_guid = #{stockinGuid}
where rs.stockin_guid = #{stockinGuid}
</select>
<insert id="insertReceiveStockin" parameterType="ReceiveStockin">