|
|
@@ -1088,16 +1088,23 @@
|
|
|
<select id="selectOrderTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
|
|
|
select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.project_status as projectStatus,e.contract_no contractNo,
|
|
|
a.task_receiver taskReceiver,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate, a.commodity_quantity as commodityQuantity,
|
|
|
-e.approval,l.refund_status outsourceStatus,ifnull(i.alreadyNumber,0) as alreadyNumber,f.nickname as userName,h.name as depName, j.name as outsourceName ,
|
|
|
+e.approval,l.refund_status outsourceStatus,ifnull(i.alreadyNumber,0) as alreadyNumber,f.nickname as userName,h.name as depName, l.company_name as outsourceName ,
|
|
|
ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.split_id splitId
|
|
|
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 user f on e.buyer_id=f.id
|
|
|
left join department h on e.order_dep=h.id left join (select task_id , sum(already_number) as alreadyNumber from task_progress
|
|
|
- group by task_id) i on a.id=i.task_id left join (select order_no,max(name)as name from outsource_organization group by order_no) j
|
|
|
- on a.order_no=j.order_no left join task_hours_count k on a.id=k.tid and a.task_receiver=k.aid left join t_order_outsource l
|
|
|
+ group by task_id) i on a.id=i.task_id left join task_hours_count k on a.id=k.tid and a.task_receiver=k.aid left join t_order_outsource l
|
|
|
on a.id=l.tid where e.delete_sign !=1 and e.order_status not in (5,7)
|
|
|
and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
+ <if test="role == 0 ">
|
|
|
and a.task_receiver= #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="role ==1 and fids != null and fids.size() > 0">
|
|
|
+ and e.finance_id in
|
|
|
+ <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="specially == 0 ">
|
|
|
and a.split_status !=1
|
|
|
</if>
|
|
|
@@ -1153,7 +1160,15 @@ ifnull(k.hours,0) hours,a.split_status splitStatus,a.split_super splitSuper, a.s
|
|
|
select count(*) from t_order_task a 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 g on e.salesman_id=g.id left join department h on g.department_id=h.id where e.delete_sign !=1 and e.order_status not in (5,7)
|
|
|
and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
+ <if test="role == 0 ">
|
|
|
and a.task_receiver= #{aid,jdbcType=VARCHAR}
|
|
|
+ </if>
|
|
|
+ <if test="role ==1 and fids != null and fids.size() > 0">
|
|
|
+ and e.finance_id in
|
|
|
+ <foreach close=")" collection="fids" index="" item="item" open="(" separator=",">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
<if test="specially == 0 ">
|
|
|
and a.split_status !=1
|
|
|
</if>
|
|
|
@@ -1223,14 +1238,14 @@ select
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTaskHoursListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
|
|
|
- select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,dep.name as depName,a.project_status projectStatus,
|
|
|
+ select a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,a.receiver_name as receiverName,dep.name as depName,a.project_status projectStatus,
|
|
|
a.task_status as taskStatus,f.nickname as userName,ifnull(g.hours,0) as hours,a.commodity_quantity as commodityQuantity,a.commodity_price commodityPrice,
|
|
|
e.contract_no as contractNo,date_format(e.create_time,'%Y-%m-%d %H:%i:%S')as creteTime,date_format(e.sign_time,'%Y-%m-%d')as signTime,a.outsource,
|
|
|
date_format(a.task_distribution_time,'%Y-%m-%d %H:%i:%S')taskDistributionTime, date_format(a.task_end_time,'%Y-%m-%d')taskEndTime,tm.salesman_name salesmanName,
|
|
|
a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId
|
|
|
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 department dep on e.order_dep=dep.id
|
|
|
- left join user f on e.buyer_id=f.id left join (select task_id,sum(hours) as hours from t_task_hours group by task_id) g on a.id=g.task_id
|
|
|
+ left join t_order_new e on a.order_no=e.order_no left join department dep on e.order_dep=dep.id
|
|
|
+ left join user f on e.buyer_id=f.id left join (select tid,sum(hours)hours from task_hours_count group by tid) g on a.id=g.tid
|
|
|
left join t_order_mid tm on a.order_no=tm.order_no where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
|
|
|
<if test="shiroType == 1 and aid !=null">
|
|
|
and tm.finance_id= #{aid,jdbcType=VARCHAR}
|
|
|
@@ -1269,9 +1284,9 @@ select
|
|
|
</select>
|
|
|
|
|
|
<select id="selectTaskHoursListCount" resultType="java.lang.Integer">
|
|
|
- select count(*) 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 user f on e.buyer_id=f.id
|
|
|
- left join t_order_mid tm on a.order_no=tm.order_no where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
|
|
|
+ select count(*) 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 t_order_new e on a.order_no=e.order_no left join user f on e.buyer_id=f.id left join t_order_mid tm on a.order_no=tm.order_no
|
|
|
+ where e.delete_sign =0 and a.super_id is null and a.split_status in(0,2)
|
|
|
<if test="shiroType == 1 and aid !=null">
|
|
|
and tm.finance_id= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|