|
@@ -466,7 +466,7 @@
|
|
p.save_file_date,
|
|
p.save_file_date,
|
|
o.id as orderFundId,
|
|
o.id as orderFundId,
|
|
fi.invoiceAmount,
|
|
fi.invoiceAmount,
|
|
- (SELECT IF(COUNT(id) > 0, TRUE, FALSE) FROM personal_production WHERE deleted = 0 AND target_id = pt.id) AS harReport
|
|
|
|
|
|
+ pp.productions
|
|
from
|
|
from
|
|
personal p
|
|
personal p
|
|
LEFT JOIN personal_target pt ON pt.personal_id = p.id
|
|
LEFT JOIN personal_target pt ON pt.personal_id = p.id
|
|
@@ -478,6 +478,7 @@
|
|
LEFT JOIN user u3 ON u3.id = p.pricing_staff
|
|
LEFT JOIN user u3 ON u3.id = p.pricing_staff
|
|
left join (select id,business_id,real_amount,should_amount from order_fund where business_type='PERSONAL_BUSINESS' and deleted = 0) o on o.business_id = p.id
|
|
left join (select id,business_id,real_amount,should_amount from order_fund where business_type='PERSONAL_BUSINESS' and deleted = 0) o on o.business_id = p.id
|
|
left join (select sum(real_amount) as invoiceAmount,order_fund_id from finance_invoice where state ='已开票' and deleted = 0 GROUP BY order_fund_id) fi on fi.order_fund_id = o.id
|
|
left join (select sum(real_amount) as invoiceAmount,order_fund_id from finance_invoice where state ='已开票' and deleted = 0 GROUP BY order_fund_id) fi on fi.order_fund_id = o.id
|
|
|
|
+ LEFT JOIN ( SELECT target_id, GROUP_CONCAT( case production when 'STATEMENT' then '意见书' when 'FINAL' then '结果报告' when 'TECHNIC' then '技术报告' when 'LETTER' then '复评函' end )as productions FROM personal_production WHERE deleted = 0 AND production_time IS NOT NULL GROUP BY target_id ) pp on pp.target_id = pt.id
|
|
where
|
|
where
|
|
p.deleted = 0 and p.client_manager_id = #{personal.clientManagerId}
|
|
p.deleted = 0 and p.client_manager_id = #{personal.clientManagerId}
|
|
<if test="keyword!=null and keyword!='' ">
|
|
<if test="keyword!=null and keyword!='' ">
|
|
@@ -529,6 +530,9 @@
|
|
<if test="personal!=null and personal.clientSubName!=null and personal.clientSubName!=''">
|
|
<if test="personal!=null and personal.clientSubName!=null and personal.clientSubName!=''">
|
|
and cc2.NAME like concat('%',#{personal.clientSubName},'%')
|
|
and cc2.NAME like concat('%',#{personal.clientSubName},'%')
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="personal!=null and personal.productions!=null and personal.productions!='' ">
|
|
|
|
+ and pp.productions like concat('%',#{personal.productions},'%')
|
|
|
|
+ </if>
|
|
ORDER BY
|
|
ORDER BY
|
|
<if test="personal!=null and personal.invoiceAmount!=null">
|
|
<if test="personal!=null and personal.invoiceAmount!=null">
|
|
fi.invoiceAmount=${personal.invoiceAmount} desc,
|
|
fi.invoiceAmount=${personal.invoiceAmount} desc,
|
|
@@ -628,11 +632,11 @@
|
|
u3.NAME AS pricingStaffName,
|
|
u3.NAME AS pricingStaffName,
|
|
p.created,
|
|
p.created,
|
|
p.created as xCreated,
|
|
p.created as xCreated,
|
|
- pt.productions,
|
|
|
|
|
|
+ pp.productions,
|
|
p.evaluate_aim
|
|
p.evaluate_aim
|
|
FROM
|
|
FROM
|
|
personal p
|
|
personal p
|
|
- LEFT JOIN (select personal_id,acreage,price,amount,created,productions from personal_target where deleted = 0) pt ON pt.personal_id = p.id
|
|
|
|
|
|
+ LEFT JOIN (select id, personal_id,acreage,price,amount,created from personal_target where deleted = 0) pt ON pt.personal_id = p.id
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
f.business_id,
|
|
f.business_id,
|
|
@@ -651,6 +655,7 @@
|
|
LEFT JOIN (select id,name from user where deleted = 0) u1 ON u1.id = p.outward_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u1 ON u1.id = p.outward_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u2 ON u2.id = p.inward_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u2 ON u2.id = p.inward_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u3 ON u3.id = p.pricing_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u3 ON u3.id = p.pricing_staff
|
|
|
|
+ LEFT JOIN ( SELECT target_id, GROUP_CONCAT( case production when 'STATEMENT' then '意见书' when 'FINAL' then '结果报告' when 'TECHNIC' then '技术报告' end )as productions FROM personal_production WHERE deleted = 0 AND production_time IS NOT NULL GROUP BY target_id ) pp on pp.target_id = pt.id
|
|
WHERE
|
|
WHERE
|
|
p.deleted = 0
|
|
p.deleted = 0
|
|
<if test="keyword!=null and keyword!='' ">
|
|
<if test="keyword!=null and keyword!='' ">
|
|
@@ -701,7 +706,7 @@
|
|
and u4.name like concat('%',#{personal.handlerName},'%')
|
|
and u4.name like concat('%',#{personal.handlerName},'%')
|
|
</if>
|
|
</if>
|
|
<if test="personal!=null and personal.productions!=null and personal.productions!='' ">
|
|
<if test="personal!=null and personal.productions!=null and personal.productions!='' ">
|
|
- and pt.productions like concat('%',#{personal.productions},'%')
|
|
|
|
|
|
+ and pp.productions like concat('%',#{personal.productions},'%')
|
|
</if>
|
|
</if>
|
|
<if test="personal!=null and personal.evaluateAim!=null and personal.evaluateAim!='' ">
|
|
<if test="personal!=null and personal.evaluateAim!=null and personal.evaluateAim!='' ">
|
|
and p.evaluate_aim = #{personal.evaluateAim}
|
|
and p.evaluate_aim = #{personal.evaluateAim}
|
|
@@ -714,7 +719,7 @@
|
|
count(1)
|
|
count(1)
|
|
FROM
|
|
FROM
|
|
personal p
|
|
personal p
|
|
- LEFT JOIN (select personal_id,acreage,price,amount,created from personal_target where deleted = 0) pt ON pt.personal_id = p.id
|
|
|
|
|
|
+ LEFT JOIN (select id, personal_id,acreage,price,amount,created from personal_target where deleted = 0) pt ON pt.personal_id = p.id
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
f.business_id,
|
|
f.business_id,
|
|
@@ -733,6 +738,7 @@
|
|
LEFT JOIN (select id,name from user where deleted = 0) u1 ON u1.id = p.outward_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u1 ON u1.id = p.outward_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u2 ON u2.id = p.inward_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u2 ON u2.id = p.inward_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u3 ON u3.id = p.pricing_staff
|
|
LEFT JOIN (select id,name from user where deleted = 0) u3 ON u3.id = p.pricing_staff
|
|
|
|
+ LEFT JOIN ( SELECT target_id, GROUP_CONCAT( case production when 'STATEMENT' then '意见书' when 'FINAL' then '结果报告' when 'TECHNIC' then '技术报告' when 'LETTER' then '复评函' end )as productions FROM personal_production WHERE deleted = 0 AND production_time IS NOT NULL GROUP BY target_id ) pp on pp.target_id = pt.id
|
|
WHERE
|
|
WHERE
|
|
p.deleted = 0
|
|
p.deleted = 0
|
|
<if test="keyword!=null and keyword!='' ">
|
|
<if test="keyword!=null and keyword!='' ">
|
|
@@ -785,6 +791,9 @@
|
|
<if test="personal!=null and personal.evaluateAim!=null and personal.evaluateAim!='' ">
|
|
<if test="personal!=null and personal.evaluateAim!=null and personal.evaluateAim!='' ">
|
|
and p.evaluate_aim = #{personal.evaluateAim}
|
|
and p.evaluate_aim = #{personal.evaluateAim}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="personal!=null and personal.productions!=null and personal.productions!='' ">
|
|
|
|
+ and pp.productions like concat('%',#{personal.productions},'%')
|
|
|
|
+ </if>
|
|
order by p.created desc
|
|
order by p.created desc
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|