|
|
@@ -1038,15 +1038,16 @@
|
|
|
|
|
|
|
|
|
<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 ,ifnull(k.hours,0) hours,a.split_status splitStatus
|
|
|
+ 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 ,
|
|
|
+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
|
|
|
- on a.id=l.tid where e.delete_sign !=1 and e.order_status not in (5,7)
|
|
|
+ on a.id=l.tid where e.delete_sign !=1 and e.order_status not in (5,7)
|
|
|
and a.outsource= #{outsource,jdbcType=INTEGER}
|
|
|
and a.task_receiver= #{aid,jdbcType=VARCHAR}
|
|
|
<if test="specially == 0 ">
|
|
|
@@ -1086,7 +1087,7 @@
|
|
|
and a.order_no= #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="taskId != null">
|
|
|
- and a.id= #{taskId,jdbcType=VARCHAR}
|
|
|
+ and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
|
|
|
</if>
|
|
|
<if test="taskStatus != null">
|
|
|
and a.task_status= #{taskStatus,jdbcType=INTEGER}
|
|
|
@@ -1142,7 +1143,7 @@
|
|
|
and a.order_no= #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="taskId != null">
|
|
|
- and a.id= #{taskId,jdbcType=VARCHAR}
|
|
|
+ and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
|
|
|
</if>
|
|
|
<if test="taskStatus != null">
|
|
|
and a.task_status= #{taskStatus,jdbcType=INTEGER}
|
|
|
@@ -1258,15 +1259,13 @@ from t_order_task a left join business_project b on a.commodity_id=b.id left joi
|
|
|
<select id="selectTaskListByPage" 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,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
|
|
|
- a.commodity_quantity as commodityQuantity,f.nickname as userName,h.name as depName,ifnull(i.alreadyNumber,0)as alreadyNumber
|
|
|
+ a.commodity_quantity as commodityQuantity,f.nickname as userName,h.name as depName,ifnull(i.alreadyNumber,0)as alreadyNumber,
|
|
|
+ a.split_status splitStatus,a.split_super splitSuper, a.split_id splitId
|
|
|
from (select task_id from t_task_log a where task_receiver=#{aid ,jdbcType=VARCHAR} UNION select task_id from t_task_log a
|
|
|
where task_allocator=#{aid ,jdbcType=VARCHAR}) x left join t_order_task a on x.task_id=a.id
|
|
|
- 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 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
|
|
|
where e.delete_sign !=1
|
|
|
<if test="orderNo != null">
|
|
|
@@ -1282,7 +1281,7 @@ from t_order_task a left join business_project b on a.commodity_id=b.id left joi
|
|
|
and e.order_dep= #{depId ,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="taskId != null">
|
|
|
- and a.id= #{taskId,jdbcType=VARCHAR}
|
|
|
+ and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
|
|
|
</if>
|
|
|
<if test="taskStatus != null">
|
|
|
and a.task_status= #{taskStatus,jdbcType=INTEGER}
|
|
|
@@ -1321,7 +1320,7 @@ from t_order_task a left join business_project b on a.commodity_id=b.id left joi
|
|
|
and a.order_no= #{orderNo,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="taskId != null">
|
|
|
- and a.id= #{taskId,jdbcType=VARCHAR}
|
|
|
+ and (a.id= #{taskId,jdbcType=VARCHAR} or a.split_super= #{taskId,jdbcType=VARCHAR})
|
|
|
</if>
|
|
|
<if test="taskStatus != null">
|
|
|
and a.task_status= #{taskStatus,jdbcType=INTEGER}
|
|
|
@@ -1383,10 +1382,13 @@ from t_order_task a left join business_project b on a.commodity_id=b.id left joi
|
|
|
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}
|
|
|
+ and a.outsource= 0 and split_status =2 and a.split_super= #{tid} order by split_id
|
|
|
</select>
|
|
|
<select id="selectByidGetCname" resultType="java.lang.String">
|
|
|
select b.cname from business_project a left join business_category b on a.cid =b.id
|
|
|
where a.id= #{pid}
|
|
|
</select>
|
|
|
+ <update id="updateByOutsourceToOrderNo" >
|
|
|
+ update t_order_task set outsource= #{type} where order_no= #{orderNo}
|
|
|
+ </update>
|
|
|
</mapper>
|