|
|
|
@ -2,7 +2,6 @@
|
|
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
|
|
|
|
|
|
|
|
<mapper namespace="com.glxp.sale.admin.dao.inout.StockOrderDao">
|
|
|
|
|
|
|
|
|
|
<select id="listStockOrder" parameterType="com.glxp.sale.admin.req.inout.StockOrderQueryRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
SELECT *
|
|
|
|
@ -14,14 +13,12 @@
|
|
|
|
|
|
|
|
|
|
<select id="listStockOrderNoDealWith" parameterType="com.glxp.sale.admin.req.inout.StockOrderQueryRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
|
|
|
|
|
select *
|
|
|
|
|
from stock_order
|
|
|
|
|
INNER JOIN inv_warehouse_user on stock_order.locStorageCode = inv_warehouse_user.`code`
|
|
|
|
|
where `status` = '101'
|
|
|
|
|
group by stock_order.id
|
|
|
|
|
ORDER BY id DESC
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertStockOrder" useGeneratedKeys="true" keyProperty="id"
|
|
|
|
@ -50,34 +47,87 @@
|
|
|
|
|
<update id="updateById" parameterType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
UPDATE stock_order
|
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
|
<if test="billNo != null">billNo=#{billNo},</if>
|
|
|
|
|
<if test="billdate != null">billdate=#{billdate},</if>
|
|
|
|
|
<if test="corpId != null">corpId=#{corpId},</if>
|
|
|
|
|
<if test="corpName != null">corpName=#{corpName},</if>
|
|
|
|
|
<if test="billType != null">billType=#{billType},</if>
|
|
|
|
|
<if test="billFlag != null">billFlag=#{billFlag},</if>
|
|
|
|
|
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
|
|
|
|
|
<if test="status != null">status=#{status},</if>
|
|
|
|
|
<if test="statusInfo != null">statusInfo=#{statusInfo},</if>
|
|
|
|
|
<if test="type != null">type=#{type},</if>
|
|
|
|
|
<if test="sourceType != null">sourceType=#{sourceType},</if>
|
|
|
|
|
<if test="printStatus != null">printStatus=#{printStatus},</if>
|
|
|
|
|
<if test="unitIdFk != null">unitIdFk=#{unitIdFk},</if>
|
|
|
|
|
<if test="customerId != null">customerId=#{customerId},</if>
|
|
|
|
|
<if test="thirdOrderFk != null">thirdOrderFk=#{thirdOrderFk},</if>
|
|
|
|
|
<if test="orderIdFk != null">orderIdFk=#{orderIdFk},</if>
|
|
|
|
|
<if test="totalPrice != null">totalPrice=#{totalPrice},</if>
|
|
|
|
|
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
|
|
|
|
|
<if test="supplementNo != null">supplementNo=#{supplementNo},</if>
|
|
|
|
|
<if test="createUser != null">createUser=#{createUser},</if>
|
|
|
|
|
<if test="reviewUser != null">reviewUser=#{reviewUser},</if>
|
|
|
|
|
<if test="entrustEnd != null">entrustEnd=#{entrustEnd},</if>
|
|
|
|
|
<if test="auditTime != null">auditTime=#{auditTime},</if>
|
|
|
|
|
<if test="updateTime != null">updateTime=#{updateTime},</if>
|
|
|
|
|
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
|
|
|
|
|
<if test="fromSubInvCode != null">fromSubInvCode=#{fromSubInvCode},</if>
|
|
|
|
|
<if test="dept != null">dept=#{dept},</if>
|
|
|
|
|
|
|
|
|
|
<if test="billNo != null">
|
|
|
|
|
billNo=#{billNo},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billdate != null">
|
|
|
|
|
billdate=#{billdate},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="corpId != null">
|
|
|
|
|
corpId=#{corpId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="corpName != null">
|
|
|
|
|
corpName=#{corpName},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billType != null">
|
|
|
|
|
billType=#{billType},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="billFlag != null">
|
|
|
|
|
billFlag=#{billFlag},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdSysFk != null">
|
|
|
|
|
thirdSysFk=#{thirdSysFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status != null">
|
|
|
|
|
status=#{status},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="statusInfo != null">
|
|
|
|
|
statusInfo=#{statusInfo},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="type != null">
|
|
|
|
|
type=#{type},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="sourceType != null">
|
|
|
|
|
sourceType=#{sourceType},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="printStatus != null">
|
|
|
|
|
printStatus=#{printStatus},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="unitIdFk != null">
|
|
|
|
|
unitIdFk=#{unitIdFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="customerId != null">
|
|
|
|
|
customerId=#{customerId},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="thirdOrderFk != null">
|
|
|
|
|
thirdOrderFk=#{thirdOrderFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderIdFk != null">
|
|
|
|
|
orderIdFk=#{orderIdFk},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="totalPrice != null">
|
|
|
|
|
totalPrice=#{totalPrice},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="locStorageCode != null">
|
|
|
|
|
locStorageCode=#{locStorageCode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="supplementNo != null">
|
|
|
|
|
supplementNo=#{supplementNo},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createUser != null">
|
|
|
|
|
createUser=#{createUser},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="reviewUser != null">
|
|
|
|
|
reviewUser=#{reviewUser},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="entrustEnd != null">
|
|
|
|
|
entrustEnd=#{entrustEnd},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="auditTime != null">
|
|
|
|
|
auditTime=#{auditTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="updateTime != null">
|
|
|
|
|
updateTime=#{updateTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="invWarehouseCode != null">
|
|
|
|
|
invWarehouseCode=#{invWarehouseCode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="fromSubInvCode != null">
|
|
|
|
|
fromSubInvCode=#{fromSubInvCode},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="dept != null">
|
|
|
|
|
dept=#{dept},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
WHERE id = #{id}
|
|
|
|
|
</update>
|
|
|
|
@ -106,9 +156,15 @@
|
|
|
|
|
</update>
|
|
|
|
|
<select id="filterListOr" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
SELECT stock_order.* ,inv_warehouse.name invName, iws.name subInvName ,basic_bustype_local.name
|
|
|
|
|
billTypeName,iws2.name fromSubInvName,auth_dept.name deptName,auth_user.employeeName reviewUserName FROM
|
|
|
|
|
stock_order
|
|
|
|
|
SELECT stock_order.*,
|
|
|
|
|
inv_warehouse.name invName,
|
|
|
|
|
iws.name subInvName,
|
|
|
|
|
basic_bustype_local.name
|
|
|
|
|
billTypeName,
|
|
|
|
|
iws2.name fromSubInvName,
|
|
|
|
|
auth_dept.name deptName,
|
|
|
|
|
auth_user.employeeName reviewUserName
|
|
|
|
|
FROM stock_order
|
|
|
|
|
left join basic_bustype_local on stock_order.billType = basic_bustype_local.action
|
|
|
|
|
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
|
LEFT JOIN inv_warehouse_sub ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
@ -187,11 +243,13 @@
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
|
|
|
|
|
<if test="userId != '' and userId != null">
|
|
|
|
|
and
|
|
|
|
|
stock_order.billType in
|
|
|
|
|
(select basic_bussiness_type.localAction from inv_bustype_user INNER JOIN basic_bussiness_type on
|
|
|
|
|
and stock_order.billType in
|
|
|
|
|
(select basic_bussiness_type.localAction
|
|
|
|
|
from inv_bustype_user
|
|
|
|
|
INNER JOIN basic_bussiness_type on
|
|
|
|
|
inv_bustype_user.scAction = basic_bussiness_type.action
|
|
|
|
|
WHERE userId =#{userId} and invWarehouseCode =#{invWarehouseCode}
|
|
|
|
|
WHERE userId = #{userId}
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
GROUP BY inv_bustype_user.id)
|
|
|
|
|
</if>
|
|
|
|
|
</if>
|
|
|
|
@ -202,17 +260,25 @@
|
|
|
|
|
and reviewUser = #{reviewUser}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="startTime != null and startTime != ''">
|
|
|
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startTime}, '%Y-%m-%d') ]]>
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') >= DATE_FORMAT(#{startTime}, '%Y-%m-%d')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endTime != null and endTime != ''">
|
|
|
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d') ]]>
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endTime}, '%Y-%m-%d')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
<if test="startDate != null and startDate != ''">
|
|
|
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startDate}, '%Y-%m-%d') ]]>
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endDate != null and endDate != ''">
|
|
|
|
|
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') ]]>
|
|
|
|
|
<![CDATA[
|
|
|
|
|
and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
|
|
|
|
|
]]>
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -222,13 +288,13 @@
|
|
|
|
|
</where>
|
|
|
|
|
group by stock_order.id
|
|
|
|
|
ORDER BY stock_order.updateTime DESC, id DESC
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="filterEntrust" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
SELECT stock_order.* FROM stock_order
|
|
|
|
|
SELECT stock_order.*
|
|
|
|
|
FROM stock_order
|
|
|
|
|
INNER JOIN basic_entrust_accept on locStorageCode = basic_entrust_accept.curInv
|
|
|
|
|
<where>
|
|
|
|
|
<if test="status != '' and status != null">
|
|
|
|
@ -248,7 +314,8 @@
|
|
|
|
|
|
|
|
|
|
<select id="findOne" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
|
select stock_order.*, auth_dept.name deptName FROM stock_order
|
|
|
|
|
select stock_order.*, auth_dept.name deptName
|
|
|
|
|
FROM stock_order
|
|
|
|
|
left join auth_dept on stock_order.dept = auth_dept.code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="id != '' and id != null">
|
|
|
|
@ -287,18 +354,44 @@
|
|
|
|
|
|
|
|
|
|
<select id="listOrderPrint" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderPrintEntity">
|
|
|
|
|
SELECT stock_order.*, stock_order.remark orderRemark,stock_order_detail.productId,
|
|
|
|
|
stock_order_detail.productName,auth_user.employeeName reviewUserName,
|
|
|
|
|
stock_order_detail.spec, stock_order_detail.batchNo, stock_order_detail.productDate,
|
|
|
|
|
stock_order_detail.expireDate, stock_order_detail.count, stock_order_detail.sweepCount,
|
|
|
|
|
stock_order_detail.ylqxzcrbarmc,stock_order_detail.manufactory, stock_order_detail.zczbhhzbapzbh,
|
|
|
|
|
stock_order_detail.price,inv_warehouse.name locInv,inv_warehouse_sub.name subInv,basic_products.spmc,
|
|
|
|
|
basic_products.cpms,basic_udirel.measname,auth_dept.`name`
|
|
|
|
|
deptName,basic_products.basicPrductRemak1
|
|
|
|
|
,basic_products.basicPrductRemak2,basic_products.basicPrductRemak3,basic_products.basicPrductRemak4,basic_products.basicPrductRemak5,basic_products.basicPrductRemak6
|
|
|
|
|
,basic_products.basicPrductRemak7,basic_products.basicPrductRemak8,
|
|
|
|
|
thr_products.code thrCode,thr_products.name thrName,thr_products.measname thrMeasname,thr_products.spec thrSpec,
|
|
|
|
|
thr_products.registerNo thrRegisterNo,thr_products.manufactory thrManufactory
|
|
|
|
|
SELECT stock_order.*,
|
|
|
|
|
stock_order.remark orderRemark,
|
|
|
|
|
stock_order_detail.productId,
|
|
|
|
|
stock_order_detail.productName,
|
|
|
|
|
auth_user.employeeName reviewUserName,
|
|
|
|
|
stock_order_detail.spec,
|
|
|
|
|
stock_order_detail.batchNo,
|
|
|
|
|
stock_order_detail.productDate,
|
|
|
|
|
stock_order_detail.expireDate,
|
|
|
|
|
stock_order_detail.count,
|
|
|
|
|
stock_order_detail.sweepCount,
|
|
|
|
|
stock_order_detail.ylqxzcrbarmc,
|
|
|
|
|
stock_order_detail.manufactory,
|
|
|
|
|
stock_order_detail.zczbhhzbapzbh,
|
|
|
|
|
stock_order_detail.price,
|
|
|
|
|
inv_warehouse.name locInv,
|
|
|
|
|
inv_warehouse_sub.name subInv,
|
|
|
|
|
basic_products.spmc,
|
|
|
|
|
basic_products.cpms,
|
|
|
|
|
basic_udirel.measname,
|
|
|
|
|
auth_dept.`name`
|
|
|
|
|
deptName,
|
|
|
|
|
basic_products.basicPrductRemak1
|
|
|
|
|
,
|
|
|
|
|
basic_products.basicPrductRemak2,
|
|
|
|
|
basic_products.basicPrductRemak3,
|
|
|
|
|
basic_products.basicPrductRemak4,
|
|
|
|
|
basic_products.basicPrductRemak5,
|
|
|
|
|
basic_products.basicPrductRemak6
|
|
|
|
|
,
|
|
|
|
|
basic_products.basicPrductRemak7,
|
|
|
|
|
basic_products.basicPrductRemak8,
|
|
|
|
|
thr_products.code thrCode,
|
|
|
|
|
thr_products.name thrName,
|
|
|
|
|
thr_products.measname thrMeasname,
|
|
|
|
|
thr_products.spec thrSpec,
|
|
|
|
|
thr_products.registerNo thrRegisterNo,
|
|
|
|
|
thr_products.manufactory thrManufactory
|
|
|
|
|
FROM stock_order
|
|
|
|
|
INNER JOIN stock_order_detail on stock_order.id = stock_order_detail.orderIdFk
|
|
|
|
|
LEFT JOIN inv_warehouse ON stock_order.locStorageCode = inv_warehouse.`code`
|
|
|
|
@ -325,23 +418,49 @@
|
|
|
|
|
<if test="invWarehouseCode != '' and invWarehouseCode != null">
|
|
|
|
|
and invWarehouseCode = #{invWarehouseCode}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
group by stock_order_detail.id
|
|
|
|
|
ORDER BY id DESC
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="listCodePrint" parameterType="com.glxp.sale.admin.req.inout.StockOrderFilterRequest"
|
|
|
|
|
resultType="com.glxp.sale.admin.entity.inout.StockOrderPrintEntity">
|
|
|
|
|
select io_codes.code udiCode,basic_udirel.id productId,basic_products.cpmctymc productName,basic_products.ggxh
|
|
|
|
|
spec,io_codes.batchNo,io_codes.produceDate productDate,io_codes.expireDate ,io_codes.serialNo,io_codes.count,
|
|
|
|
|
basic_products.ylqxzcrbarmc,basic_udirel.manufactory,basic_udirel.measname,
|
|
|
|
|
inv_warehouse.name locInv, inv_warehouse_sub.name subInv, basic_products.spmc,
|
|
|
|
|
basic_products.cpms,io_codes.nameCode,io_codes.relId,basic_products.basicPrductRemak1
|
|
|
|
|
,basic_products.basicPrductRemak2,basic_products.basicPrductRemak3,basic_products.basicPrductRemak4,basic_products.basicPrductRemak5,basic_products.basicPrductRemak6
|
|
|
|
|
,basic_products.basicPrductRemak7,basic_products.basicPrductRemak8,
|
|
|
|
|
thr_products.code thrCode,thr_products.name thrName,thr_products.measname thrMeasname,thr_products.spec thrSpec,
|
|
|
|
|
thr_products.registerNo thrRegisterNo,thr_products.manufactory thrManufactory
|
|
|
|
|
select io_codes.code udiCode,
|
|
|
|
|
basic_udirel.id productId,
|
|
|
|
|
basic_products.cpmctymc productName,
|
|
|
|
|
basic_products.ggxh
|
|
|
|
|
spec,
|
|
|
|
|
io_codes.batchNo,
|
|
|
|
|
io_codes.produceDate productDate,
|
|
|
|
|
io_codes.expireDate,
|
|
|
|
|
io_codes.serialNo,
|
|
|
|
|
io_codes.count,
|
|
|
|
|
basic_products.ylqxzcrbarmc,
|
|
|
|
|
basic_udirel.manufactory,
|
|
|
|
|
basic_udirel.measname,
|
|
|
|
|
inv_warehouse.name locInv,
|
|
|
|
|
inv_warehouse_sub.name subInv,
|
|
|
|
|
basic_products.spmc,
|
|
|
|
|
basic_products.cpms,
|
|
|
|
|
io_codes.nameCode,
|
|
|
|
|
io_codes.relId,
|
|
|
|
|
basic_products.basicPrductRemak1
|
|
|
|
|
,
|
|
|
|
|
basic_products.basicPrductRemak2,
|
|
|
|
|
basic_products.basicPrductRemak3,
|
|
|
|
|
basic_products.basicPrductRemak4,
|
|
|
|
|
basic_products.basicPrductRemak5,
|
|
|
|
|
basic_products.basicPrductRemak6
|
|
|
|
|
,
|
|
|
|
|
basic_products.basicPrductRemak7,
|
|
|
|
|
basic_products.basicPrductRemak8,
|
|
|
|
|
thr_products.code thrCode,
|
|
|
|
|
thr_products.name thrName,
|
|
|
|
|
thr_products.measname thrMeasname,
|
|
|
|
|
thr_products.spec thrSpec,
|
|
|
|
|
thr_products.registerNo thrRegisterNo,
|
|
|
|
|
thr_products.manufactory thrManufactory
|
|
|
|
|
from io_codes
|
|
|
|
|
INNER JOIN basic_udirel on io_codes.relId = basic_udirel.id
|
|
|
|
|
INNER JOIN basic_products on basic_products.uuid = basic_udirel.uuid
|
|
|
|
@ -352,10 +471,8 @@
|
|
|
|
|
<if test="orderId != '' and orderId != null">
|
|
|
|
|
and io_codes.orderId = #{orderId}
|
|
|
|
|
</if>
|
|
|
|
|
|
|
|
|
|
</where>
|
|
|
|
|
group by io_codes.id
|
|
|
|
|
order by io_codes.id
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectSupplementOrderList" resultType="com.glxp.sale.admin.entity.inout.StockOrderEntity">
|
|
|
|
@ -395,5 +512,4 @@
|
|
|
|
|
from stock_order
|
|
|
|
|
where billNo = #{billNo}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|