|
@@ -81,7 +81,8 @@
|
|
|
u3.NAME AS pricingStaffName,
|
|
|
u4.name as handlerName,
|
|
|
u4.id as handlerId,
|
|
|
- p.created
|
|
|
+ p.created,
|
|
|
+ c.comments
|
|
|
FROM
|
|
|
work_flow_node_instance wf
|
|
|
LEFT JOIN work_node wn ON wn.id = wf.node_id
|
|
@@ -96,15 +97,20 @@
|
|
|
LEFT JOIN user u1 ON u1.id = p.outward_staff
|
|
|
LEFT JOIN user u2 ON u2.id = p.inward_staff
|
|
|
LEFT JOIN user u3 ON u3.id = p.pricing_staff
|
|
|
+ left join (
|
|
|
+ select business_id,comments from work_flow_log where concat(business_id,created) in (
|
|
|
+ select concat(business_id,max(created)) from work_flow_log where business_type = 'PERSONAL_BUSINESS' and comments is not null group BY business_id
|
|
|
+ )
|
|
|
+ ) c on p.id = c.business_id
|
|
|
+ WHERE
|
|
|
+ wf.business_type = "PERSONAL_BUSINESS"
|
|
|
+ AND wf.state = 'PENDING'
|
|
|
+ AND wf.deleted = 0
|
|
|
+ AND wn.deleted = 0
|
|
|
+ AND p.deleted = 0
|
|
|
</sql>
|
|
|
<select id="xSelectPage" parameterType="com.dayou.vo.PersonalVO" resultType="com.dayou.vo.PersonalVO">
|
|
|
<include refid="Common_query_sql" />
|
|
|
- WHERE
|
|
|
- wf.business_type = "PERSONAL_BUSINESS"
|
|
|
- AND wf.state = 'PENDING'
|
|
|
- AND wf.deleted = 0
|
|
|
- AND wn.deleted = 0
|
|
|
- AND p.deleted = 0
|
|
|
<if test="keyword!=null and keyword!='' ">
|
|
|
and (
|
|
|
p.location like concat ('%',#{keyword},'%')
|