|
@@ -20,7 +20,8 @@
|
|
a.status AS "status",
|
|
a.status AS "status",
|
|
a.kind AS "kind",
|
|
a.kind AS "kind",
|
|
a.officeId AS "officeId",
|
|
a.officeId AS "officeId",
|
|
- count(a.content) AS "countNum"
|
|
|
|
|
|
+ a.exigency as "exigency",
|
|
|
|
+ a.repetition_count as "repetitionCount"
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
@@ -66,6 +67,14 @@
|
|
WHERE a.title = #{title}
|
|
WHERE a.title = #{title}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="getByTitleAndUnread" resultType="WorkProjectNotify" >
|
|
|
|
+ SELECT
|
|
|
|
+ <include refid="workProjectNotifyColumns"/>
|
|
|
|
+ FROM work_project_notify a
|
|
|
|
+ <include refid="workProjectNotifyJoins"/>
|
|
|
|
+ WHERE a.title = #{title} and a.notify_user = #{userId} and a.status = 0 order by update_date desc limit 1
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<select id="getByNotifyIdAndNotifyUser" resultType="WorkProjectNotify">
|
|
<select id="getByNotifyIdAndNotifyUser" resultType="WorkProjectNotify">
|
|
SELECT <include refid="workProjectNotifyColumns"/>
|
|
SELECT <include refid="workProjectNotifyColumns"/>
|
|
FROM work_project_notify a
|
|
FROM work_project_notify a
|
|
@@ -76,8 +85,6 @@
|
|
<select id="findList" resultType="WorkProjectNotify" >
|
|
<select id="findList" resultType="WorkProjectNotify" >
|
|
SELECT
|
|
SELECT
|
|
<include refid="workProjectNotifyColumns"/>
|
|
<include refid="workProjectNotifyColumns"/>
|
|
- ,COUNT(*),a.title
|
|
|
|
- -- ,distinct a.title
|
|
|
|
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 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
|
|
@@ -144,13 +151,7 @@
|
|
</choose>
|
|
</choose>
|
|
</where>
|
|
</where>
|
|
|
|
|
|
- <if test="remarks !=null and remarks != '' and remarks == '待审批'">
|
|
|
|
- GROUP BY a.content
|
|
|
|
- </if>
|
|
|
|
- <if test="remarks !=null and remarks != '' and remarks == '待通知'">
|
|
|
|
- GROUP BY a.title
|
|
|
|
- </if>
|
|
|
|
- ORDER BY a.update_date DESC
|
|
|
|
|
|
+ ORDER BY a.exigency desc, a.update_date 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}
|
|
@@ -168,13 +169,7 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryCount" resultType="Integer">
|
|
<select id="queryCount" resultType="Integer">
|
|
- SELECT
|
|
|
|
- <if test="remarks !=null and remarks != '' and remarks == '待审批'">
|
|
|
|
- count(distinct a.content)
|
|
|
|
- </if>
|
|
|
|
- <if test="remarks !=null and remarks != '' and remarks == '待通知'">
|
|
|
|
- count(distinct a.title)
|
|
|
|
- </if>
|
|
|
|
|
|
+ SELECT count(1)
|
|
FROM work_project_notify a
|
|
FROM work_project_notify a
|
|
LEFT JOIN sys_user u ON u.id = a.create_by
|
|
LEFT JOIN sys_user u ON u.id = a.create_by
|
|
LEFT JOIN sys_user su ON su.id = a.create_by
|
|
LEFT JOIN sys_user su ON su.id = a.create_by
|
|
@@ -371,6 +366,12 @@
|
|
status,
|
|
status,
|
|
kind,
|
|
kind,
|
|
officeId
|
|
officeId
|
|
|
|
+ <if test="exigency != null and exigency != ''">
|
|
|
|
+ ,exigency
|
|
|
|
+ </if>
|
|
|
|
+ <if test="repetitionCount != null and repetitionCount != ''">
|
|
|
|
+ ,repetition_count
|
|
|
|
+ </if>
|
|
) VALUES (
|
|
) VALUES (
|
|
#{id},
|
|
#{id},
|
|
#{createBy.id},
|
|
#{createBy.id},
|
|
@@ -389,6 +390,12 @@
|
|
#{status},
|
|
#{status},
|
|
#{kind},
|
|
#{kind},
|
|
#{officeId}
|
|
#{officeId}
|
|
|
|
+ <if test="exigency != null and exigency != ''">
|
|
|
|
+ ,#{exigency}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="repetitionCount != null and repetitionCount != ''">
|
|
|
|
+ ,#{repetitionCount}
|
|
|
|
+ </if>
|
|
)
|
|
)
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
@@ -412,6 +419,12 @@
|
|
<if test="processInstanceId != null and processInstanceId != ''">
|
|
<if test="processInstanceId != null and processInstanceId != ''">
|
|
,process_instance_id = #{processInstanceId}
|
|
,process_instance_id = #{processInstanceId}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="exigency != null and exigency != ''">
|
|
|
|
+ ,exigency = #{exigency}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="repetitionCount != null and repetitionCount != ''">
|
|
|
|
+ ,repetition_count = #{repetitionCount}
|
|
|
|
+ </if>
|
|
WHERE id = #{id}
|
|
WHERE id = #{id}
|
|
</update>
|
|
</update>
|
|
<update id="updateReadStateByNotifyIdAndNotifyUser">
|
|
<update id="updateReadStateByNotifyIdAndNotifyUser">
|
|
@@ -438,6 +451,14 @@
|
|
WHERE notify_user = #{user.id}
|
|
WHERE notify_user = #{user.id}
|
|
AND notify_role = #{notifyRole}
|
|
AND notify_role = #{notifyRole}
|
|
</update>
|
|
</update>
|
|
|
|
+ <update id="updateOverDueInfo">
|
|
|
|
+ UPDATE work_project_notify SET
|
|
|
|
+ update_by = #{updateBy.id},
|
|
|
|
+ update_date = #{updateDate},
|
|
|
|
+ exigency = #{exigency},
|
|
|
|
+ repetition_count = repetition_count+1
|
|
|
|
+ WHERE id = #{id}
|
|
|
|
+ </update>
|
|
|
|
|
|
|
|
|
|
<update id="updateDelflagByNotifyId">
|
|
<update id="updateDelflagByNotifyId">
|
|
@@ -528,15 +549,10 @@
|
|
<if test="endDate != null and endDate != ''">
|
|
<if test="endDate != null and endDate != ''">
|
|
AND a.create_date <= #{endDate}
|
|
AND a.create_date <= #{endDate}
|
|
</if>
|
|
</if>
|
|
- and a.create_by is not null
|
|
|
|
-
|
|
|
|
- and a.process_instance_id in( select process_instance_id from work_activity_process
|
|
|
|
- where process_instance_id in(select process_id from work_activity_process_user where user_id = #{user.id} and type=1)
|
|
|
|
- and del_flag = 0 and (remarks !='[强制撤销]' or remarks is null) and is_approval != 0
|
|
|
|
- group by process_instance_id)
|
|
|
|
|
|
+ and a.create_by =#{createBy.id}
|
|
|
|
+ and a.remarks != '[强制撤销]' and a.remarks != '待通知'
|
|
|
|
|
|
</where>
|
|
</where>
|
|
- group by a.content
|
|
|
|
<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}
|
|
@@ -592,20 +608,10 @@
|
|
<if test="endDate != null and endDate != ''">
|
|
<if test="endDate != null and endDate != ''">
|
|
AND a.create_date <= #{endDate}
|
|
AND a.create_date <= #{endDate}
|
|
</if>
|
|
</if>
|
|
- and a.create_by is not null
|
|
|
|
- and a.process_instance_id in( select process_instance_id from work_activity_process
|
|
|
|
- where process_instance_id in(select process_id from work_activity_process_user where user_id = #{user.id} and type=1)
|
|
|
|
- and del_flag = 0 and (remarks !='[强制撤销]' or remarks is null) and is_approval != 0
|
|
|
|
- group by process_instance_id)
|
|
|
|
|
|
+
|
|
|
|
+ and a.create_by =#{createBy.id}
|
|
|
|
+ and a.remarks != '[强制撤销]' and a.remarks != '待通知'
|
|
</where>
|
|
</where>
|
|
- <choose>
|
|
|
|
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
|
|
|
- ORDER BY ${page.orderBy}
|
|
|
|
- </when>
|
|
|
|
- <otherwise>
|
|
|
|
- ORDER BY a.create_date DESC
|
|
|
|
- </otherwise>
|
|
|
|
- </choose>
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<delete id="deleteActivityProcess">
|
|
<delete id="deleteActivityProcess">
|
|
@@ -662,6 +668,7 @@
|
|
<if test="endDate != null and endDate != ''">
|
|
<if test="endDate != null and endDate != ''">
|
|
AND a.create_date <= #{endDate}
|
|
AND a.create_date <= #{endDate}
|
|
</if>
|
|
</if>
|
|
|
|
+ and remarks = '待审批'
|
|
</where>
|
|
</where>
|
|
group by a.notify_id
|
|
group by a.notify_id
|
|
<choose>
|
|
<choose>
|
|
@@ -712,6 +719,7 @@
|
|
<if test="endDate != null and endDate != ''">
|
|
<if test="endDate != null and endDate != ''">
|
|
AND a.create_date <= #{endDate}
|
|
AND a.create_date <= #{endDate}
|
|
</if>
|
|
</if>
|
|
|
|
+ and remarks = '待审批'
|
|
</where>
|
|
</where>
|
|
group by a.notify_id
|
|
group by a.notify_id
|
|
<choose>
|
|
<choose>
|