|
@@ -1805,4 +1805,92 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
|
|
|
b on a.business_project_id =b.commodity_id
|
|
b on a.business_project_id =b.commodity_id
|
|
|
where a.`type` =1 and a.aid = #{aid} and a.uid = #{uid}
|
|
where a.`type` =1 and a.aid = #{aid} and a.uid = #{uid}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectProjectStatisticsListByPage" resultType="com.goafanti.order.bo.OutProjectStatistics">
|
|
|
|
|
+ select a.task_distribution_time 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,
|
|
|
|
|
+ a.status projectStatus , 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.commodity_quantity commodityQuantity , a.commodity_price commodityPrice
|
|
|
|
|
+ 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
|
|
|
|
|
+ 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
|
|
|
|
|
+ where 1=1
|
|
|
|
|
+ <if test="startDate != null and endDate != null">
|
|
|
|
|
+ and a.task_distribution_time between #{startDate} and #{endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="depId !=null">
|
|
|
|
|
+ and b.order_dep = #{depId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="thchDepId !=null">
|
|
|
|
|
+ and td.id= #{thchDepId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="projectStatus !=null">
|
|
|
|
|
+ and bc.id= #{projectStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="projectType !=null">
|
|
|
|
|
+ and bp.type= #{projectType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderNo !=null">
|
|
|
|
|
+ and b.order_no = #{orderNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="contractNo !=null">
|
|
|
|
|
+ and b.contract_no = #{contractNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="userName !=null">
|
|
|
|
|
+ and e.buyer_name like concat( #{userName},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="declarationBatch !=null">
|
|
|
|
|
+ and a.declaration_batch = #{declarationBatch}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="projectSituation !=null">
|
|
|
|
|
+ and a.status = #{projectSituation}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amountStart !=null and amountEnd != null">
|
|
|
|
|
+ and a.commodity_price between #{amountStart} and #{amountEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="page_sql!=null">
|
|
|
|
|
+ ${page_sql}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
|
|
+ <select id="selectProjectStatisticsCount" resultType="java.lang.Integer">
|
|
|
|
|
+ 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
|
|
|
|
|
+ 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
|
|
|
|
|
+ where 1=1
|
|
|
|
|
+ <if test="startDate != null and endDate != null">
|
|
|
|
|
+ and a.task_distribution_time between #{startDate} and #{endDate}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="depId !=null">
|
|
|
|
|
+ and b.order_dep = #{depId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="thchDepId !=null">
|
|
|
|
|
+ and td.id= #{thchDepId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="projectStatus !=null">
|
|
|
|
|
+ and bc.id= #{projectStatus}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="projectType !=null">
|
|
|
|
|
+ and bp.type= #{projectType}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="orderNo !=null">
|
|
|
|
|
+ and b.order_no = #{orderNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="contractNo !=null">
|
|
|
|
|
+ and b.contract_no = #{contractNo}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="userName !=null">
|
|
|
|
|
+ and e.buyer_name like concat( #{userName},'%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="declarationBatch !=null">
|
|
|
|
|
+ and a.declaration_batch = #{declarationBatch}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="amountStart !=null and amountEnd != null">
|
|
|
|
|
+ and a.commodity_price between #{amountStart} and #{amountEnd}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </select>
|
|
|
|
|
+
|
|
|
</mapper>
|
|
</mapper>
|