|
@@ -61,17 +61,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</trim>
|
|
|
order by rrd.form_code,rrd.lot_code
|
|
|
</select>
|
|
|
- <select id="getExportList" parameterType="cn.ezhizao.project.websocket.domain.BizProcessInspectionExport" resultMap="ExportResult">
|
|
|
-
|
|
|
- </select>
|
|
|
- <select id="getCountForExport" resultType="java.lang.Long">
|
|
|
+ <select id="getExportList" parameterType="BizProcessInspecion" resultMap="ExportResult">
|
|
|
select bs.code as mnemonic_code, bs.name as supplier_name, bod.product_num, brr.audit_num
|
|
|
- , (case when bod.product_num < brr.audit_num then 0 else bod.product_num - brr.audit_num end) as material_loss
|
|
|
+ , (case when bod.product_num < brr.audit_num then 0 else bod.product_num - brr.audit_num end) as material_loss
|
|
|
, brr.process_alias
|
|
|
, (case when bpi.audit_status = 1 then '已审核' else '未审核' end) as audit_status, bpi.start_time, bpi.end_time, bpi.reject_num, bpi.lot_code, bpi.product_description, bod.form_code, bod.form_date, brr.form_code, brr.form_date, (case when bpi.audit_status = 1 then bpi.update_time else null end) as audit_time, (select boa.update_time from biz_outsource_balance_account boa where boa.status = 1 and boa.process_inspection_id = bpi.id order by update_time desc limit 1) from biz_process_inspecion bpi
|
|
|
left join biz_outsourced_order_detail bod on bod.id = bpi.outsource_order_detail_id left join biz_return_receipt_detail brr on brr.id = bpi.return_receipt_detail_id
|
|
|
left join biz_supplier bs on bs.id = bod.supplier_id
|
|
|
- where recheck_date is null and is_outsourced_inspection = 1
|
|
|
+ <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
|
+ recheck_date is null and is_outsourced_inspection = 1 and bpi.deleted = 0
|
|
|
+ <if test="lotCode != null and lotCode != ''">AND t.lot_code like concat ('%',#{lotCode},'%')</if>
|
|
|
+ <if test="userId != null ">AND t.user_id = #{userId}</if>
|
|
|
+ <if test="status != null ">AND t.status = #{status}</if>
|
|
|
+ <if test="startTime != null"> AND DATE(t.start_time) >= #{startTime}</if>
|
|
|
+ <if test="endTime != null"> AND DATE(t.start_time) <= #{endTime}</if>
|
|
|
+ <!-- <if test="startTime != null"> AND t.date_format(t.start_time, '%Y-%m-%d') = date_format(#{startTime}, '%Y-%m-%d')</if>-->
|
|
|
+ <if test="supplierName != null">AND exists (select supplier_name from biz_outsourced_order_detail o where o.id = bpi.outsource_order_detail_id and o.supplier_name like concat('%', #{supplierName}, '%'))</if>
|
|
|
+ <if test="returnReceiptDetailFormCode != null ">AND rrd.form_code like concat('%', #{returnReceiptDetailFormCode}, '%') </if>
|
|
|
+ <if test="outsourcedOrderDetailFormCode != null ">AND bod.form_code like concat('%', #{outsourcedOrderDetailFormCode}, '%') </if>
|
|
|
+ <if test="auditStatus != null ">AND bpi.audit_status = #{auditStatus}</if>
|
|
|
+ <if test="keyword != null and keyword !='' ">AND (bpi.lot_code LIKE CONCAT('%',#{keyword},'%') OR bpi.carrier_code
|
|
|
+ LIKE CONCAT('%',#{keyword},'%') OR
|
|
|
+ bpi.product_description LIKE CONCAT('%',#{keyword},'%'))</if>
|
|
|
+ </trim>
|
|
|
+ </select>
|
|
|
+ <select id="getCountForExport" resultType="java.lang.Long" parameterType="BizProcessInspecion">
|
|
|
+ select count(1) from biz_process_inspecion bpi
|
|
|
+ left join biz_outsourced_order_detail bod on bod.id = bpi.outsource_order_detail_id left join biz_return_receipt_detail brr on brr.id = bpi.return_receipt_detail_id
|
|
|
+ left join biz_supplier bs on bs.id = bod.supplier_id
|
|
|
+ <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
|
|
|
+ recheck_date is null and is_outsourced_inspection = 1 and bpi.deleted = 0
|
|
|
+ <if test="lotCode != null and lotCode != ''">AND t.lot_code like concat ('%',#{lotCode},'%')</if>
|
|
|
+ <if test="userId != null ">AND t.user_id = #{userId}</if>
|
|
|
+ <if test="status != null ">AND t.status = #{status}</if>
|
|
|
+ <if test="startTime != null"> AND DATE(t.start_time) >= #{startTime}</if>
|
|
|
+ <if test="endTime != null"> AND DATE(t.start_time) <= #{endTime}</if>
|
|
|
+ <!-- <if test="startTime != null"> AND t.date_format(t.start_time, '%Y-%m-%d') = date_format(#{startTime}, '%Y-%m-%d')</if>-->
|
|
|
+ <if test="supplierName != null">AND exists (select supplier_name from biz_outsourced_order_detail o where o.id = bpi.outsource_order_detail_id and o.supplier_name like concat('%', #{supplierName}, '%'))</if>
|
|
|
+ <if test="returnReceiptDetailFormCode != null ">AND rrd.form_code like concat('%', #{returnReceiptDetailFormCode}, '%') </if>
|
|
|
+ <if test="outsourcedOrderDetailFormCode != null ">AND bod.form_code like concat('%', #{outsourcedOrderDetailFormCode}, '%') </if>
|
|
|
+ <if test="auditStatus != null ">AND bpi.audit_status = #{auditStatus}</if>
|
|
|
+ <if test="keyword != null and keyword !='' ">AND (bpi.lot_code LIKE CONCAT('%',#{keyword},'%') OR bpi.carrier_code
|
|
|
+ LIKE CONCAT('%',#{keyword},'%') OR
|
|
|
+ bpi.product_description LIKE CONCAT('%',#{keyword},'%'))</if>
|
|
|
+ </trim>
|
|
|
</select>
|
|
|
<select id="getInfo" parameterType="BizProcessInspecion" resultMap="BizProcessInspecionResult">
|
|
|
SELECT distinct t1.*,t4.process_alias,t3.dept_name,t5.user_name as technicianCode,t5.nick_name as technicianName ,
|