|
@@ -5,7 +5,6 @@
|
|
<sql id="workProjectNotifyColumns">
|
|
<sql id="workProjectNotifyColumns">
|
|
a.id AS "id",
|
|
a.id AS "id",
|
|
a.create_by AS "createBy.id",
|
|
a.create_by AS "createBy.id",
|
|
- a.create_by AS "createById",
|
|
|
|
a.create_date AS "createDate",
|
|
a.create_date AS "createDate",
|
|
a.update_by AS "updateBy.id",
|
|
a.update_by AS "updateBy.id",
|
|
a.update_date AS "updateDate",
|
|
a.update_date AS "updateDate",
|
|
@@ -86,7 +85,7 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findList" resultType="WorkProjectNotify" >
|
|
<select id="findList" resultType="WorkProjectNotify" >
|
|
- select * from (
|
|
|
|
|
|
+
|
|
SELECT
|
|
SELECT
|
|
<include refid="workProjectNotifyColumns"/>
|
|
<include refid="workProjectNotifyColumns"/>
|
|
,a.wap_begin_date AS "wapCreateDate"
|
|
,a.wap_begin_date AS "wapCreateDate"
|
|
@@ -152,6 +151,10 @@
|
|
AND a.wap_begin_date <= #{endBeginDate}
|
|
AND a.wap_begin_date <= #{endBeginDate}
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
+ <if test="(createUserId != null and createUserId != '') or (createUserName != null and createUserName != '')">
|
|
|
|
+ AND (a.create_by = #{createUserId} or su.name like concat('%',#{createUserName},'%'))
|
|
|
|
+ </if>
|
|
|
|
+
|
|
<choose>
|
|
<choose>
|
|
<when test="status !=null and status != '' and status == '-1'">
|
|
<when test="status !=null and status != '' and status == '-1'">
|
|
</when>
|
|
</when>
|
|
@@ -187,14 +190,7 @@
|
|
,a.create_date DESC,a.id
|
|
,a.create_date DESC,a.id
|
|
</otherwise>-->
|
|
</otherwise>-->
|
|
</choose>
|
|
</choose>
|
|
- ) z
|
|
|
|
|
|
|
|
- LEFT JOIN sys_user zu ON zu.id = z.initiator
|
|
|
|
- <where>
|
|
|
|
- <if test="(createUserId != null and createUserId != '') or (createUserName != null and createUserName != '')">
|
|
|
|
- AND (z.createById = #{createUserId} or zu.name like concat('%',#{createUserName},'%'))
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -312,25 +308,10 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryCount" resultType="Integer">
|
|
<select id="queryCount" resultType="Integer">
|
|
- select count(*) from (
|
|
|
|
- SELECT
|
|
|
|
- <include refid="workProjectNotifyColumns"/>
|
|
|
|
- ,a.wap_begin_date AS "wapCreateDate"
|
|
|
|
- ,(select user.id from work_activity_process wap left join sys_user user on wap.create_by = user.id where wap.count != 0 and wap.process_instance_id in (select waps.process_instance_id
|
|
|
|
- FROM work_project_notify waps
|
|
|
|
- WHERE waps.notify_id = a.notify_id and waps.process_instance_id is not null order by waps.notify_id desc
|
|
|
|
- ) and wap.is_approval = '0' order by wap.create_date asc, wap.count asc limit 1) as 'initiator'
|
|
|
|
- /*,(select p.user_id from work_activity_process wap
|
|
|
|
- left join work_activity_process_user p on wap.process_instance_id = p.process_id and p.count = wap.count
|
|
|
|
- left join sys_user u on u.id = p.user_id
|
|
|
|
- where (case when a.process_instance_id is null then wap.process_instance_id = (select waps.process_instance_id
|
|
|
|
- FROM work_project_notify waps
|
|
|
|
- WHERE waps.notify_id = a.notify_id and waps.process_instance_id is not null order by waps.notify_id desc
|
|
|
|
- LIMIT 1) else wap.process_instance_id = a.process_instance_id end) and wap.is_approval = '0' order by wap.count asc limit 1) as 'auditor'*/
|
|
|
|
|
|
+ SELECT count(1)
|
|
FROM work_project_notify a
|
|
FROM work_project_notify a
|
|
- left join sys_user su on a.create_by = su.id
|
|
|
|
LEFT JOIN sys_user u ON u.id = a.create_by
|
|
LEFT JOIN sys_user u ON u.id = a.create_by
|
|
- <include refid="workProjectNotifyJoins"/>
|
|
|
|
|
|
+ LEFT JOIN sys_user su ON su.id = a.create_by
|
|
<where>
|
|
<where>
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
a.del_flag = #{DEL_FLAG_NORMAL}
|
|
<if test="title != null and title != ''">
|
|
<if test="title != null and title != ''">
|
|
@@ -378,6 +359,9 @@
|
|
AND a.wap_begin_date <= #{endBeginDate}
|
|
AND a.wap_begin_date <= #{endBeginDate}
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
+ <if test="(createUserId != null and createUserId != '') or (createUserName != null and createUserName != '')">
|
|
|
|
+ AND (a.create_by = #{createUserId} or su.name like concat('%',#{createUserName},'%'))
|
|
|
|
+ </if>
|
|
<choose>
|
|
<choose>
|
|
<when test="status !=null and status != '' and status == '-1'">
|
|
<when test="status !=null and status != '' and status == '-1'">
|
|
</when>
|
|
</when>
|
|
@@ -397,30 +381,14 @@
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
</where>
|
|
</where>
|
|
-
|
|
|
|
- ORDER BY a.update_date DESC, a.exigency desc
|
|
|
|
<choose>
|
|
<choose>
|
|
- <!--<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
|
|
|
+ <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
ORDER BY ${page.orderBy}
|
|
ORDER BY ${page.orderBy}
|
|
</when>
|
|
</when>
|
|
<otherwise>
|
|
<otherwise>
|
|
- ORDER BY a.create_date DESC,a.id
|
|
|
|
- </otherwise>-->
|
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
|
- ,${page.orderBy}
|
|
|
|
- </when>
|
|
|
|
- <!--<otherwise>
|
|
|
|
- ,a.create_date DESC,a.id
|
|
|
|
- </otherwise>-->
|
|
|
|
|
|
+ ORDER BY a.create_date DESC
|
|
|
|
+ </otherwise>
|
|
</choose>
|
|
</choose>
|
|
- ) z
|
|
|
|
-
|
|
|
|
- LEFT JOIN sys_user zu ON zu.id = z.initiator
|
|
|
|
- <where>
|
|
|
|
- <if test="(createUserId != null and createUserId != '') or (createUserName != null and createUserName != '')">
|
|
|
|
- AND (z.createById = #{createUserId} or zu.name like concat('%',#{createUserName},'%'))
|
|
|
|
- </if>
|
|
|
|
- </where>
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="findListByAPP" resultType="WorkProjectNotify" >
|
|
<select id="findListByAPP" resultType="WorkProjectNotify" >
|