| | |
| | | <resultMap id="selectFinishedGoodsInventory" type="com.example.erp.entity.mm.FinishedOperateLog" > |
| | | <id column="id" property="id"/> |
| | | <result column="operation_order_number" property="operationOrderNumber"/> |
| | | <result column="product_number" property="productNumber"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <result column="operation_number" property="operationNumber"/> |
| | | <result column="quantity" property="quantity"/> |
| | | <result column="operate_type" property="operateType"/> |
| | | <result column="operator" property="operator"/> |
| | | <result column="operate_time" property="operateTime"/> |
| | | <result column="stater_operation_order_number" property="staterOperationOrderNumber"/> |
| | | <result column="end_operation_order_number" property="endOperationOrderNumber"/> |
| | | <result column="status" property="status"/> |
| | | <result column="type" property="type"/> |
| | | <result column="reviewed" property="reviewed"/> |
| | | <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="g_typeId" property="glassTypes.typeId"/> |
| | | <result column="g_type" property="glassTypes.type"/>--> |
| | | <result column="width" property="orderDetail.width"/> |
| | | <result column="height" property="orderDetail.height"/> |
| | | <result column="product_id" property="orderDetail.productId"/> |
| | | <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 |
| | | left join sd.`order` o on o.order_id=fol.order_id |
| | | <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.operate_time 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 |
| | | </select> |
| | | |
| | | <update id="updateToExamine"> |
| | | update mm.finished_operate_log set reviewed=#{userName},reviewed_time=now(),status=#{type} where operation_order_number=#{finishedOperateLog.operationOrderNumber}; |
| | | </update> |
| | | |
| | | <update id="updateFinishedOperateLogState"> |
| | | update mm.finished_operate_log set status=#{type} where id=#{finishedOperateLog.id}; |
| | | </update> |
| | | |
| | | <select id="getSelectOperateRecord" resultMap="selectFinishedGoodsInventory"> |
| | | select fol.id, |
| | | fol.operation_order_number, |
| | | fol.order_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 = '领出' or aa.operate_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="getSelectOperateRecordLogPageTotal" > |
| | | 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 = '领出' or aa.operate_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> |
| | | </select> |
| | | |
| | | <select id="getselectAllocateFinishedOperateLog" resultMap="selectFinishedGoodsInventory" > |
| | | select fol.operation_order_number, |
| | | fol.order_id, |
| | | fol.operation_number, |
| | | fol.stater_operation_order_number, |
| | | fol.end_operation_order_number, |
| | | fol.quantity, |
| | | fol.operator, |
| | | od.product_id, |
| | | od.product_name, |
| | | od.width, |
| | | od.height, |
| | | fol.operate_time |
| | | from (select * |
| | | from mm.finished_operate_log aa where aa.operate_type = '调拨') 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.staterOperationOrderNumber != null and finishedOperateLog.staterOperationOrderNumber != ''"> |
| | | and fol.stater_operation_order_number regexp #{finishedOperateLog.staterOperationOrderNumber} |
| | | </if> |
| | | <if test="finishedOperateLog.endOperationOrderNumber != null and finishedOperateLog.endOperationOrderNumber != ''"> |
| | | and fol.end_operation_order_number regexp #{finishedOperateLog.endOperationOrderNumber} |
| | | </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> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getselectAllocateFinishedOperateLogPageTotal" > |
| | | 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 = '调拨') fol |
| | | left join sd.order_detail od on fol.order_id = od.order_id and fol.end_operation_order_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.staterOperationOrderNumber != null and finishedOperateLog.staterOperationOrderNumber != ''"> |
| | | and fol.stater_operation_order_number regexp #{finishedOperateLog.staterOperationOrderNumber} |
| | | </if> |
| | | <if test="finishedOperateLog.endOperationOrderNumber != null and finishedOperateLog.endOperationOrderNumber != ''"> |
| | | and fol.end_operation_order_number regexp #{finishedOperateLog.endOperationOrderNumber} |
| | | </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> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <select id="getSelectFinishedOperateLogReport" 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.stater_operation_order_number, |
| | | fol.end_operation_order_number, |
| | | 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.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.operateType != null and finishedOperateLog.operateType != ''"> |
| | | and fol.operate_type regexp #{finishedOperateLog.operateType} |
| | | </if> |
| | | <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!=null and finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != ''"> |
| | | and od.product_id regexp #{finishedOperateLog.orderDetail.productId} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail!=null and finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{finishedOperateLog.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail!=null and finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''"> |
| | | and od.width regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail!=null and 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="getSelectFinishedOperateLogReportPageTotal"> |
| | | select CEILING(count(fol.id)/#{pageSize}) as 'pageTotal', |
| | | count(fol.id) as 'total' |
| | | from (select * |
| | | from mm.finished_operate_log aa where 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.operateType != null and finishedOperateLog.operateType != ''"> |
| | | and fol.operate_type regexp #{finishedOperateLog.operateType} |
| | | </if> |
| | | <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!=null and finishedOperateLog.orderDetail.productId != null and finishedOperateLog.orderDetail.productId != ''"> |
| | | and od.product_id regexp #{finishedOperateLog.orderDetail.productId} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail!=null and finishedOperateLog.orderDetail.productName != null and finishedOperateLog.orderDetail.productName != ''"> |
| | | and od.product_name regexp #{finishedOperateLog.orderDetail.productName} |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail!=null and finishedOperateLog.orderDetail.width != null and finishedOperateLog.orderDetail.width != ''"> |
| | | and od.width regexp REGEXP_REPLACE(#{finishedOperateLog.orderDetail.width},'\\.0+$','') |
| | | </if> |
| | | <if test="finishedOperateLog.orderDetail!=null and 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> |
| | | </select> |
| | | |
| | | <select id="getselectFinishedOperateLog" > |
| | | select |
| | | * |
| | |
| | | mm.finished_operate_log limit 0,1; |
| | | </select> |
| | | |
| | | <insert id="insertFinishedOperateLog" useGeneratedKeys="true" keyProperty="id" > |
| | | |
| | | |
| | | <select id="getmaximum" > |
| | | select count(*) from (select * from mm.finished_operate_log where operate_type =#{type} and date(operate_time)=CURDATE() group by operation_order_number) zu |
| | | </select> |
| | | |
| | | <insert id="insertIntFinishedOperateLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | product_number, |
| | | order_id, |
| | | process_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time |
| | | operate_time, |
| | | status, |
| | | remarks |
| | | ) |
| | | values ( |
| | | #{processId} ,#{orderDetail.productId},#{orderNumber},"入库","王五",#{inventoryQuantity},now() |
| | | #{oddNumber} ,#{flowCard.order.orderId},#{flowCard.processId},#{flowCard.orderNumber},"入库",#{userName},#{flowCard.inventoryQuantity},now(),"未审核",#{container} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertOutFinishedOperateLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status |
| | | ) |
| | | values ( |
| | | #{orderDetail.deliveryDetail.deliveryId} ,#{orderDetail.deliveryDetail.orderId},#{orderDetail.deliveryDetail.orderNumber} |
| | | ,"出库",#{userName},#{orderDetail.deliveryDetail.quantity},now(),"未审核" |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogTakeOut" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status, |
| | | type, |
| | | remarks |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.finishedGoodsInventory.orderId},#{orderDetail.finishedGoodsInventory.orderNumber} |
| | | ,"领出",#{userName},#{orderDetail.quantity},now(),"未审核",#{operateType},#{remarks} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogRework" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status, |
| | | type, |
| | | remarks |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.finishedGoodsInventory.orderId},#{orderDetail.finishedGoodsInventory.orderNumber} |
| | | ,"返工",#{userName},#{orderDetail.quantity},now(),"未审核",#{operateType},#{remarks} |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="insertFinishedOperateLogAllocate" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status, |
| | | stater_operation_order_number, |
| | | end_operation_order_number |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.finishedGoodsInventory.orderId},#{orderDetail.finishedGoodsInventory.orderNumber} |
| | | ,"调拨",#{userName},#{orderDetail.quantity},now(),"未审核",#{orderDetail.orderId},#{orderDetail.orderNumber} |
| | | ) |
| | | </insert> |
| | | |
| | | <select id="exportFinishedOperateLogReport"> |
| | | 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.stater_operation_order_number, |
| | | fol.end_operation_order_number, |
| | | 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.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)>=#{dates[0]} and date(fol.operate_time) <= #{dates[1]} |
| | | |
| | | </select> |
| | | |
| | | <insert id="insertOrderFinishedOperateLog" useGeneratedKeys="true" > |
| | | insert into mm.finished_operate_log(operation_order_number, |
| | | order_id, |
| | | process_id, |
| | | operation_number, |
| | | operate_type, |
| | | operator, |
| | | quantity, |
| | | operate_time, |
| | | status |
| | | ) |
| | | values ( |
| | | #{oddNumber} ,#{orderDetail.orderId},"",#{orderDetail.orderNumber},"入库",#{userName},#{orderDetail.quantity},now(),"未审核" |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |