Files
FT546MWS/ruoyi-admin/src/main/resources/mapper/search/ViewStockoutHistoryMapper.xml
猫猫guowen 572c27be13 查询统计
2026-01-09 17:08:24 +08:00

203 lines
13 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.search.ViewStockoutHistory.mapper.ViewStockoutHistoryMapper">
<resultMap type="ViewStockoutHistory" id="ViewStockoutHistoryResult">
<result property="stockoutGuid" column="stockout_guid" />
<result property="stockoutId" column="stockout_id" />
<result property="outType" column="out_type" />
<result property="createDate" column="create_date" />
<result property="departmentNo" column="department_no" />
<result property="customerNo" column="customer_no" />
<result property="createManId" column="create_man_id" />
<result property="status" column="status" />
<result property="stockoutSource" column="stockout_source" />
<result property="warehouseId" column="warehouse_id" />
<result property="classNowId" column="class_now_id" />
<result property="exitId" column="exit_id" />
<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="stockoutDetailId" column="stockout_detail_id" />
<result property="lotNo" column="lot_no" />
<result property="productId" column="product_id" />
<result property="quantity" column="quantity" />
<result property="assignNum" column="assign_num" />
<result property="allotQuantity" column="allot_quantity" />
<result property="remark" column="remark" />
<result property="unit" column="unit" />
<result property="spec" column="spec" />
<result property="productName" column="product_name" />
<result property="cjgx" column="cjgx" />
<result property="scwl" column="scwl" />
<result property="dcwl" column="dcwl" />
<result property="spare9" column="spare9" />
</resultMap>
<sql id="selectViewStockoutHistoryVo">
select stockout_guid, stockout_id, out_type, create_date, department_no, customer_no, create_man_id, status, stockout_source, warehouse_id, class_now_id, exit_id, spare1, spare2, spare3, spare4, spare5, stockout_detail_id, lot_no, product_id, quantity, assign_num, allot_quantity, remark, unit, spec, product_name, cjgx, scwl, dcwl, spare9 from view_stockout_history
</sql>
<select id="selectViewStockoutHistoryList" parameterType="ViewStockoutHistory" resultMap="ViewStockoutHistoryResult">
<include refid="selectViewStockoutHistoryVo"/>
<where>
<if test="stockoutGuid != null and stockoutGuid != ''"> and stockout_guid = #{stockoutGuid}</if>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id like concat('%', #{stockoutId}, '%')</if>
<if test="outType != null and outType != ''"> and out_type = #{outType}</if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</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="createManId != null and createManId != ''"> and create_man_id = #{createManId}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="stockoutSource != null and stockoutSource != ''"> and stockout_source = #{stockoutSource}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="classNowId != null and classNowId != ''"> and class_now_id = #{classNowId}</if>
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</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="stockoutDetailId != null and stockoutDetailId != ''"> and stockout_detail_id = #{stockoutDetailId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="assignNum != null "> and assign_num = #{assignNum}</if>
<if test="allotQuantity != null "> and allot_quantity = #{allotQuantity}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="spec != null and spec != ''"> and spec = #{spec}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="cjgx != null and cjgx != ''"> and cjgx = #{cjgx}</if>
<if test="scwl != null and scwl != ''"> and scwl = #{scwl}</if>
<if test="dcwl != null and dcwl != ''"> and dcwl = #{dcwl}</if>
<if test="spare9 != null and spare9 != ''"> and spare9 = #{spare9}</if>
</where>
</select>
<select id="selectViewStockoutHistoryByStockoutGuid" parameterType="String" resultMap="ViewStockoutHistoryResult">
<include refid="selectViewStockoutHistoryVo"/>
where stockout_guid = #{stockoutGuid}
</select>
<insert id="insertViewStockoutHistory" parameterType="ViewStockoutHistory">
insert into view_stockout_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stockoutGuid != null and stockoutGuid != ''">stockout_guid,</if>
<if test="stockoutId != null and stockoutId != ''">stockout_id,</if>
<if test="outType != null and outType != ''">out_type,</if>
<if test="createDate != null and createDate != ''">create_date,</if>
<if test="departmentNo != null">department_no,</if>
<if test="customerNo != null">customer_no,</if>
<if test="createManId != null">create_man_id,</if>
<if test="status != null and status != ''">status,</if>
<if test="stockoutSource != null">stockout_source,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="classNowId != null">class_now_id,</if>
<if test="exitId != null">exit_id,</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>
<if test="stockoutDetailId != null and stockoutDetailId != ''">stockout_detail_id,</if>
<if test="lotNo != null">lot_no,</if>
<if test="productId != null">product_id,</if>
<if test="quantity != null">quantity,</if>
<if test="assignNum != null">assign_num,</if>
<if test="allotQuantity != null">allot_quantity,</if>
<if test="remark != null">remark,</if>
<if test="unit != null">unit,</if>
<if test="spec != null">spec,</if>
<if test="productName != null">product_name,</if>
<if test="cjgx != null">cjgx,</if>
<if test="scwl != null">scwl,</if>
<if test="dcwl != null">dcwl,</if>
<if test="spare9 != null">spare9,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockoutGuid != null and stockoutGuid != ''">#{stockoutGuid},</if>
<if test="stockoutId != null and stockoutId != ''">#{stockoutId},</if>
<if test="outType != null and outType != ''">#{outType},</if>
<if test="createDate != null and createDate != ''">#{createDate},</if>
<if test="departmentNo != null">#{departmentNo},</if>
<if test="customerNo != null">#{customerNo},</if>
<if test="createManId != null">#{createManId},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="stockoutSource != null">#{stockoutSource},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="classNowId != null">#{classNowId},</if>
<if test="exitId != null">#{exitId},</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>
<if test="stockoutDetailId != null and stockoutDetailId != ''">#{stockoutDetailId},</if>
<if test="lotNo != null">#{lotNo},</if>
<if test="productId != null">#{productId},</if>
<if test="quantity != null">#{quantity},</if>
<if test="assignNum != null">#{assignNum},</if>
<if test="allotQuantity != null">#{allotQuantity},</if>
<if test="remark != null">#{remark},</if>
<if test="unit != null">#{unit},</if>
<if test="spec != null">#{spec},</if>
<if test="productName != null">#{productName},</if>
<if test="cjgx != null">#{cjgx},</if>
<if test="scwl != null">#{scwl},</if>
<if test="dcwl != null">#{dcwl},</if>
<if test="spare9 != null">#{spare9},</if>
</trim>
</insert>
<update id="updateViewStockoutHistory" parameterType="ViewStockoutHistory">
update view_stockout_history
<trim prefix="SET" suffixOverrides=",">
<if test="stockoutId != null and stockoutId != ''">stockout_id = #{stockoutId},</if>
<if test="outType != null and outType != ''">out_type = #{outType},</if>
<if test="createDate != null and createDate != ''">create_date = #{createDate},</if>
<if test="departmentNo != null">department_no = #{departmentNo},</if>
<if test="customerNo != null">customer_no = #{customerNo},</if>
<if test="createManId != null">create_man_id = #{createManId},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="stockoutSource != null">stockout_source = #{stockoutSource},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="classNowId != null">class_now_id = #{classNowId},</if>
<if test="exitId != null">exit_id = #{exitId},</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>
<if test="stockoutDetailId != null and stockoutDetailId != ''">stockout_detail_id = #{stockoutDetailId},</if>
<if test="lotNo != null">lot_no = #{lotNo},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="assignNum != null">assign_num = #{assignNum},</if>
<if test="allotQuantity != null">allot_quantity = #{allotQuantity},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="cjgx != null">cjgx = #{cjgx},</if>
<if test="scwl != null">scwl = #{scwl},</if>
<if test="dcwl != null">dcwl = #{dcwl},</if>
<if test="spare9 != null">spare9 = #{spare9},</if>
</trim>
where stockout_guid = #{stockoutGuid}
</update>
<delete id="deleteViewStockoutHistoryByStockoutGuid" parameterType="String">
delete from view_stockout_history where stockout_guid = #{stockoutGuid}
</delete>
<delete id="deleteViewStockoutHistoryByStockoutGuids" parameterType="String">
delete from view_stockout_history where stockout_guid in
<foreach item="stockoutGuid" collection="array" open="(" separator="," close=")">
#{stockoutGuid}
</foreach>
</delete>
</mapper>