Files
FTC25009/ruoyi-admin/src/main/resources/mapper/out/OutStockoutMapper.xml
2026-06-24 09:13:18 +08:00

271 lines
19 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.stockout.mapper.OutStockoutMapper">
<resultMap type="OutStockout" id="OutStockoutResult">
<result property="stockoutId" column="stockout_id" />
<result property="outType" column="out_type" />
<result property="stockSource" column="stock_source" />
<result property="status" column="status" />
<result property="createDate" column="create_date" />
<result property="startDate" column="start_date" />
<result property="finishDate" column="finish_date" />
<result property="erpBill" column="erp_bill" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" />
<result property="userId" column="user_id" />
<result property="userName" column="user_name" />
<result property="deptId" column="dept_id" />
<result property="deptName" column="dept_name" />
<result property="customerId" column="customer_id" />
<result property="customerName" column="customer_name" />
<result property="documentN" column="document_n" />
<result property="documentDat" column="document_dat" />
<result property="projectNam" column="project_nam" />
<result property="counterpart" column="counterpart" />
<result property="receivingOr" column="receiving_or" />
<result property="purchasingOr" column="purchasing_or" />
<result property="receivingDep" column="receiving_dep" />
<result property="purchasingDep" column="purchasing_dep" />
<result property="handle" column="handle" />
<result property="creato" column="creato" />
<result property="logisticsCompany" column="logistics_" />
<result property="logisticsN" column="logistics_n" />
<result property="warehous" column="warehous" />
<result property="printCoun" column="print_coun" />
<result property="tota" column="tota" />
<result property="reviewe" column="reviewe" />
<result property="createDat" column="create_dat" />
<result property="reviewDat" column="review_dat" />
<result property="receive" column="receive" />
<result property="receiverA" column="receiver_a" />
<result property="receiverPhon" column="receiver_phon" />
<result property="materialRe" column="material_re" />
</resultMap>
<sql id="selectOutStockoutVo">
select stockout_id, out_type, stock_source, status, create_date, start_date, finish_date, erp_bill, warehouse_id, warehouse_name, user_id, user_name, dept_id, dept_name, customer_id, customer_name,
document_n, document_dat, project_nam, counterpart, receiving_or, purchasing_or, receiving_dep, purchasing_dep,
handle, creato, logistics_, logistics_n, warehous, print_coun, tota, reviewe, create_dat, review_dat,
receive, receiver_a, receiver_phon, material_re
from out_stockout
</sql>
<sql id="selectOutStockoutFinishVo">
select stockout_id, out_type, stock_source, status, create_date, start_date, finish_date, erp_bill, warehouse_id, warehouse_name, user_id, user_name, dept_id, dept_name, customer_id, customer_name,
document_n, document_dat, project_nam, counterpart, receiving_or, purchasing_or, receiving_dep, purchasing_dep,
handle, creato, logistics_, logistics_n, warehous, print_coun, tota, reviewe, create_dat, review_dat,
receive, receiver_a, receiver_phon, material_re
from out_stockout_finish
</sql>
<select id="selectOutStockoutList" parameterType="OutStockout" resultMap="OutStockoutResult">
<include refid="selectOutStockoutVo"/>
<where>
<if test="outType != null and outType != ''"> and out_type = #{outType}</if>
<if test="stockSource != null and stockSource != ''"> and stock_source = #{stockSource}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''"> and create_date between #{params.beginCreateDate} and #{params.endCreateDate}</if>
<if test="params.beginStartDate != null and params.beginStartDate != '' and params.endStartDate != null and params.endStartDate != ''"> and start_date between #{params.beginStartDate} and #{params.endStartDate}</if>
<if test="params.beginFinishDate != null and params.beginFinishDate != '' and params.endFinishDate != null and params.endFinishDate != ''"> and finish_date between #{params.beginFinishDate} and #{params.endFinishDate}</if>
<if test="erpBill != null and erpBill != ''"> and erp_bill = #{erpBill}</if>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="documentN != null and documentN != ''"> and document_n like concat('%', #{documentN}, '%')</if>
<if test="projectNam != null and projectNam != ''"> and project_nam like concat('%', #{projectNam}, '%')</if>
<if test="counterpart != null and counterpart != ''"> and counterpart like concat('%', #{counterpart}, '%')</if>
${params.warehouseScope}
</where>
</select>
<select id="selectOutStockoutByStockoutId" parameterType="String" resultMap="OutStockoutResult">
<include refid="selectOutStockoutVo"/>
where stockout_id = #{stockoutId}
</select>
<select id="selectOutStockoutFinishList" parameterType="OutStockout" resultMap="OutStockoutResult">
<include refid="selectOutStockoutFinishVo"/>
<where>
<if test="outType != null and outType != ''"> and out_type = #{outType}</if>
<if test="stockSource != null and stockSource != ''"> and stock_source = #{stockSource}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="params.beginCreateDate != null and params.beginCreateDate != '' and params.endCreateDate != null and params.endCreateDate != ''"> and create_date between #{params.beginCreateDate} and #{params.endCreateDate}</if>
<if test="params.beginStartDate != null and params.beginStartDate != '' and params.endStartDate != null and params.endStartDate != ''"> and start_date between #{params.beginStartDate} and #{params.endStartDate}</if>
<if test="params.beginFinishDate != null and params.beginFinishDate != '' and params.endFinishDate != null and params.endFinishDate != ''"> and finish_date between #{params.beginFinishDate} and #{params.endFinishDate}</if>
<if test="erpBill != null and erpBill != ''"> and erp_bill = #{erpBill}</if>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="documentN != null and documentN != ''"> and document_n like concat('%', #{documentN}, '%')</if>
<if test="projectNam != null and projectNam != ''"> and project_nam like concat('%', #{projectNam}, '%')</if>
<if test="counterpart != null and counterpart != ''"> and counterpart like concat('%', #{counterpart}, '%')</if>
${params.warehouseScope}
</where>
</select>
<select id="autoAssignOutStockoutByProc" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_out_auto_allocation(
#{v_stockout_detail_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultString,mode=OUT,jdbcType=VARCHAR}
)}
</select>
<insert id="insertOutStockout" parameterType="OutStockout">
insert into out_stockout
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stockoutId != null">stockout_id,</if>
<if test="outType != null and outType != ''">out_type,</if>
<if test="stockSource != null and stockSource != ''">stock_source,</if>
<if test="status != null and status != ''">status,</if>
<if test="createDate != null">create_date,</if>
<if test="startDate != null">start_date,</if>
<if test="finishDate != null">finish_date,</if>
<if test="erpBill != null">erp_bill,</if>
<if test="warehouseId != null and warehouseId != ''">warehouse_id,</if>
<if test="warehouseName != null and warehouseName != ''">warehouse_name,</if>
<if test="userId != null">user_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="deptId != null">dept_id,</if>
<if test="deptName != null and deptName != ''">dept_name,</if>
<if test="customerId != null">customer_id,</if>
<if test="customerName != null">customer_name,</if>
<if test="documentN != null and documentN != ''">document_n,</if>
<if test="documentDat != null">document_dat,</if>
<if test="projectNam != null and projectNam != ''">project_nam,</if>
<if test="counterpart != null and counterpart != ''">counterpart,</if>
<if test="receivingOr != null and receivingOr != ''">receiving_or,</if>
<if test="purchasingOr != null and purchasingOr != ''">purchasing_or,</if>
<if test="receivingDep != null and receivingDep != ''">receiving_dep,</if>
<if test="purchasingDep != null and purchasingDep != ''">purchasing_dep,</if>
<if test="handle != null and handle != ''">handle,</if>
<if test="creato != null and creato != ''">creato,</if>
<if test="logisticsCompany != null and logisticsCompany != ''">logistics_,</if>
<if test="logisticsN != null and logisticsN != ''">logistics_n,</if>
<if test="warehous != null and warehous != ''">warehous,</if>
<if test="printCoun != null">print_coun,</if>
<if test="tota != null">tota,</if>
<if test="reviewe != null and reviewe != ''">reviewe,</if>
<if test="createDat != null">create_dat,</if>
<if test="reviewDat != null">review_dat,</if>
<if test="receive != null and receive != ''">receive,</if>
<if test="receiverA != null and receiverA != ''">receiver_a,</if>
<if test="receiverPhon != null and receiverPhon != ''">receiver_phon,</if>
<if test="materialRe != null and materialRe != ''">material_re,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockoutId != null">#{stockoutId},</if>
<if test="outType != null and outType != ''">#{outType},</if>
<if test="stockSource != null and stockSource != ''">#{stockSource},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="createDate != null">#{createDate},</if>
<if test="startDate != null">#{startDate},</if>
<if test="finishDate != null">#{finishDate},</if>
<if test="erpBill != null">#{erpBill},</if>
<if test="warehouseId != null and warehouseId != ''">#{warehouseId},</if>
<if test="warehouseName != null and warehouseName != ''">#{warehouseName},</if>
<if test="userId != null">#{userId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="deptId != null">#{deptId},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="customerId != null">#{customerId},</if>
<if test="customerName != null">#{customerName},</if>
<if test="documentN != null and documentN != ''">#{documentN},</if>
<if test="documentDat != null">#{documentDat},</if>
<if test="projectNam != null and projectNam != ''">#{projectNam},</if>
<if test="counterpart != null and counterpart != ''">#{counterpart},</if>
<if test="receivingOr != null and receivingOr != ''">#{receivingOr},</if>
<if test="purchasingOr != null and purchasingOr != ''">#{purchasingOr},</if>
<if test="receivingDep != null and receivingDep != ''">#{receivingDep},</if>
<if test="purchasingDep != null and purchasingDep != ''">#{purchasingDep},</if>
<if test="handle != null and handle != ''">#{handle},</if>
<if test="creato != null and creato != ''">#{creato},</if>
<if test="logisticsCompany != null and logisticsCompany != ''">#{logisticsCompany},</if>
<if test="logisticsN != null and logisticsN != ''">#{logisticsN},</if>
<if test="warehous != null and warehous != ''">#{warehous},</if>
<if test="printCoun != null">#{printCoun},</if>
<if test="tota != null">#{tota},</if>
<if test="reviewe != null and reviewe != ''">#{reviewe},</if>
<if test="createDat != null">#{createDat},</if>
<if test="reviewDat != null">#{reviewDat},</if>
<if test="receive != null and receive != ''">#{receive},</if>
<if test="receiverA != null and receiverA != ''">#{receiverA},</if>
<if test="receiverPhon != null and receiverPhon != ''">#{receiverPhon},</if>
<if test="materialRe != null and materialRe != ''">#{materialRe},</if>
</trim>
</insert>
<update id="updateOutStockout" parameterType="OutStockout">
update out_stockout
<trim prefix="SET" suffixOverrides=",">
<if test="outType != null and outType != ''">out_type = #{outType},</if>
<if test="stockSource != null and stockSource != ''">stock_source = #{stockSource},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="createDate != null">create_date = #{createDate},</if>
<if test="startDate != null">start_date = #{startDate},</if>
<if test="finishDate != null">finish_date = #{finishDate},</if>
<if test="erpBill != null">erp_bill = #{erpBill},</if>
<if test="warehouseId != null and warehouseId != ''">warehouse_id = #{warehouseId},</if>
<if test="warehouseName != null and warehouseName != ''">warehouse_name = #{warehouseName},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="userName != null and userName != ''">user_name = #{userName},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="customerId != null">customer_id = #{customerId},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="documentN != null and documentN != ''">document_n = #{documentN},</if>
<if test="documentDat != null">document_dat = #{documentDat},</if>
<if test="projectNam != null and projectNam != ''">project_nam = #{projectNam},</if>
<if test="counterpart != null and counterpart != ''">counterpart = #{counterpart},</if>
<if test="receivingOr != null and receivingOr != ''">receiving_or = #{receivingOr},</if>
<if test="purchasingOr != null and purchasingOr != ''">purchasing_or = #{purchasingOr},</if>
<if test="receivingDep != null and receivingDep != ''">receiving_dep = #{receivingDep},</if>
<if test="purchasingDep != null and purchasingDep != ''">purchasing_dep = #{purchasingDep},</if>
<if test="handle != null and handle != ''">handle = #{handle},</if>
<if test="creato != null and creato != ''">creato = #{creato},</if>
<if test="logisticsCompany != null and logisticsCompany != ''">logistics_ = #{logisticsCompany},</if>
<if test="logisticsN != null and logisticsN != ''">logistics_n = #{logisticsN},</if>
<if test="warehous != null and warehous != ''">warehous = #{warehous},</if>
<if test="printCoun != null">print_coun = #{printCoun},</if>
<if test="tota != null">tota = #{tota},</if>
<if test="reviewe != null and reviewe != ''">reviewe = #{reviewe},</if>
<if test="createDat != null">create_dat = #{createDat},</if>
<if test="reviewDat != null">review_dat = #{reviewDat},</if>
<if test="receive != null and receive != ''">receive = #{receive},</if>
<if test="receiverA != null and receiverA != ''">receiver_a = #{receiverA},</if>
<if test="receiverPhon != null and receiverPhon != ''">receiver_phon = #{receiverPhon},</if>
<if test="materialRe != null and materialRe != ''">material_re = #{materialRe},</if>
</trim>
where stockout_id = #{stockoutId}
</update>
<select id="updateOutStockOutByProc" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_update_outbill_status(
#{v_stockout_id,mode=IN,jdbcType=VARCHAR},
#{v_status,mode=IN,jdbcType=INTEGER},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultString,mode=OUT,jdbcType=VARCHAR}
)}
</select>
<select id="manualAssignOutStockoutByProc" parameterType="java.util.Map" statementType="CALLABLE">
{call proc_out_hand_allocation(
#{v_stockout_detail_id,mode=IN,jdbcType=VARCHAR},
#{v_stock_id,mode=IN,jdbcType=VARCHAR},
#{v_result,mode=OUT,jdbcType=INTEGER},
#{v_resultString,mode=OUT,jdbcType=VARCHAR}
)}
</select>
<delete id="deleteOutStockoutByStockoutId" parameterType="String">
delete from out_stockout where stockout_id = #{stockoutId}
</delete>
<delete id="deleteOutStockoutByStockoutIds" parameterType="String">
delete from out_stockout where stockout_id in
<foreach item="stockoutId" collection="array" open="(" separator="," close=")">
#{stockoutId}
</foreach>
</delete>
</mapper>