查询统计

This commit is contained in:
猫猫guowen
2025-12-10 09:49:57 +08:00
parent 8e66330ed2
commit b13d29ec53
40 changed files with 2932 additions and 6036 deletions

View File

@@ -5,17 +5,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.search.ViewInJobFlow.mapper.ViewInJobFlowMapper">
<resultMap type="ViewInJobFlow" id="ViewInJobFlowResult">
<result property="jobDetailId" column="job_detail_id" />
<result property="jobId" column="job_id" />
<result property="taskNo" column="task_no" />
<result property="status" column="status" />
<result property="inOrOut" column="in_or_out" />
<result property="taskNo" column="task_no" />
<result property="trayCode" column="tray_code" />
<result property="cargoSpaceId" column="cargo_space_id" />
<result property="targetCargoSpaceId" column="target_cargo_space_id" />
<result property="createTime" column="create_time" />
<result property="startTime" column="start_time" />
<result property="finishTime" column="finish_time" />
<result property="entranceId" column="entrance_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="executionPhase" column="execution_phase" />
<result property="jobDetailId" column="job_detail_id" />
<result property="stockId" column="stock_id" />
<result property="lotNo" column="lot_no" />
<result property="inOrOutId" column="in_or_out_id" />
<result property="inOrOutDId" column="in_or_out_d_id" />
<result property="stockStatus" column="stock_status" />
<result property="inQuantity" column="in_quantity" />
<result property="stockQuantity" column="stock_quantity" />
<result property="outQuantity" column="out_quantity" />
<result property="supplierNo" column="supplier_no" />
<result property="supplierName" column="supplier_name" />
<result property="customerNo" column="customer_no" />
<result property="customerName" column="customer_name" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="parentId" column="parent_id" />
@@ -24,224 +36,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="unit" column="unit" />
<result property="spec" column="spec" />
<result property="remark" column="remark" />
<result property="productType" column="productType" />
<result property="systemItem" column="systemItem" />
<result property="productCtm" column="productCtm" />
<result property="productCtu" column="productCtu" />
<result property="upperNum" column="upperNum" />
<result property="limitNum" column="limitNum" />
<result property="enableFlag" column="enableFlag" />
<result property="inQuantity" column="in_quantity" />
<result property="lotNo" column="lot_no" />
<result property="inOrOutId" column="in_or_out_id" />
<result property="inOrOutDId" column="in_or_out_d_id" />
<result property="priceTotal" column="priceTotal" />
<result property="origin" column="origin" />
<result property="turnovertype" column="turnovertype" />
<result property="account" column="account" />
<result property="purpose" column="purpose" />
<result property="units" column="units" />
<result property="contract" column="contract" />
<result property="cases" column="cases" />
<result property="quality" column="quality" />
<result property="managementNo" column="managementNo" />
<result property="spare1" column="spare1" />
<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" />
</resultMap>
<sql id="selectViewInJobFlowVo">
select job_detail_id, job_id, task_no, status, in_or_out, tray_code, create_time, start_time, finish_time, entrance_id, warehouse_id, product_id, product_name, parent_id, price, cargo_no, unit, spec, remark, productType, systemItem, productCtm, productCtu, upperNum, limitNum, enableFlag, in_quantity, lot_no, in_or_out_id, in_or_out_d_id, priceTotal, origin, turnovertype, account, purpose, units, contract, cases, quality, managementNo from view_in_job_flow
select job_id, status, tray_code, cargo_space_id, target_cargo_space_id, create_time, start_time, finish_time, execution_phase, job_detail_id, stock_id, lot_no, in_or_out_id, in_or_out_d_id, stock_status, in_quantity, stock_quantity, out_quantity, supplier_no, supplier_name, customer_no, customer_name, parent_id, price, cargo_no, unit, spec, remark, spare1, spare3, spare4, spare5, spare6, spare7, product_id, product_name,task_no from view_in_job_flow
</sql>
<select id="selectViewInJobFlowList" parameterType="ViewInJobFlow" resultMap="ViewInJobFlowResult">
<include refid="selectViewInJobFlowVo"/>
<where>
<if test="jobDetailId != null and jobDetailId != ''"> and job_detail_id = #{jobDetailId}</if>
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
<if test="jobId != null and jobId != ''"> and job_id like concat('%', #{jobId}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="inOrOut != null "> and in_or_out = #{inOrOut}</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="targetCargoSpaceId != null and targetCargoSpaceId != ''"> and target_cargo_space_id = #{targetCargoSpaceId}</if>
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
<if test="jobDetailId != null and jobDetailId != ''"> and job_detail_id like concat('%', #{jobDetailId}, '%')</if>
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="inOrOutId != null and inOrOutId != ''"> and in_or_out_id like concat('%', #{inOrOutId}, '%')</if>
<if test="inOrOutDId != null and inOrOutDId != ''"> and in_or_out_d_id like concat('%', #{inOrOutDId}, '%')</if>
<if test="stockStatus != null and stockStatus != ''"> and stock_status = #{stockStatus}</if>
<if test="inQuantity != null and inQuantity != ''"> and in_quantity = #{inQuantity}</if>
<if test="stockQuantity != null and stockQuantity != ''"> and stock_quantity = #{stockQuantity}</if>
<if test="outQuantity != null and outQuantity != ''"> and out_quantity = #{outQuantity}</if>
<if test="supplierNo != null and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no = #{cargoNo}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="spec != null and spec != ''"> and spec = #{spec}</if>
<if test="productType != null and productType != ''"> and productType = #{productType}</if>
<if test="systemItem != null and systemItem != ''"> and systemItem = #{systemItem}</if>
<if test="productCtm != null and productCtm != ''"> and productCtm = #{productCtm}</if>
<if test="productCtu != null and productCtu != ''"> and productCtu = #{productCtu}</if>
<if test="upperNum != null and upperNum != ''"> and upperNum = #{upperNum}</if>
<if test="limitNum != null and limitNum != ''"> and limitNum = #{limitNum}</if>
<if test="enableFlag != null and enableFlag != ''"> and enableFlag = #{enableFlag}</if>
<if test="inQuantity != null and inQuantity != ''"> and in_quantity = #{inQuantity}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="inOrOutId != null and inOrOutId != ''"> and in_or_out_id = #{inOrOutId}</if>
<if test="inOrOutDId != null and inOrOutDId != ''"> and in_or_out_d_id = #{inOrOutDId}</if>
<if test="priceTotal != null and priceTotal != ''"> and priceTotal = #{priceTotal}</if>
<if test="origin != null and origin != ''"> and origin = #{origin}</if>
<if test="turnovertype != null and turnovertype != ''"> and turnovertype = #{turnovertype}</if>
<if test="account != null and account != ''"> and account = #{account}</if>
<if test="purpose != null and purpose != ''"> and purpose = #{purpose}</if>
<if test="units != null and units != ''"> and units = #{units}</if>
<if test="contract != null and contract != ''"> and contract = #{contract}</if>
<if test="cases != null and cases != ''"> and cases = #{cases}</if>
<if test="quality != null and quality != ''"> and quality = #{quality}</if>
<if test="managementNo != null and managementNo != ''"> and managementNo = #{managementNo}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</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="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
<if test="taskNo != null and taskNo != ''"> and task_no like concat('%', #{taskNo}, '%')</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>
</where>
</select>
<select id="selectViewInJobFlowByJobDetailId" parameterType="String" resultMap="ViewInJobFlowResult">
<select id="selectViewInJobFlowByJobId" parameterType="String" resultMap="ViewInJobFlowResult">
<include refid="selectViewInJobFlowVo"/>
where job_detail_id = #{jobDetailId}
where job_id = #{jobId}
</select>
<insert id="insertViewInJobFlow" parameterType="ViewInJobFlow">
insert into view_in_job_flow
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jobDetailId != null">job_detail_id,</if>
<if test="jobId != null">job_id,</if>
<if test="taskNo != null and taskNo != ''">task_no,</if>
<if test="status != null and status != ''">status,</if>
<if test="inOrOut != null">in_or_out,</if>
<if test="trayCode != null">tray_code,</if>
<if test="createTime != null">create_time,</if>
<if test="startTime != null">start_time,</if>
<if test="finishTime != null">finish_time,</if>
<if test="entranceId != null">entrance_id,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="parentId != null">parent_id,</if>
<if test="price != null">price,</if>
<if test="cargoNo != null">cargo_no,</if>
<if test="unit != null">unit,</if>
<if test="spec != null">spec,</if>
<if test="remark != null">remark,</if>
<if test="productType != null">productType,</if>
<if test="systemItem != null">systemItem,</if>
<if test="productCtm != null">productCtm,</if>
<if test="productCtu != null">productCtu,</if>
<if test="upperNum != null">upperNum,</if>
<if test="limitNum != null">limitNum,</if>
<if test="enableFlag != null">enableFlag,</if>
<if test="inQuantity != null">in_quantity,</if>
<if test="lotNo != null">lot_no,</if>
<if test="inOrOutId != null">in_or_out_id,</if>
<if test="inOrOutDId != null">in_or_out_d_id,</if>
<if test="priceTotal != null">priceTotal,</if>
<if test="origin != null">origin,</if>
<if test="turnovertype != null">turnovertype,</if>
<if test="account != null">account,</if>
<if test="purpose != null">purpose,</if>
<if test="units != null">units,</if>
<if test="contract != null">contract,</if>
<if test="cases != null">cases,</if>
<if test="quality != null">quality,</if>
<if test="managementNo != null">managementNo,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jobDetailId != null">#{jobDetailId},</if>
<if test="jobId != null">#{jobId},</if>
<if test="taskNo != null and taskNo != ''">#{taskNo},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="inOrOut != null">#{inOrOut},</if>
<if test="trayCode != null">#{trayCode},</if>
<if test="createTime != null">#{createTime},</if>
<if test="startTime != null">#{startTime},</if>
<if test="finishTime != null">#{finishTime},</if>
<if test="entranceId != null">#{entranceId},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="parentId != null">#{parentId},</if>
<if test="price != null">#{price},</if>
<if test="cargoNo != null">#{cargoNo},</if>
<if test="unit != null">#{unit},</if>
<if test="spec != null">#{spec},</if>
<if test="remark != null">#{remark},</if>
<if test="productType != null">#{productType},</if>
<if test="systemItem != null">#{systemItem},</if>
<if test="productCtm != null">#{productCtm},</if>
<if test="productCtu != null">#{productCtu},</if>
<if test="upperNum != null">#{upperNum},</if>
<if test="limitNum != null">#{limitNum},</if>
<if test="enableFlag != null">#{enableFlag},</if>
<if test="inQuantity != null">#{inQuantity},</if>
<if test="lotNo != null">#{lotNo},</if>
<if test="inOrOutId != null">#{inOrOutId},</if>
<if test="inOrOutDId != null">#{inOrOutDId},</if>
<if test="priceTotal != null">#{priceTotal},</if>
<if test="origin != null">#{origin},</if>
<if test="turnovertype != null">#{turnovertype},</if>
<if test="account != null">#{account},</if>
<if test="purpose != null">#{purpose},</if>
<if test="units != null">#{units},</if>
<if test="contract != null">#{contract},</if>
<if test="cases != null">#{cases},</if>
<if test="quality != null">#{quality},</if>
<if test="managementNo != null">#{managementNo},</if>
</trim>
</insert>
<update id="updateViewInJobFlow" parameterType="ViewInJobFlow">
update view_in_job_flow
<trim prefix="SET" suffixOverrides=",">
<if test="jobId != null">job_id = #{jobId},</if>
<if test="taskNo != null and taskNo != ''">task_no = #{taskNo},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="inOrOut != null">in_or_out = #{inOrOut},</if>
<if test="trayCode != null">tray_code = #{trayCode},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="finishTime != null">finish_time = #{finishTime},</if>
<if test="entranceId != null">entrance_id = #{entranceId},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="price != null">price = #{price},</if>
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="productType != null">productType = #{productType},</if>
<if test="systemItem != null">systemItem = #{systemItem},</if>
<if test="productCtm != null">productCtm = #{productCtm},</if>
<if test="productCtu != null">productCtu = #{productCtu},</if>
<if test="upperNum != null">upperNum = #{upperNum},</if>
<if test="limitNum != null">limitNum = #{limitNum},</if>
<if test="enableFlag != null">enableFlag = #{enableFlag},</if>
<if test="inQuantity != null">in_quantity = #{inQuantity},</if>
<if test="lotNo != null">lot_no = #{lotNo},</if>
<if test="inOrOutId != null">in_or_out_id = #{inOrOutId},</if>
<if test="inOrOutDId != null">in_or_out_d_id = #{inOrOutDId},</if>
<if test="priceTotal != null">priceTotal = #{priceTotal},</if>
<if test="origin != null">origin = #{origin},</if>
<if test="turnovertype != null">turnovertype = #{turnovertype},</if>
<if test="account != null">account = #{account},</if>
<if test="purpose != null">purpose = #{purpose},</if>
<if test="units != null">units = #{units},</if>
<if test="contract != null">contract = #{contract},</if>
<if test="cases != null">cases = #{cases},</if>
<if test="quality != null">quality = #{quality},</if>
<if test="managementNo != null">managementNo = #{managementNo},</if>
</trim>
where job_detail_id = #{jobDetailId}
</update>
<delete id="deleteViewInJobFlowByJobDetailId" parameterType="String">
delete from view_in_job_flow where job_detail_id = #{jobDetailId}
</delete>
<delete id="deleteViewInJobFlowByJobDetailIds" parameterType="String">
delete from view_in_job_flow where job_detail_id in
<foreach item="jobDetailId" collection="array" open="(" separator="," close=")">
#{jobDetailId}
</foreach>
</delete>
</mapper>

View File

@@ -5,17 +5,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.search.ViewOutJobFlow.mapper.ViewOutJobFlowMapper">
<resultMap type="ViewOutJobFlow" id="ViewOutJobFlowResult">
<result property="jobDetailId" column="job_detail_id" />
<result property="jobId" column="job_id" />
<result property="taskNo" column="task_no" />
<result property="status" column="status" />
<result property="inOrOut" column="in_or_out" />
<result property="taskNo" column="task_no" />
<result property="trayCode" column="tray_code" />
<result property="cargoSpaceId" column="cargo_space_id" />
<result property="targetCargoSpaceId" column="target_cargo_space_id" />
<result property="createTime" column="create_time" />
<result property="startTime" column="start_time" />
<result property="finishTime" column="finish_time" />
<result property="exitId" column="exit_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="executionPhase" column="execution_phase" />
<result property="jobDetailId" column="job_detail_id" />
<result property="stockId" column="stock_id" />
<result property="lotNo" column="lot_no" />
<result property="inOrOutId" column="in_or_out_id" />
<result property="inOrOutDId" column="in_or_out_d_id" />
<result property="stockStatus" column="stock_status" />
<result property="inQuantity" column="in_quantity" />
<result property="stockQuantity" column="stock_quantity" />
<result property="outQuantity" column="out_quantity" />
<result property="supplierNo" column="supplier_no" />
<result property="supplierName" column="supplier_name" />
<result property="customerNo" column="customer_no" />
<result property="customerName" column="customer_name" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="parentId" column="parent_id" />
@@ -24,96 +36,90 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="unit" column="unit" />
<result property="spec" column="spec" />
<result property="remark" column="remark" />
<result property="productType" column="productType" />
<result property="systemItem" column="systemItem" />
<result property="productCtm" column="productCtm" />
<result property="productCtu" column="productCtu" />
<result property="upperNum" column="upperNum" />
<result property="limitNum" column="limitNum" />
<result property="enableFlag" column="enableFlag" />
<result property="outQuantity" column="out_quantity" />
<result property="lotNo" column="lot_no" />
<result property="inOrOutId" column="in_or_out_id" />
<result property="inOrOutDId" column="in_or_out_d_id" />
<result property="priceTotal" column="priceTotal" />
<result property="origin" column="origin" />
<result property="turnovertype" column="turnovertype" />
<result property="account" column="account" />
<result property="purpose" column="purpose" />
<result property="units" column="units" />
<result property="contract" column="contract" />
<result property="cases" column="cases" />
<result property="quality" column="quality" />
<result property="managementNo" column="managementNo" />
<result property="spare1" column="spare1" />
<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" />
</resultMap>
<sql id="selectViewOutJobFlowVo">
select job_detail_id, job_id, task_no, status, in_or_out, tray_code, create_time, start_time, finish_time, exit_id, warehouse_id, product_id, product_name, parent_id, price, cargo_no, unit, spec, remark, productType, systemItem, productCtm, productCtu, upperNum, limitNum, enableFlag, out_quantity, lot_no, in_or_out_id, in_or_out_d_id, priceTotal, origin, turnovertype, account, purpose, units, contract, cases, quality, managementNo from view_out_job_flow
select job_id, status, task_no, tray_code, cargo_space_id, target_cargo_space_id, create_time, start_time, finish_time, execution_phase, job_detail_id, stock_id, lot_no, in_or_out_id, in_or_out_d_id, stock_status, in_quantity, stock_quantity, out_quantity, supplier_no, supplier_name, customer_no, customer_name, product_id, product_name, parent_id, price, cargo_no, unit, spec, remark, spare1, spare3, spare4, spare5, spare6, spare7 from view_out_job_flow
</sql>
<select id="selectViewOutJobFlowList" parameterType="ViewOutJobFlow" resultMap="ViewOutJobFlowResult">
<include refid="selectViewOutJobFlowVo"/>
<where>
<if test="jobDetailId != null and jobDetailId != ''"> and job_detail_id = #{jobDetailId}</if>
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
<if test="jobId != null and jobId != ''"> and job_id like concat('%', #{jobId}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="inOrOut != null "> and in_or_out = #{inOrOut}</if>
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</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="targetCargoSpaceId != null and targetCargoSpaceId != ''"> and target_cargo_space_id = #{targetCargoSpaceId}</if>
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
<if test="jobDetailId != null and jobDetailId != ''"> and job_detail_id like concat('%', #{jobDetailId}, '%')</if>
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="inOrOutId != null and inOrOutId != ''"> and in_or_out_id like concat('%', #{inOrOutId}, '%')</if>
<if test="inOrOutDId != null and inOrOutDId != ''"> and in_or_out_d_id like concat('%', #{inOrOutDId}, '%')</if>
<if test="stockStatus != null and stockStatus != ''"> and stock_status = #{stockStatus}</if>
<if test="inQuantity != null and inQuantity != ''"> and in_quantity = #{inQuantity}</if>
<if test="stockQuantity != null and stockQuantity != ''"> and stock_quantity = #{stockQuantity}</if>
<if test="outQuantity != null and outQuantity != ''"> and out_quantity = #{outQuantity}</if>
<if test="supplierNo != null and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</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="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no = #{cargoNo}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="spec != null and spec != ''"> and spec = #{spec}</if>
<if test="productType != null and productType != ''"> and productType = #{productType}</if>
<if test="systemItem != null and systemItem != ''"> and systemItem = #{systemItem}</if>
<if test="productCtm != null and productCtm != ''"> and productCtm = #{productCtm}</if>
<if test="productCtu != null and productCtu != ''"> and productCtu = #{productCtu}</if>
<if test="upperNum != null and upperNum != ''"> and upperNum = #{upperNum}</if>
<if test="limitNum != null and limitNum != ''"> and limitNum = #{limitNum}</if>
<if test="enableFlag != null and enableFlag != ''"> and enableFlag = #{enableFlag}</if>
<if test="outQuantity != null and outQuantity != ''"> and out_quantity = #{outQuantity}</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</if>
<if test="inOrOutId != null and inOrOutId != ''"> and in_or_out_id = #{inOrOutId}</if>
<if test="inOrOutDId != null and inOrOutDId != ''"> and in_or_out_d_id = #{inOrOutDId}</if>
<if test="priceTotal != null and priceTotal != ''"> and priceTotal = #{priceTotal}</if>
<if test="origin != null and origin != ''"> and origin = #{origin}</if>
<if test="turnovertype != null and turnovertype != ''"> and turnovertype = #{turnovertype}</if>
<if test="account != null and account != ''"> and account = #{account}</if>
<if test="purpose != null and purpose != ''"> and purpose = #{purpose}</if>
<if test="units != null and units != ''"> and units = #{units}</if>
<if test="contract != null and contract != ''"> and contract = #{contract}</if>
<if test="cases != null and cases != ''"> and cases = #{cases}</if>
<if test="quality != null and quality != ''"> and quality = #{quality}</if>
<if test="managementNo != null and managementNo != ''"> and managementNo = #{managementNo}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</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="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
</where>
</select>
<select id="selectViewOutJobFlowByJobDetailId" parameterType="String" resultMap="ViewOutJobFlowResult">
<select id="selectViewOutJobFlowByJobId" parameterType="String" resultMap="ViewOutJobFlowResult">
<include refid="selectViewOutJobFlowVo"/>
where job_detail_id = #{jobDetailId}
where job_id = #{jobId}
</select>
<insert id="insertViewOutJobFlow" parameterType="ViewOutJobFlow">
insert into view_out_job_flow
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="jobDetailId != null">job_detail_id,</if>
<if test="jobId != null">job_id,</if>
<if test="taskNo != null and taskNo != ''">task_no,</if>
<if test="jobId != null and jobId != ''">job_id,</if>
<if test="status != null and status != ''">status,</if>
<if test="inOrOut != null">in_or_out,</if>
<if test="taskNo != null and taskNo != ''">task_no,</if>
<if test="trayCode != null">tray_code,</if>
<if test="cargoSpaceId != null">cargo_space_id,</if>
<if test="targetCargoSpaceId != null">target_cargo_space_id,</if>
<if test="createTime != null">create_time,</if>
<if test="startTime != null">start_time,</if>
<if test="finishTime != null">finish_time,</if>
<if test="exitId != null">exit_id,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="executionPhase != null">execution_phase,</if>
<if test="jobDetailId != null">job_detail_id,</if>
<if test="stockId != null">stock_id,</if>
<if test="lotNo != null">lot_no,</if>
<if test="inOrOutId != null">in_or_out_id,</if>
<if test="inOrOutDId != null">in_or_out_d_id,</if>
<if test="stockStatus != null">stock_status,</if>
<if test="inQuantity != null">in_quantity,</if>
<if test="stockQuantity != null">stock_quantity,</if>
<if test="outQuantity != null">out_quantity,</if>
<if test="supplierNo != null">supplier_no,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="customerNo != null">customer_no,</if>
<if test="customerName != null">customer_name,</if>
<if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="parentId != null">parent_id,</if>
@@ -122,40 +128,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">unit,</if>
<if test="spec != null">spec,</if>
<if test="remark != null">remark,</if>
<if test="productType != null">productType,</if>
<if test="systemItem != null">systemItem,</if>
<if test="productCtm != null">productCtm,</if>
<if test="productCtu != null">productCtu,</if>
<if test="upperNum != null">upperNum,</if>
<if test="limitNum != null">limitNum,</if>
<if test="enableFlag != null">enableFlag,</if>
<if test="outQuantity != null">out_quantity,</if>
<if test="lotNo != null">lot_no,</if>
<if test="inOrOutId != null">in_or_out_id,</if>
<if test="inOrOutDId != null">in_or_out_d_id,</if>
<if test="priceTotal != null">priceTotal,</if>
<if test="origin != null">origin,</if>
<if test="turnovertype != null">turnovertype,</if>
<if test="account != null">account,</if>
<if test="purpose != null">purpose,</if>
<if test="units != null">units,</if>
<if test="contract != null">contract,</if>
<if test="cases != null">cases,</if>
<if test="quality != null">quality,</if>
<if test="managementNo != null">managementNo,</if>
<if test="spare1 != null">spare1,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="jobDetailId != null">#{jobDetailId},</if>
<if test="jobId != null">#{jobId},</if>
<if test="taskNo != null and taskNo != ''">#{taskNo},</if>
<if test="jobId != null and jobId != ''">#{jobId},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="inOrOut != null">#{inOrOut},</if>
<if test="taskNo != null and taskNo != ''">#{taskNo},</if>
<if test="trayCode != null">#{trayCode},</if>
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
<if test="targetCargoSpaceId != null">#{targetCargoSpaceId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="startTime != null">#{startTime},</if>
<if test="finishTime != null">#{finishTime},</if>
<if test="exitId != null">#{exitId},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="executionPhase != null">#{executionPhase},</if>
<if test="jobDetailId != null">#{jobDetailId},</if>
<if test="stockId != null">#{stockId},</if>
<if test="lotNo != null">#{lotNo},</if>
<if test="inOrOutId != null">#{inOrOutId},</if>
<if test="inOrOutDId != null">#{inOrOutDId},</if>
<if test="stockStatus != null">#{stockStatus},</if>
<if test="inQuantity != null">#{inQuantity},</if>
<if test="stockQuantity != null">#{stockQuantity},</if>
<if test="outQuantity != null">#{outQuantity},</if>
<if test="supplierNo != null">#{supplierNo},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="customerNo != null">#{customerNo},</if>
<if test="customerName != null">#{customerName},</if>
<if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="parentId != null">#{parentId},</if>
@@ -164,43 +167,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">#{unit},</if>
<if test="spec != null">#{spec},</if>
<if test="remark != null">#{remark},</if>
<if test="productType != null">#{productType},</if>
<if test="systemItem != null">#{systemItem},</if>
<if test="productCtm != null">#{productCtm},</if>
<if test="productCtu != null">#{productCtu},</if>
<if test="upperNum != null">#{upperNum},</if>
<if test="limitNum != null">#{limitNum},</if>
<if test="enableFlag != null">#{enableFlag},</if>
<if test="outQuantity != null">#{outQuantity},</if>
<if test="lotNo != null">#{lotNo},</if>
<if test="inOrOutId != null">#{inOrOutId},</if>
<if test="inOrOutDId != null">#{inOrOutDId},</if>
<if test="priceTotal != null">#{priceTotal},</if>
<if test="origin != null">#{origin},</if>
<if test="turnovertype != null">#{turnovertype},</if>
<if test="account != null">#{account},</if>
<if test="purpose != null">#{purpose},</if>
<if test="units != null">#{units},</if>
<if test="contract != null">#{contract},</if>
<if test="cases != null">#{cases},</if>
<if test="quality != null">#{quality},</if>
<if test="managementNo != null">#{managementNo},</if>
<if test="spare1 != null">#{spare1},</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>
</trim>
</insert>
<update id="updateViewOutJobFlow" parameterType="ViewOutJobFlow">
update view_out_job_flow
<trim prefix="SET" suffixOverrides=",">
<if test="jobId != null">job_id = #{jobId},</if>
<if test="taskNo != null and taskNo != ''">task_no = #{taskNo},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="inOrOut != null">in_or_out = #{inOrOut},</if>
<if test="taskNo != null and taskNo != ''">task_no = #{taskNo},</if>
<if test="trayCode != null">tray_code = #{trayCode},</if>
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
<if test="targetCargoSpaceId != null">target_cargo_space_id = #{targetCargoSpaceId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="finishTime != null">finish_time = #{finishTime},</if>
<if test="exitId != null">exit_id = #{exitId},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="executionPhase != null">execution_phase = #{executionPhase},</if>
<if test="jobDetailId != null">job_detail_id = #{jobDetailId},</if>
<if test="stockId != null">stock_id = #{stockId},</if>
<if test="lotNo != null">lot_no = #{lotNo},</if>
<if test="inOrOutId != null">in_or_out_id = #{inOrOutId},</if>
<if test="inOrOutDId != null">in_or_out_d_id = #{inOrOutDId},</if>
<if test="stockStatus != null">stock_status = #{stockStatus},</if>
<if test="inQuantity != null">in_quantity = #{inQuantity},</if>
<if test="stockQuantity != null">stock_quantity = #{stockQuantity},</if>
<if test="outQuantity != null">out_quantity = #{outQuantity},</if>
<if test="supplierNo != null">supplier_no = #{supplierNo},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="customerNo != null">customer_no = #{customerNo},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="parentId != null">parent_id = #{parentId},</if>
@@ -209,39 +209,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="unit != null">unit = #{unit},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="productType != null">productType = #{productType},</if>
<if test="systemItem != null">systemItem = #{systemItem},</if>
<if test="productCtm != null">productCtm = #{productCtm},</if>
<if test="productCtu != null">productCtu = #{productCtu},</if>
<if test="upperNum != null">upperNum = #{upperNum},</if>
<if test="limitNum != null">limitNum = #{limitNum},</if>
<if test="enableFlag != null">enableFlag = #{enableFlag},</if>
<if test="outQuantity != null">out_quantity = #{outQuantity},</if>
<if test="lotNo != null">lot_no = #{lotNo},</if>
<if test="inOrOutId != null">in_or_out_id = #{inOrOutId},</if>
<if test="inOrOutDId != null">in_or_out_d_id = #{inOrOutDId},</if>
<if test="priceTotal != null">priceTotal = #{priceTotal},</if>
<if test="origin != null">origin = #{origin},</if>
<if test="turnovertype != null">turnovertype = #{turnovertype},</if>
<if test="account != null">account = #{account},</if>
<if test="purpose != null">purpose = #{purpose},</if>
<if test="units != null">units = #{units},</if>
<if test="contract != null">contract = #{contract},</if>
<if test="cases != null">cases = #{cases},</if>
<if test="quality != null">quality = #{quality},</if>
<if test="managementNo != null">managementNo = #{managementNo},</if>
<if test="spare1 != null">spare1 = #{spare1},</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>
</trim>
where job_detail_id = #{jobDetailId}
where job_id = #{jobId}
</update>
<delete id="deleteViewOutJobFlowByJobDetailId" parameterType="String">
delete from view_out_job_flow where job_detail_id = #{jobDetailId}
<delete id="deleteViewOutJobFlowByJobId" parameterType="String">
delete from view_out_job_flow where job_id = #{jobId}
</delete>
<delete id="deleteViewOutJobFlowByJobDetailIds" parameterType="String">
delete from view_out_job_flow where job_detail_id in
<foreach item="jobDetailId" collection="array" open="(" separator="," close=")">
#{jobDetailId}
<delete id="deleteViewOutJobFlowByJobIds" parameterType="String">
delete from view_out_job_flow where job_id in
<foreach item="jobId" collection="array" open="(" separator="," close=")">
#{jobId}
</foreach>
</delete>
</mapper>

View File

@@ -3,263 +3,195 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.search.ViewStockDetail.mapper.ViewStockDetailMapper">
<resultMap type="ViewStockDetail" id="ViewStockDetailResult">
<result property="cargoSpaceId" column="cargo_space_id" />
<result property="trayCode" column="tray_code" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<!-- 与 BasStock 不符的字段已注释 -->
<!-- <result property="spec" column="spec" /> -->
<result property="quantity" column="quantity" />
<!-- <result property="price" column="price" /> -->
<!-- <result property="unit" column="unit" /> -->
<!-- <result property="cargoNo" column="cargo_no" /> -->
<result property="orderId" column="order_id" />
<!-- bs.power 字段与 BasStock 不一致,已注释 -->
<!-- <result property="power" column="power_col" /> -->
<!-- <result property="parentId" column="parent_id" /> -->
<result property="stockinId" column="stockin_id" />
<!-- 供应商相关字段与 BasStock 不符,已注释 -->
<!-- <result property="supplierName" column="supplier_name" /> -->
<!-- <result property="supplierNo" column="supplier_no" /> -->
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" />
<result property="inDate" column="in_date" />
<!-- stackingId 非 BasStock 字段,已注释 -->
<!-- <result property="stackingId" column="stacking_id" /> -->
<result property="backDate" column="back_date" />
<!-- 备注字段使用 pd_remark(明细)或保留在 BasStock 中,基于适配需求先注释 remark -->
<!-- <result property="remark" column="remark" /> -->
<result property="stockId" column="stock_id" />
<result property="stockStatus" column="stock_status" />
<result property="lotNo" column="lot_no" />
<result property="outQuantity" column="out_quantity" />
<!-- productType 来自 bas_product(bp),BasStock 未将其作为主表字段,已注释 -->
<!-- <result property="productType" column="productType" /> -->
<!-- 添加 BasStock 的 pd_ 明细映射 -->
<result property="pdDetailId" column="pd_detail_id" />
<result property="pdProductName" column="pd_product_name" />
<result property="pdModel" column="pd_model" />
<result property="pdUnit" column="pd_unit" />
<result property="pdUnitPrice" column="pd_unit_price" />
<result property="pdAuxUnit" column="pd_aux_unit" />
<result property="pdAttr1" column="pd_attr1" />
<result property="pdAttr2" column="pd_attr2" />
<result property="pdQuantity" column="pd_quantity" />
<result property="pdInQty" column="pd_in_qty" />
<result property="pdAuxQuantity" column="pd_aux_quantity" />
<result property="pdTotalPrice" column="pd_total_price" />
<result property="pdCostUnitPrice" column="pd_cost_unit_price" />
<result property="pdTotalPrice2" column="pd_total_price_2" />
<result property="pdAccountCostTotal" column="pd_account_cost_total" />
<result property="pdAccountQuantity" column="pd_account_quantity" />
<result property="pdAccountStatus" column="pd_account_status" />
<result property="pdBatchNo" column="pd_batch_no" />
<result property="pdSerialNo" column="pd_serial_no" />
<result property="pdProdDate" column="pd_prod_date" />
<result property="pdValidDate" column="pd_valid_date" />
<result property="pdArrivalDate" column="pd_arrival_date" />
<result property="pdRemark" column="pd_remark" />
<result property="pdCustom1" column="pd_custom1" />
<result property="pdCustom2" column="pd_custom2" />
<result property="pdCustom3" column="pd_custom3" />
<result property="pdCustom4" column="pd_custom4" />
<result property="pdCustom5" column="pd_custom5" />
<result property="pdCustom6" column="pd_custom6" />
<result property="pdLoader" column="pd_loader" />
<result property="onlyIdentity" column="only_identity" />
<result property="stockId" column="stock_id" />
<result property="cargoSpaceId" column="cargo_space_id" />
<result property="stockStatus" column="stock_status" />
<result property="productStatus" column="product_status" />
<result property="lotNo" column="lot_no" />
<result property="inDate" column="in_date" />
<result property="backDate" column="back_date" />
<result property="productGuid" column="product_guid" />
<result property="quantity" column="quantity" />
<result property="jobId" column="job_id" />
<result property="trayCode" column="tray_code" />
<result property="outQuantity" column="out_quantity" />
<result property="stockinDetailId" column="stockin_detail_id" />
<result property="stockinId" column="stockin_id" />
<result property="inType" column="in_type" />
<result property="inClassId" column="in_class_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="orderId" column="order_id" />
<result property="Rows" column="Rows" />
<result property="Title" column="Title" />
<result property="Kuin" column="Kuin" />
<result property="Complete1" column="Complete1" />
<result property="Cateid" column="Cateid" />
<result property="Date3" column="Date3" />
<result property="Date5" column="Date5" />
<result property="Catein" column="Catein" />
<result property="Intro2" column="Intro2" />
<result property="Intro" column="Intro" />
<result property="Caigou" column="Caigou" />
<result property="Date7" column="Date7" />
<result property="Kg" column="Kg" />
<result property="Sort1" column="Sort1" />
<result property="Rkbh" column="Rkbh" />
<result property="Status" column="Status" />
<result property="KuinList" column="KuinList" />
<result property="sysIcusIInheritIdIidI413" column="sysIcusIInheritIdIidI413" />
<result property="sysIcusIInheritIdIidI414" column="sysIcusIInheritIdIidI414" />
<result property="sysIcusIInheritIdIidI415" column="sysIcusIInheritIdIidI415" />
<result property="pdDetailId" column="pd_detail_id" />
<result property="pdProductName" column="pd_product_name" />
<result property="pdModel" column="pd_model" />
<result property="pdUnit" column="pd_unit" />
<result property="pdUnitPrice" column="pd_unit_price" />
<result property="pdAuxUnit" column="pd_aux_unit" />
<result property="pdAttr1" column="pd_attr1" />
<result property="pdAttr2" column="pd_attr2" />
<result property="pdQuantity" column="pd_quantity" />
<result property="pdInQty" column="pd_in_qty" />
<result property="pdAuxQuantity" column="pd_aux_quantity" />
<result property="pdTotalPrice" column="pd_total_price" />
<result property="pdCostUnitPrice" column="pd_cost_unit_price" />
<result property="pdTotalPrice2" column="pd_total_price_2" />
<result property="pdAccountCostTotal" column="pd_account_cost_total" />
<result property="pdAccountQuantity" column="pd_account_quantity" />
<result property="pdAccountStatus" column="pd_account_status" />
<result property="pdBatchNo" column="pd_batch_no" />
<result property="pdSerialNo" column="pd_serial_no" />
<result property="pdProdDate" column="pd_prod_date" />
<result property="pdValidDate" column="pd_valid_date" />
<result property="pdArrivalDate" column="pd_arrival_date" />
<result property="pdRemark" column="pd_remark" />
<result property="pdCustom1" column="pd_custom1" />
<result property="pdCustom2" column="pd_custom2" />
<result property="pdCustom3" column="pd_custom3" />
<result property="pdCustom4" column="pd_custom4" />
<result property="pdCustom5" column="pd_custom5" />
<result property="pdCustom6" column="pd_custom6" />
<result property="pdLoader" column="pd_loader" />
<result property="cargoSpaceName" column="cargo_space_name" />
<result property="cargoSpaceStatus" column="cargo_space_status" />
<result property="locked" column="locked" />
<result property="parentId" column="parent_id" />
<result property="price" column="price" />
<result property="cargoNo" column="cargo_no" />
<result property="unit" column="unit" />
<result property="spec" column="spec" />
<result property="remark" column="remark" />
<result property="spare1" column="spare1" />
<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" />
</resultMap>
<sql id="selectViewStockDetailVo">
select bs.cargo_space_id, --库位编码
bs.tray_code, --托盘
bs.product_id, --产品编码
bs.product_name,--产品名称
bs.quantity, -- 数量
bs.order_id, --合同号
bs.stockin_id, --入库单号
bw.warehouse_id, --仓库编码
bw.warehouse_name, --仓库名称
bs.in_date, --入库时间
bs.back_date, --盘点时间
-- bas_stock 的 pd_ 明细字段
bs.pd_product_name, -- 明细产品名称
bs.pd_batch_no, -- 明细批次号
bs.pd_serial_no, -- 明细序列号
bs.pd_model, -- 明细型号
bs.pd_unit, -- 明细单位
bs.pd_unit_price, -- 明细单价
bs.pd_quantity, -- 明细数量
bs.pd_total_price, -- 明细金额
bs.pd_cost_unit_price,
bs.pd_prod_date, -- 明细生产日期
bs.pd_valid_date, -- 明细有效日期
bs.pd_arrival_date, -- 明细到货日期
bs.pd_remark, -- 明细备注
bs.stock_id, --库存编码
bs.stock_status, --库存状态
bs.lot_no, --批次号
bs.out_quantity
from bas_stock bs
left join bas_product bp on bs.product_id = bp.product_id
left join bas_warehouse bw on bs.warehouse_id = bw.warehouse_id
left join bas_cargo_space bcs on bs.cargo_space_id = bcs.cargo_space_id
select only_identity, stock_id, cargo_space_id, stock_status, product_status, lot_no, in_date, back_date, product_guid, quantity, job_id, tray_code, out_quantity, stockin_detail_id, stockin_id, in_type, in_class_id, warehouse_id, product_id, product_name, order_id, Rows, Title, Kuin, Complete1, Cateid, Date3, Date5, Catein, Intro2, Intro, Caigou, Date7, Kg, Sort1, Rkbh, Status, KuinList, sysIcusIInheritIdIidI413, sysIcusIInheritIdIidI414, sysIcusIInheritIdIidI415, pd_detail_id, pd_product_name, pd_model, pd_unit, pd_unit_price, pd_aux_unit, pd_attr1, pd_attr2, pd_quantity, pd_in_qty, pd_aux_quantity, pd_total_price, pd_cost_unit_price, pd_total_price_2, pd_account_cost_total, pd_account_quantity, pd_account_status, pd_batch_no, pd_serial_no, pd_prod_date, pd_valid_date, pd_arrival_date, pd_remark, pd_custom1, pd_custom2, pd_custom3, pd_custom4, pd_custom5, pd_custom6, pd_loader, cargo_space_name, cargo_space_status, locked, parent_id, price, cargo_no, unit, spec, remark, spare1, spare3, spare4, spare5, spare6, spare7 from view_stock_detail
</sql>
<select id="selectViewStockDetailList" parameterType="ViewStockDetail" resultMap="ViewStockDetailResult">
<include refid="selectViewStockDetailVo"/>
<where>
<if test="stockId != null and stockId != ''"> and bs.stock_id = #{stockId}</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and bs.cargo_space_id = #{cargoSpaceId}</if>
<if test="stockStatus != null and stockStatus != ''"> and bs.stock_status = #{stockStatus}</if>
<if test="lotNo != null and lotNo != ''"> and bs.lot_no = #{lotNo}</if>
<if test="inDate != null and inDate != ''"> and bs.in_date like concat('%', #{inDate}, '%')</if>
<if test="backDate != null and backDate != ''"> and bs.back_date = #{backDate}</if>
<if test="productName != null and productName != ''"> and bs.product_name like concat('%', #{productName}, '%')</if>
<if test="quantity != null and quantity != ''"> and bs.quantity = #{quantity}</if>
<if test="trayCode != null and trayCode != ''"> and bs.tray_code = #{trayCode}</if>
<if test="outQuantity != null and outQuantity != ''"> and bs.out_quantity = #{outQuantity}</if>
<if test="stockinId != null and stockinId != ''"> and bs.stockin_id = #{stockinId}</if>
<if test="warehouseId != null and warehouseId != ''"> and bs.warehouse_id = #{warehouseId}</if>
<if test="stackingId != null and stackingId != ''"> and bs.stacking_id = #{stackingId}</if>
<if test="voltage != null and voltage != ''"> and bs.voltage = #{voltage}</if>
<if test="power != null and power != ''"> and bs.power = #{power}</if>
<if test="orderId != null and orderId != ''"> and bs.order_id = #{orderId}</if>
<if test="productId != null and productId != ''"> and bs.product_id = #{productId}</if>
<if test="roadwayId != null and roadwayId != ''"> and bcs.roadway_id = #{roadwayId}</if>
<if test="theFloor != null and theFloor != ''"> and bcs.the_floor = #{theFloor}</if>
<if test="thePlatoon != null and thePlatoon != ''"> and bcs.the_platoon = #{thePlatoon}</if>
<if test="theColumn != null and theColumn != ''"> and bcs.the_column = #{theColumn}</if>
<if test="spec != null and spec != ''"> and bp.spec = #{spec}</if>
<if test="parentId != null and parentId != ''"> and bp.parent_id = #{parentId}</if>
<if test="price != null and price != ''"> and bp.price = #{price}</if>
<if test="inDateStart != null and inDateStart != ''"> and bs.in_date &gt;= #{inDateStart}</if>
<if test="inDateEnd != null and inDateEnd != ''"> and bs.in_date &lt;= #{inDateEnd}</if>
<if test="productType != null and productType != ''"> and bp.spare1 = #{productType}</if>
<where>
<if test="onlyIdentity != null "> and only_identity like concat('%', #{onlyIdentity}, '%')</if>
<if test="stockId != null and stockId != ''"> and stock_id like concat('%', #{stockId}, '%')</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
<if test="stockStatus != null and stockStatus != ''"> and stock_status like concat('%', #{stockStatus}, '%')</if>
<if test="productStatus != null and productStatus != ''"> and product_status like concat('%', #{productStatus}, '%')</if>
<if test="lotNo != null and lotNo != ''"> and lot_no like concat('%', #{lotNo}, '%')</if>
<if test="inDate != null and inDate != ''"> and in_date like concat('%', #{inDate}, '%')</if>
<if test="backDate != null and backDate != ''"> and back_date like concat('%', #{backDate}, '%')</if>
<if test="productGuid != null and productGuid != ''"> and product_guid like concat('%', #{productGuid}, '%')</if>
<if test="quantity != null and quantity != ''"> and quantity like concat('%', #{quantity}, '%')</if>
<if test="jobId != null and jobId != ''"> and job_id like concat('%', #{jobId}, '%')</if>
<if test="trayCode != null and trayCode != ''"> and tray_code like concat('%', #{trayCode}, '%')</if>
<if test="outQuantity != null and outQuantity != ''"> and out_quantity = #{outQuantity}</if>
<if test="stockinDetailId != null and stockinDetailId != ''"> and stockin_detail_id like concat('%', #{stockinDetailId}, '%')</if>
<if test="stockinId != null and stockinId != ''"> and stockin_id like concat('%', #{stockinId}, '%')</if>
<if test="inType != null and inType != ''"> and in_type like concat('%', #{inType}, '%')</if>
<if test="inClassId != null and inClassId != ''"> and in_class_id = #{inClassId}</if>
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</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="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="Rows != null and Rows != ''"> and Rows = #{Rows}</if>
<if test="Title != null and Title != ''"> and Title = #{Title}</if>
<if test="Kuin != null and Kuin != ''"> and Kuin = #{Kuin}</if>
<if test="Complete1 != null and Complete1 != ''"> and Complete1 = #{Complete1}</if>
<if test="Cateid != null and Cateid != ''"> and Cateid = #{Cateid}</if>
<if test="Date3 != null and Date3 != ''"> and Date3 = #{Date3}</if>
<if test="Date5 != null and Date5 != ''"> and Date5 = #{Date5}</if>
<if test="Catein != null and Catein != ''"> and Catein = #{Catein}</if>
<if test="Intro2 != null and Intro2 != ''"> and Intro2 = #{Intro2}</if>
<if test="Intro != null and Intro != ''"> and Intro = #{Intro}</if>
<if test="Caigou != null and Caigou != ''"> and Caigou = #{Caigou}</if>
<if test="Date7 != null and Date7 != ''"> and Date7 = #{Date7}</if>
<if test="Kg != null and Kg != ''"> and Kg = #{Kg}</if>
<if test="Sort1 != null and Sort1 != ''"> and Sort1 = #{Sort1}</if>
<if test="Rkbh != null and Rkbh != ''"> and Rkbh = #{Rkbh}</if>
<if test="Status != null and Status != ''"> and Status = #{Status}</if>
<if test="KuinList != null and KuinList != ''"> and KuinList = #{KuinList}</if>
<if test="sysIcusIInheritIdIidI413 != null and sysIcusIInheritIdIidI413 != ''"> and sysIcusIInheritIdIidI413 = #{sysIcusIInheritIdIidI413}</if>
<if test="sysIcusIInheritIdIidI414 != null and sysIcusIInheritIdIidI414 != ''"> and sysIcusIInheritIdIidI414 = #{sysIcusIInheritIdIidI414}</if>
<if test="sysIcusIInheritIdIidI415 != null and sysIcusIInheritIdIidI415 != ''"> and sysIcusIInheritIdIidI415 = #{sysIcusIInheritIdIidI415}</if>
<if test="pdDetailId != null "> and pd_detail_id = #{pdDetailId}</if>
<if test="pdProductName != null and pdProductName != ''"> and pd_product_name like concat('%', #{pdProductName}, '%')</if>
<if test="pdModel != null and pdModel != ''"> and pd_model = #{pdModel}</if>
<if test="pdUnit != null and pdUnit != ''"> and pd_unit = #{pdUnit}</if>
<if test="pdUnitPrice != null and pdUnitPrice != ''"> and pd_unit_price = #{pdUnitPrice}</if>
<if test="pdAuxUnit != null and pdAuxUnit != ''"> and pd_aux_unit = #{pdAuxUnit}</if>
<if test="pdAttr1 != null and pdAttr1 != ''"> and pd_attr1 = #{pdAttr1}</if>
<if test="pdAttr2 != null and pdAttr2 != ''"> and pd_attr2 = #{pdAttr2}</if>
<if test="pdQuantity != null and pdQuantity != ''"> and pd_quantity = #{pdQuantity}</if>
<if test="pdInQty != null and pdInQty != ''"> and pd_in_qty = #{pdInQty}</if>
<if test="pdAuxQuantity != null and pdAuxQuantity != ''"> and pd_aux_quantity = #{pdAuxQuantity}</if>
<if test="pdTotalPrice != null and pdTotalPrice != ''"> and pd_total_price = #{pdTotalPrice}</if>
<if test="pdCostUnitPrice != null and pdCostUnitPrice != ''"> and pd_cost_unit_price = #{pdCostUnitPrice}</if>
<if test="pdTotalPrice2 != null and pdTotalPrice2 != ''"> and pd_total_price_2 = #{pdTotalPrice2}</if>
<if test="pdAccountCostTotal != null and pdAccountCostTotal != ''"> and pd_account_cost_total = #{pdAccountCostTotal}</if>
<if test="pdAccountQuantity != null and pdAccountQuantity != ''"> and pd_account_quantity = #{pdAccountQuantity}</if>
<if test="pdAccountStatus != null and pdAccountStatus != ''"> and pd_account_status = #{pdAccountStatus}</if>
<if test="pdBatchNo != null and pdBatchNo != ''"> and pd_batch_no = #{pdBatchNo}</if>
<if test="pdSerialNo != null and pdSerialNo != ''"> and pd_serial_no = #{pdSerialNo}</if>
<if test="pdProdDate != null and pdProdDate != ''"> and pd_prod_date = #{pdProdDate}</if>
<if test="pdValidDate != null and pdValidDate != ''"> and pd_valid_date = #{pdValidDate}</if>
<if test="pdArrivalDate != null and pdArrivalDate != ''"> and pd_arrival_date = #{pdArrivalDate}</if>
<if test="pdRemark != null and pdRemark != ''"> and pd_remark = #{pdRemark}</if>
<if test="pdCustom1 != null and pdCustom1 != ''"> and pd_custom1 = #{pdCustom1}</if>
<if test="pdCustom2 != null and pdCustom2 != ''"> and pd_custom2 = #{pdCustom2}</if>
<if test="pdCustom3 != null and pdCustom3 != ''"> and pd_custom3 = #{pdCustom3}</if>
<if test="pdCustom4 != null and pdCustom4 != ''"> and pd_custom4 = #{pdCustom4}</if>
<if test="pdCustom5 != null and pdCustom5 != ''"> and pd_custom5 = #{pdCustom5}</if>
<if test="pdCustom6 != null and pdCustom6 != ''"> and pd_custom6 = #{pdCustom6}</if>
<if test="pdLoader != null and pdLoader != ''"> and pd_loader = #{pdLoader}</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''"> and cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
<if test="cargoSpaceStatus != null and cargoSpaceStatus != ''"> and cargo_space_status = #{cargoSpaceStatus}</if>
<if test="locked != null and locked != ''"> and locked = #{locked}</if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no = #{cargoNo}</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="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="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
</where>
</select>
<select id="selectViewStockDetailByOnlyIdentity" parameterType="Long" resultMap="ViewStockDetailResult">
<include refid="selectViewStockDetailVo"/>
where only_identity = #{onlyIdentity}
</select>
<insert id="insertViewStockDetail" parameterType="ViewStockDetail">
insert into view_stock_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="onlyIdentity != null">only_identity,</if>
<if test="stockId != null and stockId != ''">stock_id,</if>
<if test="cargoSpaceId != null">cargo_space_id,</if>
<if test="trayCode != null">tray_code,</if>
<if test="quantity != null">quantity,</if>
<if test="jobId != null">job_id,</if>
<if test="lotNo != null">lot_no,</if>
<if test="stockinDetailId != null">stockin_detail_id,</if>
<if test="inDate != null">in_date,</if>
<if test="warehouseId != null">warehouse_id,</if>
<if test="stackingId != null">stacking_id,</if>
<if test="cargoSpaceName != null">cargo_space_name,</if>
<if test="roadwayId != null">roadway_id,</if>
<if test="cargoSpaceStatus != null">cargo_space_status,</if>
<if test="locked != null">locked,</if>
<if test="productId != null">product_id,</if>
<if test="productName != null">product_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="onlyIdentity != null">#{onlyIdentity},</if>
<if test="stockId != null and stockId != ''">#{stockId},</if>
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
<if test="trayCode != null">#{trayCode},</if>
<if test="quantity != null">#{quantity},</if>
<if test="jobId != null">#{jobId},</if>
<if test="lotNo != null">#{lotNo},</if>
<if test="stockinDetailId != null">#{stockinDetailId},</if>
<if test="inDate != null">#{inDate},</if>
<if test="warehouseId != null">#{warehouseId},</if>
<if test="stackingId != null">#{stackingId},</if>
<if test="cargoSpaceName != null">#{cargoSpaceName},</if>
<if test="roadwayId != null">#{roadwayId},</if>
<if test="cargoSpaceStatus != null">#{cargoSpaceStatus},</if>
<if test="locked != null">#{locked},</if>
<if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</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="updateViewStockDetail" parameterType="ViewStockDetail">
update view_stock_detail
<trim prefix="SET" suffixOverrides=",">
<if test="stockId != null and stockId != ''">stock_id = #{stockId},</if>
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
<if test="trayCode != null">tray_code = #{trayCode},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="jobId != null">job_id = #{jobId},</if>
<if test="lotNo != null">lot_no = #{lotNo},</if>
<if test="stockinDetailId != null">stockin_detail_id = #{stockinDetailId},</if>
<if test="inDate != null">in_date = #{inDate},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="stackingId != null">stacking_id = #{stackingId},</if>
<if test="cargoSpaceName != null">cargo_space_name = #{cargoSpaceName},</if>
<if test="roadwayId != null">roadway_id = #{roadwayId},</if>
<if test="cargoSpaceStatus != null">cargo_space_status = #{cargoSpaceStatus},</if>
<if test="locked != null">locked = #{locked},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</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 only_identity = #{onlyIdentity}
</update>
<delete id="deleteViewStockDetailByOnlyIdentity" parameterType="Long">
delete from view_stock_detail where only_identity = #{onlyIdentity}
</delete>
<delete id="deleteViewStockDetailByOnlyIdentitys" parameterType="String">
delete from view_stock_detail where only_identity in
<foreach item="onlyIdentity" collection="array" open="(" separator="," close=")">
#{onlyIdentity}
</foreach>
</delete>
</mapper>
</mapper>

View File

@@ -6,67 +6,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="ViewStockinHistory" id="ViewStockinHistoryResult">
<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="status" column="status" />
<result property="warehouseId" column="warehouse_id" />
<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="classNo" column="class_no" />
<result property="customerNo" column="customer_no" />
<result property="supplierNo" column="supplier_no" />
<result property="stockinDetailId" column="stockin_detail_id" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="spec" column="spec" />
<result property="parentId" column="parent_id" />
<result property="price" column="price" />
<result property="cargoNo" column="cargo_no" />
<result property="productType" column="productType" />
<result property="unit" column="unit" />
<result property="spec" column="spec" />
<result property="remark" column="remark" />
<result property="spare1" column="spare1" />
<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="quantity" column="quantity" />
<result property="scanNum" column="scan_num" />
<result property="assignNum" column="assign_num" />
<result property="unit" column="unit" />
<result property="price" column="price" />
<result property="priceTotal" column="priceTotal" />
<result property="supplierNo" column="supplier_no" />
<result property="supplierName" column="supplier_name" />
<result property="spare6" column="spare6" />
<result property="spare5" column="spare5" />
<result property="spare7" column="spare7" />
<result property="spare3" column="spare3" />
<result property="createManId" column="create_man_id" />
<result property="createDate" column="create_date" />
<result property="status" column="status" />
<result property="spare8" column="spare8" />
<result property="remark" column="remark" />
<result property="spare1" column="spare1" />
<result property="spare4" column="spare4" />
<result property="spare2" column="spare2" />
</resultMap>
<sql id="selectViewStockinHistoryVo">
select stockin_id, stockin_detail_id, product_id, product_name, spec, cargo_no, productType, quantity, scan_num, assign_num, unit, price, priceTotal, supplier_no, supplier_name, spare6, spare5, spare7, spare3, create_man_id, create_date, status, spare8, remark, spare1, spare4, spare2 from view_stockin_history
select stockin_id, in_type, create_date, create_man_id, status, warehouse_id, finish_date, erp_bill, stock_source, department_no, class_no, customer_no, supplier_no, stockin_detail_id, product_id, product_name, parent_id, price, cargo_no, unit, spec, remark, spare1, spare3, spare4, spare5, spare6, spare7, quantity, scan_num, assign_num, supplier_name from view_stockin_history
</sql>
<select id="selectViewStockinHistoryList" parameterType="ViewStockinHistory" resultMap="ViewStockinHistoryResult">
<include refid="selectViewStockinHistoryVo"/>
<where>
<if test="stockinId != null and stockinId != ''"> and stockin_id = #{stockinId}</if>
<if test="stockinId != null and stockinId != ''"> and stockin_id like concat('%', #{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 like concat('%', #{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="classNo != null and classNo != ''"> and class_no = #{classNo}</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="supplierNo != null and supplierNo != ''"> and supplier_no like concat('%', #{supplierNo}, '%')</if>
<if test="stockinDetailId != null and stockinDetailId != ''"> and stockin_detail_id = #{stockinDetailId}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</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="spec != null and spec != ''"> and spec = #{spec}</if>
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no = #{cargoNo}</if>
<if test="productType != null and productType != ''"> and productType = #{productType}</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="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="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
<if test="quantity != null and quantity != ''"> and quantity = #{quantity}</if>
<if test="scanNum != null and scanNum != ''"> and scan_num = #{scanNum}</if>
<if test="assignNum != null and assignNum != ''"> and assign_num = #{assignNum}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="priceTotal != null and priceTotal != ''"> and priceTotal = #{priceTotal}</if>
<if test="supplierNo != null and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="createManId != null and createManId != ''"> and create_man_id = #{createManId}</if>
<if test="createDate != null and createDate != ''"> and create_date = #{createDate}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="spare8 != null and spare8 != ''"> and spare8 = #{spare8}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
</where>
</select>
@@ -75,109 +85,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where stockin_id = #{stockinId}
</select>
<insert id="insertViewStockinHistory" parameterType="ViewStockinHistory">
insert into view_stockin_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="stockinId != null and stockinId != ''">stockin_id,</if>
<if test="stockinDetailId != null">stockin_detail_id,</if>
<if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="spec != null">spec,</if>
<if test="cargoNo != null">cargo_no,</if>
<if test="productType != null">productType,</if>
<if test="quantity != null">quantity,</if>
<if test="scanNum != null">scan_num,</if>
<if test="assignNum != null">assign_num,</if>
<if test="unit != null">unit,</if>
<if test="price != null">price,</if>
<if test="priceTotal != null">priceTotal,</if>
<if test="supplierNo != null">supplier_no,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="spare6 != null">spare6,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare7 != null">spare7,</if>
<if test="spare3 != null">spare3,</if>
<if test="createManId != null">create_man_id,</if>
<if test="createDate != null and createDate != ''">create_date,</if>
<if test="status != null and status != ''">status,</if>
<if test="spare8 != null">spare8,</if>
<if test="remark != null">remark,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare2 != null">spare2,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockinId != null and stockinId != ''">#{stockinId},</if>
<if test="stockinDetailId != null">#{stockinDetailId},</if>
<if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="spec != null">#{spec},</if>
<if test="cargoNo != null">#{cargoNo},</if>
<if test="productType != null">#{productType},</if>
<if test="quantity != null">#{quantity},</if>
<if test="scanNum != null">#{scanNum},</if>
<if test="assignNum != null">#{assignNum},</if>
<if test="unit != null">#{unit},</if>
<if test="price != null">#{price},</if>
<if test="priceTotal != null">#{priceTotal},</if>
<if test="supplierNo != null">#{supplierNo},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="spare6 != null">#{spare6},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare7 != null">#{spare7},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="createManId != null">#{createManId},</if>
<if test="createDate != null and createDate != ''">#{createDate},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="spare8 != null">#{spare8},</if>
<if test="remark != null">#{remark},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare2 != null">#{spare2},</if>
</trim>
</insert>
<update id="updateViewStockinHistory" parameterType="ViewStockinHistory">
update view_stockin_history
<trim prefix="SET" suffixOverrides=",">
<if test="stockinDetailId != null">stockin_detail_id = #{stockinDetailId},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
<if test="productType != null">productType = #{productType},</if>
<if test="quantity != null">quantity = #{quantity},</if>
<if test="scanNum != null">scan_num = #{scanNum},</if>
<if test="assignNum != null">assign_num = #{assignNum},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="price != null">price = #{price},</if>
<if test="priceTotal != null">priceTotal = #{priceTotal},</if>
<if test="supplierNo != null">supplier_no = #{supplierNo},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare7 != null">spare7 = #{spare7},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="createManId != null">create_man_id = #{createManId},</if>
<if test="createDate != null and createDate != ''">create_date = #{createDate},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="spare8 != null">spare8 = #{spare8},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
</trim>
where stockin_id = #{stockinId}
</update>
<delete id="deleteViewStockinHistoryByStockinId" parameterType="String">
delete from view_stockin_history where stockin_id = #{stockinId}
</delete>
<delete id="deleteViewStockinHistoryByStockinIds" parameterType="String">
delete from view_stockin_history where stockin_id in
<foreach item="stockinId" collection="array" open="(" separator="," close=")">
#{stockinId}
</foreach>
</delete>
</mapper>

View File

@@ -6,75 +6,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="ViewStockoutHistory" id="ViewStockoutHistoryResult">
<result property="stockoutId" column="stockout_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="FID" column="FID" />
<result property="erpStockoutId" column="erp_stockout_id" />
<result property="stockoutDetailId" column="stockout_detail_id" />
<result property="lotNo" column="lot_no" />
<result property="quantity" column="quantity" />
<result property="assignNum" column="assign_num" />
<result property="allotQuantity" column="allot_quantity" />
<result property="productId" column="product_id" />
<result property="productName" column="product_name" />
<result property="spec" column="spec" />
<result property="cargoNo" column="cargo_no" />
<result property="productType" column="productType" />
<result property="quantity" column="quantity" />
<result property="allotQuantity" column="allot_quantity" />
<result property="assignNum" column="assign_num" />
<result property="contract" column="contract" />
<result property="power" column="power" />
<result property="phase" column="phase" />
<result property="parentId" column="parent_id" />
<result property="price" column="price" />
<result property="priceTotal" column="priceTotal" />
<result property="customerNo" column="customer_no" />
<result property="customerName" column="customer_name" />
<result property="status" column="status" />
<result property="createManId" column="create_man_id" />
<result property="createDate" column="create_date" />
<result property="cargoNo" column="cargo_no" />
<result property="unit" column="unit" />
<result property="account" column="account" />
<result property="managementNo" column="managementNo" />
<result property="supplierId" column="supplier_id" />
<result property="supplierName" column="supplier_name" />
<result property="spec" column="spec" />
<result property="remark" column="remark" />
<result property="purpose" column="purpose" />
<result property="quality" column="quality" />
<result property="source" column="source" />
<result property="turnoverStatus" column="turnoverStatus" />
<result property="purpose2" column="purpose2" />
<result property="spare1" column="spare1" />
<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="supplierNo" column="supplier_no" />
<result property="supplierName" column="supplier_name" />
<result property="customerNo" column="customer_no" />
<result property="contactName" column="contact_name" />
</resultMap>
<sql id="selectViewStockoutHistoryVo">
select stockout_id, stockout_detail_id, product_id, product_name, spec, cargo_no, productType, quantity, allot_quantity, assign_num, contract, power, phase, price, priceTotal, customer_no, customer_name, status, create_man_id, create_date, unit, account, managementNo, supplier_id, supplier_name, remark, purpose, quality, source, turnoverStatus, purpose2 from view_stockout_history
select stockout_id, out_type, create_date, create_man_id, status, stockout_source, exit_id, FID, erp_stockout_id, stockout_detail_id, lot_no, quantity, assign_num, allot_quantity, product_id, product_name, parent_id, price, cargo_no, unit, spec, remark, spare1, spare3, spare4, spare5, spare6, spare7, supplier_no, supplier_name, customer_no, contact_name 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 = #{stockoutId}</if>
<if test="stockoutDetailId != null and stockoutDetailId != ''"> and stockout_detail_id = #{stockoutDetailId}</if>
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
<if test="spec != null and spec != ''"> and spec = #{spec}</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no = #{cargoNo}</if>
<if test="productType != null and productType != ''"> and productType = #{productType}</if>
<if test="quantity != null "> and quantity = #{quantity}</if>
<if test="allotQuantity != null "> and allot_quantity = #{allotQuantity}</if>
<if test="assignNum != null "> and assign_num = #{assignNum}</if>
<if test="contract != null and contract != ''"> and contract = #{contract}</if>
<if test="power != null and power != ''"> and power = #{power}</if>
<if test="phase != null and phase != ''"> and phase = #{phase}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="priceTotal != null and priceTotal != ''"> and priceTotal = #{priceTotal}</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createManId != null and createManId != ''"> and create_man_id = #{createManId}</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="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="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
<if test="FID != null and FID != ''"> and FID = #{FID}</if>
<if test="erpStockoutId != null and erpStockoutId != ''"> and erp_stockout_id = #{erpStockoutId}</if>
<if test="stockoutDetailId != null and stockoutDetailId != ''"> and stockout_detail_id like concat('%', #{stockoutDetailId}, '%')</if>
<if test="lotNo != null and lotNo != ''"> and lot_no = #{lotNo}</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="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="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
<if test="price != null and price != ''"> and price = #{price}</if>
<if test="cargoNo != null and cargoNo != ''"> and cargo_no = #{cargoNo}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="account != null and account != ''"> and account = #{account}</if>
<if test="managementNo != null and managementNo != ''"> and managementNo = #{managementNo}</if>
<if test="supplierId != null and supplierId != ''"> and supplier_id = #{supplierId}</if>
<if test="spec != null and spec != ''"> and spec = #{spec}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</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="spare7 != null and spare7 != ''"> and spare7 = #{spare7}</if>
<if test="supplierNo != null and supplierNo != ''"> and supplier_no = #{supplierNo}</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="purpose != null and purpose != ''"> and purpose = #{purpose}</if>
<if test="quality != null and quality != ''"> and quality = #{quality}</if>
<if test="source != null and source != ''"> and source = #{source}</if>
<if test="turnoverStatus != null and turnoverStatus != ''"> and turnoverStatus = #{turnoverStatus}</if>
<if test="purpose2 != null and purpose2 != ''"> and purpose2 = #{purpose2}</if>
<if test="customerNo != null and customerNo != ''"> and customer_no = #{customerNo}</if>
<if test="contactName != null and contactName != ''"> and contact_name like concat('%', #{contactName}, '%')</if>
</where>
</select>
@@ -83,121 +85,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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="stockoutDetailId != null and stockoutDetailId != ''">stockout_detail_id,</if>
<if test="productId != null">product_id,</if>
<if test="productName != null">product_name,</if>
<if test="spec != null">spec,</if>
<if test="cargoNo != null">cargo_no,</if>
<if test="productType != null">productType,</if>
<if test="quantity != null">quantity,</if>
<if test="allotQuantity != null">allot_quantity,</if>
<if test="assignNum != null">assign_num,</if>
<if test="contract != null">contract,</if>
<if test="power != null">power,</if>
<if test="phase != null">phase,</if>
<if test="price != null">price,</if>
<if test="priceTotal != null">priceTotal,</if>
<if test="customerNo != null">customer_no,</if>
<if test="customerName != null">customer_name,</if>
<if test="status != null and status != ''">status,</if>
<if test="createManId != null">create_man_id,</if>
<if test="createDate != null and createDate != ''">create_date,</if>
<if test="unit != null">unit,</if>
<if test="account != null">account,</if>
<if test="managementNo != null">managementNo,</if>
<if test="supplierId != null">supplier_id,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="remark != null">remark,</if>
<if test="purpose != null">purpose,</if>
<if test="quality != null">quality,</if>
<if test="source != null">source,</if>
<if test="turnoverStatus != null">turnoverStatus,</if>
<if test="purpose2 != null">purpose2,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stockoutId != null and stockoutId != ''">#{stockoutId},</if>
<if test="stockoutDetailId != null and stockoutDetailId != ''">#{stockoutDetailId},</if>
<if test="productId != null">#{productId},</if>
<if test="productName != null">#{productName},</if>
<if test="spec != null">#{spec},</if>
<if test="cargoNo != null">#{cargoNo},</if>
<if test="productType != null">#{productType},</if>
<if test="quantity != null">#{quantity},</if>
<if test="allotQuantity != null">#{allotQuantity},</if>
<if test="assignNum != null">#{assignNum},</if>
<if test="contract != null">#{contract},</if>
<if test="power != null">#{power},</if>
<if test="phase != null">#{phase},</if>
<if test="price != null">#{price},</if>
<if test="priceTotal != null">#{priceTotal},</if>
<if test="customerNo != null">#{customerNo},</if>
<if test="customerName != null">#{customerName},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="createManId != null">#{createManId},</if>
<if test="createDate != null and createDate != ''">#{createDate},</if>
<if test="unit != null">#{unit},</if>
<if test="account != null">#{account},</if>
<if test="managementNo != null">#{managementNo},</if>
<if test="supplierId != null">#{supplierId},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="remark != null">#{remark},</if>
<if test="purpose != null">#{purpose},</if>
<if test="quality != null">#{quality},</if>
<if test="source != null">#{source},</if>
<if test="turnoverStatus != null">#{turnoverStatus},</if>
<if test="purpose2 != null">#{purpose2},</if>
</trim>
</insert>
<update id="updateViewStockoutHistory" parameterType="ViewStockoutHistory">
update view_stockout_history
<trim prefix="SET" suffixOverrides=",">
<if test="stockoutDetailId != null and stockoutDetailId != ''">stockout_detail_id = #{stockoutDetailId},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="productName != null">product_name = #{productName},</if>
<if test="spec != null">spec = #{spec},</if>
<if test="cargoNo != null">cargo_no = #{cargoNo},</if>
<if test="productType != null">productType = #{productType},</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="contract != null">contract = #{contract},</if>
<if test="power != null">power = #{power},</if>
<if test="phase != null">phase = #{phase},</if>
<if test="price != null">price = #{price},</if>
<if test="priceTotal != null">priceTotal = #{priceTotal},</if>
<if test="customerNo != null">customer_no = #{customerNo},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="createManId != null">create_man_id = #{createManId},</if>
<if test="createDate != null and createDate != ''">create_date = #{createDate},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="account != null">account = #{account},</if>
<if test="managementNo != null">managementNo = #{managementNo},</if>
<if test="supplierId != null">supplier_id = #{supplierId},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="purpose != null">purpose = #{purpose},</if>
<if test="quality != null">quality = #{quality},</if>
<if test="source != null">source = #{source},</if>
<if test="turnoverStatus != null">turnoverStatus = #{turnoverStatus},</if>
<if test="purpose2 != null">purpose2 = #{purpose2},</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>