|
@@ -65,16 +65,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
select bs.code as mnemonic_code, bs.name as supplier_name, bod.product_num, brr.audit_num, bod.lot_code
|
|
|
, (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_date, (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) as balance_date from biz_process_inspecion bpi
|
|
|
+ , (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 as outsourcedOrder_detail_form_code, bod.form_date as outsource_date, brr.form_code as return_receipt_detail_form_code, brr.form_date as return_receipt_date, (case when bpi.audit_status = 1 then bpi.update_time else null end) as audit_date, (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) as balance_date 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="lotCode != null and lotCode != ''">AND bpi.lot_code like concat ('%',#{lotCode},'%')</if>
|
|
|
+ <if test="userId != null ">AND bpi.user_id = #{userId}</if>
|
|
|
+ <if test="status != null ">AND bpi.status = #{status}</if>
|
|
|
+ <if test="startTime != null"> AND DATE(bpi.start_time) >= #{startTime}</if>
|
|
|
+ <if test="endTime != null"> AND DATE(bpi.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>
|
|
@@ -94,11 +94,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
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="lotCode != null and lotCode != ''">AND bpi.lot_code like concat ('%',#{lotCode},'%')</if>
|
|
|
+ <if test="userId != null ">AND bpi.user_id = #{userId}</if>
|
|
|
+ <if test="status != null ">AND bpi.status = #{status}</if>
|
|
|
+ <if test="startTime != null"> AND DATE(bpi.start_time) >= #{startTime}</if>
|
|
|
+ <if test="endTime != null"> AND DATE(bpi.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>
|