Files
FT501-WMS/ruoyi-admin/src/main/resources/mapper/search/ViewStockoutHistoryMapper.xml

188 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.search.ViewStockoutHistory.mapper.ViewStockoutHistoryMapper">
<resultMap type="ViewStockoutHistory" id="ViewStockoutHistoryResult">
<result property="stockoutId" column="stockout_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="outType" column="out_type" />
<result property="createDate" column="create_date" />
<result property="createManId" column="create_man_id" />
<result property="status" column="status" />
<result property="stockoutSource" column="stockout_source" />
<result property="exitId" column="exit_id" />
<result property="stockoutDetailId" column="stockout_detail_id" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="lotNo" column="lot_no" />
<result property="quantity" column="quantity" />
<result property="allotQuantity" column="allot_quantity" />
<result property="assignNum" column="assign_num" />
<result property="erpStockoutId" column="erp_stockout_id" />
<result property="entryid" column="entryid" />
<result property="customerName" column="customer_name" />
<result property="spec" column="spec" />
<result property="unit" column="unit" />
<result property="price" column="price" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
<result property="spare7" column="spare7" />
<result property="spare8" column="spare8" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectViewStockoutHistoryVo">
select stockout_id,warehouse_id, out_type, create_date, create_man_id, status, stockout_source, exit_id, stockout_detail_id, product_id, product_name, lot_no, quantity, allot_quantity, assign_num, erp_stockout_id, entryid, customer_name, spec, unit, price, remark,spare1,spare2,spare5,spare6,spare7,spare8 from view_stockout_history
</sql>
<select id="selectViewStockoutHistoryList" parameterType="ViewStockoutHistory" resultMap="ViewStockoutHistoryResult">
<include refid="selectViewStockoutHistoryVo"/>
<where>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id like concat('%', #{stockoutId}, '%')</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id like concat('%', #{warehouseId}, '%')</if>
<if test="outType != null and outType != ''"> and out_type = #{outType}</if>
<if test="createDate != null and createDate != ''"> and create_date like concat('%', #{createDate}, '%')</if>
<if test="createManId != null and createManId != ''"> and create_man_id like concat('%', #{createManId}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="stockoutSource != null and stockoutSource != ''"> and stockout_source like concat('%', #{stockoutSource}, '%')</if>
<if test="exitId != null and exitId != ''"> and exit_id like concat('%', #{exitId}, '%')</if>
<if test="stockoutDetailId != null and stockoutDetailId != ''"> and stockout_detail_id like concat('%', #{stockoutDetailId}, '%')</if>
<if test="productId != null and productId != ''"> and product_id like concat('%', #{productId}, '%')</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="lotNo != null and lotNo != ''"> and lot_no like concat('%', #{lotNo}, '%')</if>
<if test="quantity != null "> and quantity like concat('%', #{quantity}, '%')</if>
<if test="allotQuantity != null "> and allot_quantity like concat('%', #{allotQuantity}, '%')</if>
<if test="assignNum != null "> and assign_num like concat('%', #{assignNum}, '%')</if>
<if test="erpStockoutId != null and erpStockoutId != ''"> and erp_stockout_id like concat('%', #{erpStockoutId}, '%')</if>
<if test="entryid != null and entryid != ''"> and entryid like concat('%', #{entryid}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="spec != null and spec != ''"> and spec like concat('%', #{spec}, '%')</if>
<if test="unit != null and unit != ''"> and unit like concat('%', #{unit}, '%')</if>
<if test="price != null and price != ''"> and price like concat('%', #{price}, '%')</if>
<if test="spare1 != null and spare1 != ''"> and spare1 like concat('%', #{spare1}, '%')</if>
<if test="spare2 != null and spare2 != ''"> and spare2 like concat('%', #{spare2}, '%')</if>
<if test="spare5 != null and spare5 != ''"> and spare5 like concat('%', #{spare5}, '%')</if>
<if test="spare6 != null and spare6 != ''"> and spare6 like concat('%', #{spare6}, '%')</if>
<if test="spare7 != null and spare7 != ''"> and spare7 like concat('%', #{spare7}, '%')</if>
<if test="spare8 != null and spare8 != ''"> and spare8 like concat('%', #{spare8}, '%')</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where>
</select>
<select id="selectViewStockoutHistoryByStockoutId" parameterType="String" resultMap="ViewStockoutHistoryResult">
<include refid="selectViewStockoutHistoryVo"/>
where stockout_id = #{stockoutId}
</select>
<insert id="insertViewStockoutHistory" parameterType="ViewStockoutHistory">
insert into view_stockout_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stockoutId != null and stockoutId != ''">stockout_id,</if>
<if test="outType != null">out_type,</if>
<if test="createDate != null">create_date,</if>
<if test="createManId != null">create_man_id,</if>
<if test="status != null">status,</if>
<if test="stockoutSource != null">stockout_source,</if>
<if test="exitId != null">exit_id,</if>
<if test="stockoutDetailId != null">stockout_detail_id,</if>
<if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="lotNo != null">lot_no,</if>
<if test="quantity != null">quantity,</if>
<if test="allotQuantity != null">allot_quantity,</if>
<if test="assignNum != null">assign_num,</if>
<if test="erpStockoutId != null">erp_stockout_id,</if>
<if test="entryid != null">entryid,</if>
<if test="customerName != null">customer_name,</if>
<if test="spec != null">spec,</if>
<if test="unit != null">unit,</if>
<if test="price != null">price,</if>
<if test="remark != null">remark,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare6 != null">spare6,</if>
<if test="spare7 != null">spare7,</if>
<if test="spare8 != null">spare8,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockoutId != null and stockoutId != ''">#{stockoutId},</if>
<if test="outType != null">#{outType},</if>
<if test="createDate != null">#{createDate},</if>
<if test="createManId != null">#{createManId},</if>
<if test="status != null">#{status},</if>
<if test="stockoutSource != null">#{stockoutSource},</if>
<if test="exitId != null">#{exitId},</if>
<if test="stockoutDetailId != null">#{stockoutDetailId},</if>
<if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="lotNo != null">#{lotNo},</if>
<if test="quantity != null">#{quantity},</if>
<if test="allotQuantity != null">#{allotQuantity},</if>
<if test="assignNum != null">#{assignNum},</if>
<if test="erpStockoutId != null">#{erpStockoutId},</if>
<if test="entryid != null">#{entryid},</if>
<if test="customerName != null">#{customerName},</if>
<if test="spec != null">#{spec},</if>
<if test="unit != null">#{unit},</if>
<if test="price != null">#{price},</if>
<if test="remark != null">#{remark},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare6 != null">#{spare6},</if>
<if test="spare7 != null">#{spare7},</if>
<if test="spare8 != null">#{spare8},</if>
</trim>
</insert>
<update id="updateViewStockoutHistory" parameterType="ViewStockoutHistory">
update view_stockout_history
<trim prefix="SET" suffixOverrides=",">
<if test="outType != null">out_type = #{outType},</if>
<if test="createDate != null">create_date = #{createDate},</if>
<if test="createManId != null">create_man_id = #{createManId},</if>
<if test="status != null">status = #{status},</if>
<if test="stockoutSource != null">stockout_source = #{stockoutSource},</if>
<if test="exitId != null">exit_id = #{exitId},</if>
<if test="stockoutDetailId != null">stockout_detail_id = #{stockoutDetailId},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="lotNo != null">lot_no = #{lotNo},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="allotQuantity != null">allot_quantity = #{allotQuantity},</if>
<if test="assignNum != null">assign_num = #{assignNum},</if>
<if test="erpStockoutId != null">erp_stockout_id = #{erpStockoutId},</if>
<if test="entryid != null">entryid = #{entryid},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="price != null">price = #{price},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
<if test="spare7 != null">spare7 = #{spare7},</if>
<if test="spare8 != null">spare8 = #{spare8},</if>
</trim>
where stockout_id = #{stockoutId}
</update>
<delete id="deleteViewStockoutHistoryByStockoutId" parameterType="String">
delete from view_stockout_history where stockout_id = #{stockoutId}
</delete>
<delete id="deleteViewStockoutHistoryByStockoutIds" parameterType="String">
delete from view_stockout_history where stockout_id in
<foreach item="stockoutId" collection="array" open="(" separator="," close=")">
#{stockoutId}
</foreach>
</delete>
</mapper>