|
|
@@ -1013,30 +1013,28 @@
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<select id="selectOrderTask" resultType="com.goafanti.order.bo.TOrderTaskBo">
|
|
|
- select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,a.outsource_name outsourceName,a.outsource,
|
|
|
+ select a.id,e.contract_no contractNo,a.order_no as orderNo,h.nickname userName,f.name salesmanName,a.outsource_name outsourceName,a.outsource,
|
|
|
a.outsource_price outsourcePrice,g.name depName,e.order_status orderStatus,d.name as contacts,d.contact_mobile as contactsMobile,a.main, c.cname,
|
|
|
c.sort cSort,a.commodity_name as commodityName,a.commodity_quantity as commodityQuantity,i.price,a.certificate_number as certificateNumber,
|
|
|
a.commodity_id as commodityId,a.manager_id managerId,a.consultant_id consultantId,a.project_status as projectStatus,a.set_up_amount setUpAmount,
|
|
|
- a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus, a.task_receiver as taskReceiver
|
|
|
+ a.task_comment as taskComment ,a.commodity_price as commodityPrice, a.task_status as taskStatus, a.task_receiver as taskReceiver ,a.split_status splitStatus
|
|
|
from t_order_task a left join business_project b on a.commodity_id=b.id left join t_order_new e on a.order_no=e.order_no
|
|
|
left join admin f on e.salesman_id=f.id left join department g on e.order_dep=g.id left join user h on e.buyer_id=h.id
|
|
|
- left join business_project i on a.commodity_id=i.id
|
|
|
- left join business_category c on b.cid=c.id left join admin d on a.task_receiver=d.id
|
|
|
- where a.super_id is null and a.order_no= #{orderNo,jdbcType=VARCHAR} order by a.id
|
|
|
-
|
|
|
+ left join business_project i on a.commodity_id=i.id left join business_category c on b.cid=c.id left join admin d on a.task_receiver=d.id
|
|
|
+ where a.super_id is null and a.split_status !=2 and a.order_no= #{orderNo,jdbcType=VARCHAR} order by a.id
|
|
|
</select>
|
|
|
|
|
|
|
|
|
<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,
|
|
|
+ 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_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 ,ifnull(k.hours,0) hours
|
|
|
+ ifnull(i.alreadyNumber,0) as alreadyNumber,f.nickname as userName,h.name as depName, j.name as outsourceName ,ifnull(k.hours,0) hours,a.split_status splitStatus
|
|
|
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
|
|
|
- on a.id=l.tid where e.delete_sign !=1 and e.order_status not in (5,7) and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
+ on a.id=l.tid where e.delete_sign !=1 and e.order_status not in (5,7) and a.split_status !=2 and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
<if test="specially == 0 or specially == 1">
|
|
|
and a.task_receiver= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1086,13 +1084,9 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectOrderTaskListCount" resultType="java.lang.Integer">
|
|
|
- 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)
|
|
|
+ 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.split_status !=2
|
|
|
and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
<if test="specially == 0 or specially == 1">
|
|
|
and a.task_receiver= #{aid,jdbcType=VARCHAR}
|
|
|
@@ -1168,7 +1162,7 @@ from t_order_task a left join business_project b on a.commodity_id=b.id left joi
|
|
|
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_mid tm on a.order_no=tm.order_no where e.delete_sign !=1 and a.super_id is null
|
|
|
+ left join t_order_mid tm on a.order_no=tm.order_no where e.delete_sign !=1 and a.super_id is null and a.split_status !=1
|
|
|
<if test="shiroType == 1 and aid !=null">
|
|
|
and tm.finance_id= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1206,10 +1200,9 @@ from t_order_task a left join business_project b on a.commodity_id=b.id left joi
|
|
|
</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 !=1 and a.super_id is null
|
|
|
+ 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 !=1 and a.super_id is null and a.split_status !=1
|
|
|
<if test="shiroType == 1 and aid !=null">
|
|
|
and tm.finance_id= #{aid,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
@@ -1357,6 +1350,19 @@ from t_order_task a left join business_project b on a.commodity_id=b.id left joi
|
|
|
<if test="type ==1">
|
|
|
manager_id
|
|
|
</if>
|
|
|
+ </select>
|
|
|
|
|
|
+ <select id="splitProjectList" 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_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 ,ifnull(k.hours,0) hours,a.split_status splitStatus,
|
|
|
+ a.split_super splitSuper,date_format(a.split_time,'%Y-%m-%d %H:%i:%S') splitTimes,ad.name splitAname
|
|
|
+ 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
|
|
|
+ on a.id=l.tid left join admin ad on ad.id=a.split_aid where e.delete_sign !=1 and e.order_status not in (5,7)
|
|
|
+ and a.outsource= 0 and split_status =2 and a.split_super= #{tid}
|
|
|
</select>
|
|
|
</mapper>
|