|
@@ -1573,7 +1573,7 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
<select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
|
|
<select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
|
|
|
- select
|
|
|
|
|
|
|
+ select
|
|
|
a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.task_comment as taskComment,a.project_status as projectStatus,
|
|
a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.task_comment as taskComment,a.project_status as projectStatus,
|
|
|
a.task_status as taskStatus,e.contacts,a.attachment_url as attachmentUrl,a.outsource_name outsourceName, f.nickname as userName,a.set_up_amount as setUpAmount,
|
|
a.task_status as taskStatus,e.contacts,a.attachment_url as attachmentUrl,a.outsource_name outsourceName, f.nickname as userName,a.set_up_amount as setUpAmount,
|
|
|
g.name as salesmanName,date_format(a.task_start_time,'%Y-%m-%d') as startDate,a.retrieve_content as retrieveContent, a.arrival_money as arrivalMoney,
|
|
g.name as salesmanName,date_format(a.task_start_time,'%Y-%m-%d') as startDate,a.retrieve_content as retrieveContent, a.arrival_money as arrivalMoney,
|
|
@@ -1583,10 +1583,12 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
|
|
|
date_format(a.review_time,'%Y-%m-%d') as reviewDate,date_format(a.publicity_time,'%Y-%m-%d') as publicityDate,a.outsource_price outsourcePrice,
|
|
date_format(a.review_time,'%Y-%m-%d') as reviewDate,date_format(a.publicity_time,'%Y-%m-%d') as publicityDate,a.outsource_price outsourcePrice,
|
|
|
date_format(a.licence_time,'%Y-%m-%d') as licenceDate,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,e.legal_person as legalPerson,
|
|
date_format(a.licence_time,'%Y-%m-%d') as licenceDate,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,e.legal_person as legalPerson,
|
|
|
e.legal_person_tel as legalPersonTel, a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,a.declaration_batch declarationBatch,
|
|
e.legal_person_tel as legalPersonTel, a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,a.declaration_batch declarationBatch,
|
|
|
- a.cost_reduction costReduction, a.official_cost officialCost
|
|
|
|
|
|
|
+ a.cost_reduction costReduction, a.official_cost officialCost,a.set_up_status setUpStatus ,date_format(a.set_up_time,'%Y-%m-%d') setUpTime ,a.high_tech_status highTechStatus ,
|
|
|
|
|
+ a.spot_check_status spotCheckStatus , a.special_comment specialComment ,ttm.certificates_count certificatesCount ,ttm.reject_count rejectCount ,
|
|
|
|
|
+ ttm.authorize_count authorizeCount ,ttm.end_count endCount,ttm.accept_count acceptCount,a.commodity_price commodityPrice,a.commodity_quantity commodityQuantity
|
|
|
from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
|
|
from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.id
|
|
|
left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
|
|
left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
|
|
|
- left join department h on e.order_dep=h.id left join user f on e.buyer_id=f.id
|
|
|
|
|
|
|
+ left join department h on e.order_dep=h.id left join user f on e.buyer_id=f.id LEFT JOIN t_task_mid ttm ON a.id=ttm.tid
|
|
|
left join admin g on e.salesman_id=g.id
|
|
left join admin g on e.salesman_id=g.id
|
|
|
where a.id= #{id,jdbcType=VARCHAR}
|
|
where a.id= #{id,jdbcType=VARCHAR}
|
|
|
</select>
|
|
</select>
|
|
@@ -1824,23 +1826,31 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
|
|
|
<select id="selectProjectStatisticsListByPage" resultType="com.goafanti.order.bo.OutProjectStatistics">
|
|
<select id="selectProjectStatisticsListByPage" resultType="com.goafanti.order.bo.OutProjectStatistics">
|
|
|
select date_format( a.task_distribution_time, '%Y-%m-%d %H:%i:%S' ) distributionTime ,d.name province ,c.name depName,e.salesman_name salesmanName,
|
|
select date_format( a.task_distribution_time, '%Y-%m-%d %H:%i:%S' ) distributionTime ,d.name province ,c.name depName,e.salesman_name salesmanName,
|
|
|
b.contract_no contractNo ,b.order_no orderNo ,e.buyer_name userName,bc.cname ,a.commodity_name pname,ta.name techName,td.name techDepName,
|
|
b.contract_no contractNo ,b.order_no orderNo ,e.buyer_name userName,bc.cname ,a.commodity_name pname,ta.name techName,td.name techDepName,
|
|
|
- a.status projectStatus , a.commodity_price commodityPrice ,a.special_comment,
|
|
|
|
|
|
|
+ a.status projectStatus,a.id,
|
|
|
<if test="status==1">
|
|
<if test="status==1">
|
|
|
a.set_up_status setUpStatus ,a.set_up_time setUpTime ,a.spot_check_status spotCheckStatus ,b.contact_mobile contactMobile , b.legal_person_tel legalPersonTel ,
|
|
a.set_up_status setUpStatus ,a.set_up_time setUpTime ,a.spot_check_status spotCheckStatus ,b.contact_mobile contactMobile , b.legal_person_tel legalPersonTel ,
|
|
|
- a.certificate_number certificateNumber,a.declaration_batch declarationBatch
|
|
|
|
|
|
|
+ a.certificate_number certificateNumber,a.declaration_batch declarationBatch,
|
|
|
</if>
|
|
</if>
|
|
|
<if test="status==2">
|
|
<if test="status==2">
|
|
|
- a.licence_time licenceTime
|
|
|
|
|
|
|
+ a.licence_time licenceTime,
|
|
|
</if>
|
|
</if>
|
|
|
<if test="status==3">
|
|
<if test="status==3">
|
|
|
a.commodity_quantity commodityQuantity ,ttm.certificates_count certificatesCount,ttm.urgent_day urgentDay ,ttm.if_material ifMaterial,
|
|
a.commodity_quantity commodityQuantity ,ttm.certificates_count certificatesCount,ttm.urgent_day urgentDay ,ttm.if_material ifMaterial,
|
|
|
- a.accept_time acceptTime ,a.licence_time licenceTime,a.certificate_number certificateNumber,ttm.cost_amount costAmount ,
|
|
|
|
|
- (a.commodity_price-ttm.cost_amount)profit
|
|
|
|
|
|
|
+ tp.licence_time licenceTime,
|
|
|
|
|
+ a.certificate_number certificateNumber,ttm.cost_amount costAmount ,
|
|
|
|
|
+ (a.commodity_price-ttm.cost_amount)profit,
|
|
|
</if>
|
|
</if>
|
|
|
- ttm.reject_count rejectCount ,ttm.patent_number patentNumber ,
|
|
|
|
|
- ttm.patent_name patentName,
|
|
|
|
|
- a.high_tech_status highTechStatus
|
|
|
|
|
- from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id left join district_glossory d on c.province=d.id
|
|
|
|
|
|
|
+ <if test="status==4">
|
|
|
|
|
+ a.commodity_quantity commodityQuantity ,ttm.certificates_count certificatesCount,a.high_tech_status highTechStatus,
|
|
|
|
|
+ tp.patent_name patentName ,tp.patent_no patentNo ,tp.accept_time acceptTime ,tp.licence_time licenceTime ,tp.authorize_time authorizeTime,
|
|
|
|
|
+ ttm.reject_count rejectCount ,ttm.cost_amount costAmount ,(a.commodity_price-ttm.cost_amount)profit,
|
|
|
|
|
+ </if>
|
|
|
|
|
+
|
|
|
|
|
+ a.commodity_price commodityPrice ,a.special_comment specialComment
|
|
|
|
|
+ from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id left join district_glossory d on c.province=d.id
|
|
|
|
|
+ <if test="status==3 or status==4">
|
|
|
|
|
+ left join task_progress tp on a.id=tp.task_id
|
|
|
|
|
+ </if>
|
|
|
left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id
|
|
left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id
|
|
|
left join t_task_mid ttm on a.id=ttm.tid left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
|
|
left join t_task_mid ttm on a.id=ttm.tid left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
|
|
|
where a.split_status in (0,2) and a.task_status in (1,2,3)
|
|
where a.split_status in (0,2) and a.task_status in (1,2,3)
|
|
@@ -1884,9 +1894,9 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
|
|
|
|
|
|
|
|
<select id="selectProjectStatisticsCount" resultType="java.lang.Integer">
|
|
<select id="selectProjectStatisticsCount" resultType="java.lang.Integer">
|
|
|
select count(*)
|
|
select count(*)
|
|
|
- from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id left join district_glossory d on c.id=d.id
|
|
|
|
|
|
|
+ from t_order_task a left join t_order_new b on a.order_no =b.order_no left join department c on b.order_dep =c.id left join district_glossory d on c.province=d.id
|
|
|
left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id
|
|
left join t_order_mid e on b.order_no =e.order_no left join business_project bp on a.commodity_id =bp.id left join business_category bc on bp.cid =bc.id
|
|
|
- left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
|
|
|
|
|
|
|
+ left join t_task_mid ttm on a.id=ttm.tid left join admin ta on a.task_receiver =ta.id left join department td on ta.department_id =td.id
|
|
|
where a.split_status in (0,2) and a.task_status in (1,2,3)
|
|
where a.split_status in (0,2) and a.task_status in (1,2,3)
|
|
|
<if test="startDate != null and endDate != null">
|
|
<if test="startDate != null and endDate != null">
|
|
|
and a.task_distribution_time between #{startDate} and #{endDate}
|
|
and a.task_distribution_time between #{startDate} and #{endDate}
|
|
@@ -1924,13 +1934,20 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
|
|
|
<select id="selectProvincialStatisticsListByPage" resultType="com.goafanti.order.bo.OutProvincialStatistics">
|
|
<select id="selectProvincialStatisticsListByPage" resultType="com.goafanti.order.bo.OutProvincialStatistics">
|
|
|
select dg.name provinceName,de.name thchDepName ,bc.cname projectStatus,
|
|
select dg.name provinceName,de.name thchDepName ,bc.cname projectStatus,
|
|
|
<if test="status==1">
|
|
<if test="status==1">
|
|
|
- x.kcs ,x.pds ,x.wcs,x.lxs,x.ccs,x.wtg,
|
|
|
|
|
|
|
+ ifnull(x.kcs,0) stockCount, ifnull(x.pds,0) distributeCount,ifnull(x.wcs,0) completeCount,
|
|
|
|
|
+ ifnull(x.lxs,0) setUpCount,ifnull(x.ccs,0) spotCheckCount,ifnull(x.wtg,0) failedCount,
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="status==2">
|
|
|
|
|
+ x.sls acceptCount,x.wjs completeCount,x.sqs authorizeCount,x.bhs rejectCount,
|
|
|
</if>
|
|
</if>
|
|
|
x.amountCount,x.costAmount,x.profit
|
|
x.amountCount,x.costAmount,x.profit
|
|
|
from (select dep.province, ad.department_id,bp.cid ,
|
|
from (select dep.province, ad.department_id,bp.cid ,
|
|
|
<if test="status==1">
|
|
<if test="status==1">
|
|
|
sum(kcs.cq) kcs,sum(pds.cq)pds,sum(wcs.cq)wcs, sum(lxs.cq)lxs,sum(ccs.cq)ccs,sum(pds.cq)wtg,
|
|
sum(kcs.cq) kcs,sum(pds.cq)pds,sum(wcs.cq)wcs, sum(lxs.cq)lxs,sum(ccs.cq)ccs,sum(pds.cq)wtg,
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="status==2">
|
|
|
|
|
+ sum(tj.sls) sls,sum(tj.wjs)wjs,sum(tj.sqs)sqs, sum(tj.bhs)bhs,
|
|
|
|
|
+ </if>
|
|
|
sum(a.commodity_price)amountCount,sum(ttm.cost_amount)costAmount, (sum(a.commodity_price)-sum(ttm.cost_amount))profit
|
|
sum(a.commodity_price)amountCount,sum(ttm.cost_amount)costAmount, (sum(a.commodity_price)-sum(ttm.cost_amount))profit
|
|
|
from t_order_task a left join t_order_new b on a.order_no =b.order_no left join t_task_mid ttm on a.id=ttm.tid
|
|
from t_order_task a left join t_order_new b on a.order_no =b.order_no left join t_task_mid ttm on a.id=ttm.tid
|
|
|
left join department dep on b.order_dep =dep.id left join admin ad on a.task_receiver =ad.id
|
|
left join department dep on b.order_dep =dep.id left join admin ad on a.task_receiver =ad.id
|
|
@@ -1943,6 +1960,10 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
|
|
|
left join (select id,commodity_quantity cq from t_order_task where spot_check_status in (1,2))ccs on a.id=ccs.id
|
|
left join (select id,commodity_quantity cq from t_order_task where spot_check_status in (1,2))ccs on a.id=ccs.id
|
|
|
left join (select id,commodity_quantity cq from t_order_task where spot_check_status =1)wtg on a.id=wtg.id
|
|
left join (select id,commodity_quantity cq from t_order_task where spot_check_status =1)wtg on a.id=wtg.id
|
|
|
</if>
|
|
</if>
|
|
|
|
|
+ <if test="status==2">
|
|
|
|
|
+ left join (select tid ,accept_count sls,end_count wjs,authorize_count sqs,reject_count bhs from t_task_mid
|
|
|
|
|
+ where certificates_count > 0)tj on a.id=tj.tid
|
|
|
|
|
+ </if>
|
|
|
where b.order_dep is not null and a.split_status in(0,2) and a.task_status in (1,2,3)
|
|
where b.order_dep is not null and a.split_status in(0,2) and a.task_status in (1,2,3)
|
|
|
<if test="startDate != null and endDate != null">
|
|
<if test="startDate != null and endDate != null">
|
|
|
and a.task_distribution_time between #{startDate} and #{endDate}
|
|
and a.task_distribution_time between #{startDate} and #{endDate}
|