|
@@ -182,7 +182,7 @@
|
|
|
wf.id,
|
|
|
u.name AS handler,
|
|
|
wf.handler_id,
|
|
|
- wf.state,
|
|
|
+ (case wf.state when 'PASS' then '提交' when 'REVERSE' then '退回' when 'TERMINATE' then '终止' else '-' end) as state,
|
|
|
wf.handing_time as handingTimeLong,
|
|
|
wf.comments,
|
|
|
wf.business_type,
|
|
@@ -197,7 +197,7 @@
|
|
|
(select name from major_production where deleted = 0 and report_no= (ifnull(wf.business_min_id,wf.business_sub_id))) as productionName
|
|
|
FROM
|
|
|
(
|
|
|
- ( SELECT * FROM work_flow_log WHERE handler_id = #{todoVO.handlerId} ) wf
|
|
|
+ ( SELECT * FROM work_flow_log WHERE handler_id = #{todoVO.handlerId} and business_type='MAJOR_BUSINESS' ) wf
|
|
|
LEFT JOIN ( SELECT id, node_id, business_id ,state FROM work_flow_node_instance ) wfni ON wf.instance_id = wfni.id
|
|
|
LEFT JOIN ( SELECT id, NAME FROM work_node WHERE deleted = 0 ) wn ON wn.id = wfni.node_id
|
|
|
LEFT JOIN ( SELECT id, order_id, NAME FROM major WHERE deleted = 0 ) m ON m.id = wf.business_id
|
|
@@ -304,4 +304,62 @@
|
|
|
AND wtr.deleted = 0
|
|
|
</select>
|
|
|
|
|
|
+ <select id="personalTaskDonePage" parameterType="com.dayou.vo.PersonalTaskDoneVO" resultType="com.dayou.vo.PersonalTaskDoneVO">
|
|
|
+ SELECT
|
|
|
+ wf.id,
|
|
|
+ u.name AS handler,
|
|
|
+ wf.handler_id,
|
|
|
+ (case wf.state when 'PASS' then '提交' when 'REVERSE' then '退回' when 'TERMINATE' then '终止' else '-' end) as state,
|
|
|
+ wf.handing_time as handingTimeLong,
|
|
|
+ wf.comments,
|
|
|
+ wf.business_type,
|
|
|
+ p.id AS personalId,
|
|
|
+ p.order_id,
|
|
|
+ p.location,
|
|
|
+ p.clientName,
|
|
|
+ p.clientSubName,
|
|
|
+ p.bailorA,
|
|
|
+ p.bailorB,
|
|
|
+ wn.name AS nodeName,
|
|
|
+ wf.created as finishTime,
|
|
|
+ ifnull(wf.business_min_id,wf.business_sub_id) as reportNo,
|
|
|
+ wfni.state as instanceState,
|
|
|
+ wfni.id as instanceId
|
|
|
+
|
|
|
+ FROM
|
|
|
+ (
|
|
|
+ ( SELECT * FROM work_flow_log WHERE handler_id = #{todoVO.handlerId} and business_type='PERSONAL_BUSINESS' ) wf
|
|
|
+ LEFT JOIN ( SELECT id, node_id, business_id ,state FROM work_flow_node_instance ) wfni ON wf.instance_id = wfni.id
|
|
|
+ LEFT JOIN ( SELECT id, name FROM work_node WHERE deleted = 0 ) wn ON wn.id = wfni.node_id
|
|
|
+ LEFT JOIN ( SELECT p.id, p.order_id, p.location,cc.name as clientName,cc1.name as clientSubName,p.bailorA,p.bailorB FROM personal p left join customer_company cc on cc.id =
|
|
|
+ p.clientele_id left join customer_company cc1 on cc1.id = p.clientele_sub_id
|
|
|
+ WHERE p.deleted = 0) p ON p.id = wf.business_id
|
|
|
+ LEFT JOIN user u ON u.id = wf.handler_id
|
|
|
+ )
|
|
|
+ <where>
|
|
|
+ <if test="keyword!=null and keyword!='' ">
|
|
|
+ and (
|
|
|
+ p.location like concat ('%',#{keyword},'%')
|
|
|
+ or p.order_id like concat('%',#{keyword},'%')
|
|
|
+ or p.clientName like concat('%',#{keyword},'%')
|
|
|
+ or p.clientSubName like concat('%',#{keyword},'%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ <if test="todoVO!=null and todoVO.nodeName!=null and todoVO.nodeName!='' ">
|
|
|
+ and wn.name = #{todoVO.nodeName}
|
|
|
+ </if>
|
|
|
+ <if test="todoVO!=null and todoVO.state!=null and todoVO.state!='' ">
|
|
|
+ and wf.state = #{todoVO.state}
|
|
|
+ </if>
|
|
|
+ <if test="todoVO!=null and todoVO.startDate!=null and todoVO.startDate!=''">
|
|
|
+ and wf.created >= #{todoVO.startDate}
|
|
|
+ </if>
|
|
|
+ <if test="todoVO!=null and todoVO.endDate!=null and todoVO.endDate!=''">
|
|
|
+ and wf.created <= #{todoVO.endDate}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ ORDER BY
|
|
|
+ wf.created DESC
|
|
|
+ </select>
|
|
|
+
|
|
|
</mapper>
|