Files
FT546MWS/ruoyi-admin/src/main/resources/mapper/out/OutStockoutBackMapper.xml
1009473166@qq.com af4c0a274d 1
2026-07-31 10:17:43 +08:00

226 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.out.outStockoutBack.mapper.OutStockoutBackMapper">
<resultMap type="OutStockoutBack" id="OutStockoutBackResult">
<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="carNumber" column="car_number" />
<result property="FID" column="FID" />
<result property="erpStockoutId" column="erp_stockout_id" />
<result property="startDate" column="start_date" />
<result property="finishDate" column="finish_date" />
<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="spare7" column="spare7" />
<result property="spare8" column="spare8" />
<result property="sendStatus" column="send_status" />
<result property="sendTime" column="send_time" />
<result property="msg" column="msg" />
<result property="companyShortName" column="company_short_name" />
<result property="accountSetNo" column="account_set_no" />
</resultMap>
<sql id="selectOutStockoutBackVo">
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,
car_number,
FID,
erp_stockout_id,
start_date,
finish_date,
spare1,
spare2,
spare3,
spare4,
spare5,
spare6,
spare7,
spare8,
send_status,
send_time,
msg,
company_short_name,
account_set_no
from out_stockout_back
</sql>
<select id="selectOutStockoutBackList" parameterType="OutStockoutBack" resultMap="OutStockoutBackResult">
<include refid="selectOutStockoutBackVo"/>
<where>
<if test="stockoutGuid != null and stockoutGuid != ''"> and stockout_guid like concat('%', #{stockoutGuid}, '%')</if>
<if test="stockoutId != null and stockoutId != ''"> and stockout_id like concat('%', #{stockoutId}, '%')</if>
<if test="outType != null and outType != ''"> and out_type like concat('%', #{outType}, '%')</if>
<if test="createDate != null and createDate != ''"> and create_date like concat('%', #{createDate}, '%')</if>
<if test="departmentNo != null and departmentNo != ''"> and department_no like concat('%', #{departmentNo}, '%')</if>
<if test="customerNo != null and customerNo != ''"> and customer_no like concat('%', #{customerNo}, '%')</if>
<if test="createManId != null and createManId != ''"> and create_man_id like concat('%', #{createManId}, '%')</if>
<if test="status != null and status != ''"> and status like concat('%', #{status}, '%')</if>
<if test="stockoutSource != null and stockoutSource != ''"> and stockout_source like concat('%', #{stockoutSource}, '%')</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id like concat('%', #{warehouseId}, '%')</if>
<if test="classNowId != null and classNowId != ''"> and class_now_id like concat('%', #{classNowId}, '%')</if>
<if test="exitId != null and exitId != ''"> and exit_id like concat('%', #{exitId}, '%')</if>
<if test="carNumber != null and carNumber != ''"> and car_number like concat('%', #{carNumber}, '%')</if>
<if test="FID != null and FID != ''"> and FID like concat('%', #{FID}, '%')</if>
<if test="erpStockoutId != null and erpStockoutId != ''"> and erp_stockout_id like concat('%', #{erpStockoutId}, '%')</if>
<if test="startDate != null and startDate != ''"> and start_date like concat('%', #{startDate}, '%')</if>
<if test="finishDate != null and finishDate != ''"> and finish_date like concat('%', #{finishDate}, '%')</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="spare3 != null and spare3 != ''"> and spare3 like concat('%', #{spare3}, '%')</if>
<if test="spare4 != null and spare4 != ''"> and spare4 like concat('%', #{spare4}, '%')</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="sendStatus != null and sendStatus != ''"> and send_status like concat('%', #{sendStatus}, '%')</if>
<if test="sendTime != null and sendTime != ''"> and send_time like concat('%', #{sendTime}, '%')</if>
<if test="msg != null and msg != ''"> and msg like concat('%', #{msg}, '%')</if>
</where>
</select>
<select id="selectOutStockoutBackByStockoutGuid" parameterType="String" resultMap="OutStockoutBackResult">
<include refid="selectOutStockoutBackVo"/>
where stockout_guid = #{stockoutGuid}
</select>
<select id="selelctTopOutStockout" resultMap="OutStockoutBackResult">
select top(1)* from out_stockout_back where send_status=0 and stockout_source = 1
</select>
<insert id="insertOutStockoutBack" parameterType="OutStockoutBack">
insert into out_stockout_back
<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="carNumber != null">car_number,</if>
<if test="FID != null">FID,</if>
<if test="erpStockoutId != null">erp_stockout_id,</if>
<if test="startDate != null">start_date,</if>
<if test="finishDate != null">finish_date,</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="spare6 != null">spare6,</if>
<if test="spare7 != null">spare7,</if>
<if test="spare8 != null">spare8,</if>
<if test="sendStatus != null">send_status,</if>
<if test="sendTime != null">send_time,</if>
<if test="msg != null">msg,</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="carNumber != null">#{carNumber},</if>
<if test="FID != null">#{FID},</if>
<if test="erpStockoutId != null">#{erpStockoutId},</if>
<if test="startDate != null">#{startDate},</if>
<if test="finishDate != null">#{finishDate},</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="spare6 != null">#{spare6},</if>
<if test="spare7 != null">#{spare7},</if>
<if test="spare8 != null">#{spare8},</if>
<if test="sendStatus != null">#{sendStatus},</if>
<if test="sendTime != null">#{sendTime},</if>
<if test="msg != null">#{msg},</if>
</trim>
</insert>
<update id="updateOutStockoutBack" parameterType="OutStockoutBack">
update out_stockout_back
<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="carNumber != null">car_number = #{carNumber},</if>
<if test="FID != null">FID = #{FID},</if>
<if test="erpStockoutId != null">erp_stockout_id = #{erpStockoutId},</if>
<if test="startDate != null">start_date = #{startDate},</if>
<if test="finishDate != null">finish_date = #{finishDate},</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="spare6 != null">spare6 = #{spare6},</if>
<if test="spare7 != null">spare7 = #{spare7},</if>
<if test="spare8 != null">spare8 = #{spare8},</if>
<if test="sendStatus != null">send_status = #{sendStatus},</if>
<if test="sendTime != null">send_time = #{sendTime},</if>
<if test="msg != null">msg = #{msg},</if>
</trim>
where stockout_guid = #{stockoutGuid}
</update>
<delete id="deleteOutStockoutBackByStockoutGuid" parameterType="String">
delete from out_stockout_back where stockout_guid = #{stockoutGuid}
</delete>
<delete id="deleteOutStockoutBackByStockoutGuids" parameterType="String">
delete from out_stockout_back where stockout_guid in
<foreach item="stockoutGuid" collection="array" open="(" separator="," close=")">
#{stockoutGuid}
</foreach>
</delete>
</mapper>