| | |
| | | <result column="reviewed_time" property="reviewedTime"/> |
| | | <result column="remarks" property="remarks"/> |
| | | <result column="is_state" property="isState"/> |
| | | <result column="process_id" property="processId"/> |
| | | |
| | | <result column="width" property="orderDetail.width"/> |
| | | <result column="height" property="orderDetail.height"/> |
| | |
| | | <result column="product_name" property="orderDetail.productName"/> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="getSelectStorageRecord" resultMap="selectFinishedGoodsInventory"> |
| | | select fol.id, |
| | | fol.operation_order_number, |
| | | fol.order_id, |
| | | fol.operate_type, |
| | | fol.process_id, |
| | | fol.operation_number, |
| | | fol.quantity, |
| | | fol.operator, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | fol.operate_time, |
| | | fol.`status`, |
| | | fol.is_state, |
| | | fol.reviewed, |
| | | fol.reviewed_time, |
| | | fol.type, |
| | | fol.remarks |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = #{type} and aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | <where> |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} |
| | | <if test="finishedOperateLog.operationOrderNumber != null and finishedOperateLog.operationOrderNumber != ''"> |
| | | and fol.operation_order_number regexp #{finishedOperateLog.operationOrderNumber} |
| | | </if> |
| | | <if test="finishedOperateLog.orderId != null and finishedOperateLog.orderId != ''"> |
| | | and fol.order_id regexp #{finishedOperateLog.orderId} |
| | | </if> |
| | | <if test="finishedOperateLog.operationNumber != null and finishedOperateLog.operationNumber != ''"> |
| | | and fol.operation_number regexp #{finishedOperateLog.operationNumber} |
| | | </if> |
| | | <if test="finishedOperateLog.quantity != null and finishedOperateLog.quantity != ''"> |
| | | and fol.quantity regexp #{finishedOperateLog.quantity} |
| | | </if> |
| | | <if test="finishedOperateLog.operator != null and finishedOperateLog.operator != ''"> |
| | | and fol.operator regexp #{finishedOperateLog.operator} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != ''"> |
| | | and od.product_id regexp #{finishedOperateLog.orderDetail.productId} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{finishedOperateLog.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''"> |
| | | and od.width regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''"> |
| | | and od.height regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.height},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.operateTime != null and finishedOperateLog.operateTime != ''"> |
| | | and fol.operate_time regexp #{finishedOperateLog.operateTime} |
| | | </if> |
| | | <if test="finishedOperateLog.status != null and finishedOperateLog.status != ''"> |
| | | and fol.`status` regexp #{finishedOperateLog.status} |
| | | </if> |
| | | <if test="finishedOperateLog.reviewed != null and finishedOperateLog.reviewed != ''"> |
| | | and fol.reviewed regexp #{finishedOperateLog.reviewed} |
| | | </if> |
| | | <if test="finishedOperateLog.reviewedTime != null and finishedOperateLog.reviewedTime != ''"> |
| | | and fol.reviewed_time regexp #{finishedOperateLog.reviewedTime} |
| | | </if> |
| | | <if test="finishedOperateLog.type != null and finishedOperateLog.type != ''"> |
| | | and fol.type regexp #{finishedOperateLog.type} |
| | | </if> |
| | | <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''"> |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | </if> |
| | | </where> |
| | | order by fol.`status` desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectStorageRecordLogPageTotal"> |
| | | select CEILING(count(fol.id)/#{pageSize}) as 'pageTotal', |
| | | count(fol.id) as 'total' |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = #{type} and aa.status!='已作废') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.operation_number = od.order_number |
| | | <where> |
| | | date(fol.operate_time)>=#{startDate} and date(fol.operate_time) <= #{endDate} |
| | | <if test="finishedOperateLog.operationOrderNumber != null and finishedOperateLog.operationOrderNumber != ''"> |
| | | and fol.operation_order_number regexp #{finishedOperateLog.operationOrderNumber} |
| | | </if> |
| | | <if test="finishedOperateLog.orderId != null and finishedOperateLog.orderId != ''"> |
| | | and fol.order_id regexp #{finishedOperateLog.orderId} |
| | | </if> |
| | | <if test="finishedOperateLog.operationNumber != null and finishedOperateLog.operationNumber != ''"> |
| | | and fol.operation_number regexp #{finishedOperateLog.operationNumber} |
| | | </if> |
| | | <if test="finishedOperateLog.quantity != null and finishedOperateLog.quantity != ''"> |
| | | and fol.quantity regexp #{finishedOperateLog.quantity} |
| | | </if> |
| | | <if test="finishedOperateLog.operator != null and finishedOperateLog.operator != ''"> |
| | | and fol.operator regexp #{finishedOperateLog.operator} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != ''"> |
| | | and od.product_id regexp #{finishedOperateLog.orderDetail.productId} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{finishedOperateLog.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''"> |
| | | and od.width regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail.height != null and finishedOperateLog.orderDetail.height != ''"> |
| | | and od.height regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.height},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.operateTime != null and finishedOperateLog.operateTime != ''"> |
| | | and fol.operate_time regexp #{finishedOperateLog.operateTime} |
| | | </if> |
| | | <if test="finishedOperateLog.status != null and finishedOperateLog.status != ''"> |
| | | and fol.`status` regexp #{finishedOperateLog.status} |
| | | </if> |
| | | <if test="finishedOperateLog.reviewed != null and finishedOperateLog.reviewed != ''"> |
| | | and fol.reviewed regexp #{finishedOperateLog.reviewed} |
| | | </if> |
| | | <if test="finishedOperateLog.reviewedTime != null and finishedOperateLog.reviewedTime != ''"> |
| | | and fol.reviewed_time regexp #{finishedOperateLog.reviewedTime} |
| | | </if> |
| | | <if test="finishedOperateLog.type != null and finishedOperateLog.type != ''"> |
| | | and fol.type regexp #{finishedOperateLog.type} |
| | | </if> |
| | | <if test="finishedOperateLog.remarks != null and finishedOperateLog.remarks != ''"> |
| | | and fol.remarks regexp #{finishedOperateLog.remarksr} |
| | | </if> |
| | | </where> |
| | | order by fol.`status` desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <update id="updateToExamine"> |
| | | update mm.finished_operate_log set reviewed=#{userName},reviewed_time=now(),status=#{type} where operation_order_number=#{finishedOperateLog.operationOrderNumber}; |
| | |
| | | <insert id="insertIntFinishedOperateLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | process_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time |
| | | operate_time, |
| | | status |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now() |
| | | #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.processId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now(),"未审核" |
| | | ) |
| | | </insert> |
| | | |
| | |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time |
| | | operate_time, |
| | | status |
| | | ) |
| | | values ( |
| | | #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.orderId},#{orderDetail.deliveryDetail.orderNumber} |
| | | ,"出库",#{userName},#{orderDetail.warehouseNum},now() |
| | | ,"出库",#{userName},#{orderDetail.deliveryDetail.quantity},now(),"未审核" |
| | | ) |
| | | </insert> |
| | | |