@ -449,7 +449,8 @@
</select>
<!-- 查询系统管理员的系统列表 -->
<select id= "selectSysByAdmin" resultMap= "BaseResultMap" >
select power_notice.notice_id,a.sys_flag notice_type_flag,power_notice.notice_type_name,a.sys_name remark from (SELECT
select power_notice.notice_id,a.sys_flag notice_type_flag,power_notice.notice_type_name,a.sys_name remark from
(SELECT
sys_flag,
sys_name
FROM
@ -612,8 +613,10 @@
</if>
</select>
<select id= "selectNoticeListByParentId" resultMap= "BaseResultMap" >
select power_notice.notice_id, power_notice.notice_title, power_notice.notice_content,power_notice.parent_id,power_user.user_name
notice_send, power_notice.notice_date, if(power_notice.notice_receive='all','all',power_user1.user_name) notice_receive, power_notice.effective, power_notice.read_flag from power_notice
select power_notice.notice_id, power_notice.notice_title,
power_notice.notice_content,power_notice.parent_id,power_user.user_name
notice_send, power_notice.notice_date, if(power_notice.notice_receive='all','all',power_user1.user_name)
notice_receive, power_notice.effective, power_notice.read_flag from power_notice
left join power_user
on power_user.user_id = power_notice.notice_send
left join power_user power_user1
@ -629,7 +632,8 @@
AND notice_send in (select user_id from power_user where user_name LIKE '%${record.noticeSend}%')
</if>
<if test= "record.noticeReceive != null and record.noticeReceive != ''" >
AND (notice_receive in (select user_id from power_user where user_name LIKE '%${record.noticeReceive}%') OR notice_receive = 'all')
AND (notice_receive in (select user_id from power_user where user_name LIKE '%${record.noticeReceive}%') OR
notice_receive = 'all')
</if>
<if test= "record.noticeDateStart != null and record.noticeDateStart != ''" >
AND notice_date >= #{record.noticeDateStart}
@ -639,7 +643,9 @@
</if>
</select>
<select id= "selectALlByPower" resultMap= "BaseResultMap" >
select power_notice.notice_id,a.sys_flag notice_type_flag,power_notice.notice_type_name,notice_title,notice_content,parent_id,notice_send,notice_receive,notice_date,read_flag,effective from (SELECT
select power_notice.notice_id,a.sys_flag
notice_type_flag,power_notice.notice_type_name,notice_title,notice_content,parent_id,notice_send,notice_receive,notice_date,read_flag,effective
from (SELECT
sys_flag,
sys_name
FROM
@ -683,7 +689,11 @@
</if>
</where>
UNION ALL
(select power_notice.notice_id, power_notice.notice_type_flag,power_notice.notice_type_name,power_notice.notice_title, power_notice.notice_content,power_notice.parent_id,power_user.user_name notice_send, if(power_notice.notice_receive='all','all',power_user1.user_name) notice_receive, power_notice.notice_date, power_notice.read_flag,power_notice.effective from power_notice
(select power_notice.notice_id,
power_notice.notice_type_flag,power_notice.notice_type_name,power_notice.notice_title,
power_notice.notice_content,power_notice.parent_id,power_user.user_name notice_send,
if(power_notice.notice_receive='all','all',power_user1.user_name) notice_receive, power_notice.notice_date,
power_notice.read_flag,power_notice.effective from power_notice
left join power_user
on power_user.user_id = power_notice.notice_send
left join power_user power_user1
@ -699,7 +709,8 @@
AND notice_send in (select user_id from power_user where user_name LIKE '%${record.noticeSend}%')
</if>
<if test= "record.noticeReceive != null and record.noticeReceive != ''" >
AND (notice_receive in (select user_id from power_user where user_name LIKE '%${record.noticeReceive}%') OR notice_receive = 'all')
AND (notice_receive in (select user_id from power_user where user_name LIKE '%${record.noticeReceive}%') OR
notice_receive = 'all')
</if>
<if test= "record.noticeDateStart != null and record.noticeDateStart != ''" >
AND notice_date >= #{record.noticeDateStart}
@ -749,14 +760,19 @@
<if test= "record.noticeTypeFlag != null and record.noticeTypeFlag != ''" >
and power_notice.notice_type_flag = #{record.noticeTypeFlag}
</if>
</where> )
</where>
)
ORDER BY notice_type_flag desc,notice_date desc
<if test= "record.offset != null and record.limit != null" >
LIMIT #{record.offset},#{record.limit}
</if> )
</select>
<select id= "selectALlByPowerWithExport" resultMap= "BaseResultMap" >
select power_notice.notice_id, power_notice.notice_type_flag,power_notice1.notice_type_name,power_notice.notice_title, power_notice.notice_content,power_notice.parent_id,power_user.user_name notice_send, if(power_notice.notice_receive='all','all',power_user1.user_name) notice_receive, power_notice.notice_date, power_notice.read_flag,power_notice.effective from power_notice
select power_notice.notice_id,
power_notice.notice_type_flag,power_notice1.notice_type_name,power_notice.notice_title,
power_notice.notice_content,power_notice.parent_id,power_user.user_name notice_send,
if(power_notice.notice_receive='all','all',power_user1.user_name) notice_receive, power_notice.notice_date,
power_notice.read_flag,power_notice.effective from power_notice
left join power_user
on power_user.user_id = power_notice.notice_send
left join power_user power_user1
@ -765,16 +781,19 @@
on power_notice1.notice_id = power_notice.parent_id
where power_notice.notice_type_flag IS NULL
<if test= "userId != null and roleId != -100" >
and (power_notice.notice_send='${userId}' or power_notice.notice_receive='${userId}' or power_notice.notice_receive='all')
and (power_notice.notice_send='${userId}' or power_notice.notice_receive='${userId}' or
power_notice.notice_receive='all')
</if>
<if test= "record.effective != null" >
AND power_notice.power_notice.effective = ${record.effective}
</if>
<if test= "record.noticeSend != null and record.noticeSend != ''" >
AND power_notice.notice_send in (select user_id from power_user where user_name LIKE '%${record.noticeSend}%')
AND power_notice.notice_send in (select user_id from power_user where user_name LIKE
'%${record.noticeSend}%')
</if>
<if test= "record.noticeReceive != null and record.noticeReceive != ''" >
AND (power_notice.notice_receive in (select user_id from power_user where user_name LIKE '%${record.noticeReceive}%') OR power_notice.notice_receive = 'all')
AND (power_notice.notice_receive in (select user_id from power_user where user_name LIKE
'%${record.noticeReceive}%') OR power_notice.notice_receive = 'all')
</if>
<if test= "record.noticeDateStart != null and record.noticeDateStart != ''" >
AND power_notice.notice_date >= #{record.noticeDateStart}
@ -824,7 +843,8 @@
<if test= "record.noticeTypeFlag != null and record.noticeTypeFlag != ''" >
and power_notice.notice_type_flag = #{record.noticeTypeFlag}
</if>
</where> )
</where>
)
ORDER BY power_notice.notice_type_flag desc,power_notice.notice_date desc
</select>
<select id= "getTotal" resultMap= "BaseResultMap" >
@ -872,7 +892,11 @@
</if>
</where>
UNION ALL-->
select power_notice.notice_id, power_notice.notice_type_flag,power_notice.notice_type_name,power_notice.notice_title, power_notice.notice_content,power_notice.parent_id,power_user.user_name notice_send, if(power_notice.notice_receive='all','all',power_user1.user_name) notice_receive, power_notice.notice_date, power_notice.read_flag,power_notice.effective from power_notice
select power_notice.notice_id,
power_notice.notice_type_flag,power_notice.notice_type_name,power_notice.notice_title,
power_notice.notice_content,power_notice.parent_id,power_user.user_name notice_send,
if(power_notice.notice_receive='all','all',power_user1.user_name) notice_receive, power_notice.notice_date,
power_notice.read_flag,power_notice.effective from power_notice
left join power_user
on power_user.user_id = power_notice.notice_send
left join power_user power_user1
@ -888,7 +912,8 @@
AND notice_send in (select user_id from power_user where user_name LIKE '%${record.noticeSend}%')
</if>
<if test= "record.noticeReceive != null and record.noticeReceive != ''" >
AND (notice_receive in (select user_id from power_user where user_name LIKE '%${record.noticeReceive}%') OR notice_receive = 'all')
AND (notice_receive in (select user_id from power_user where user_name LIKE '%${record.noticeReceive}%') OR
notice_receive = 'all')
</if>
<if test= "record.noticeDateStart != null and record.noticeDateStart != ''" >
AND notice_date >= #{record.noticeDateStart}
@ -938,7 +963,8 @@
<if test= "record.noticeTypeFlag != null and record.noticeTypeFlag != ''" >
and power_notice.notice_type_flag = #{record.noticeTypeFlag}
</if>
</where> )
</where>
)
</select>
<!-- 按noticeId集合查, 按选中id导出 -->
@ -1015,4 +1041,24 @@
)
</if>
</select>
<!-- 批量新增 -->
<insert id= "simpleInsert" useGeneratedKeys= "true" keyProperty= "noticeId" >
INSERT INTO power_notice(
sys_id, notice_type_flag,
notice_type_name, notice_title, notice_content,
notice_send, notice_date, notice_receive,
effective, read_flag, parent_id,
remark
)
VALUES
<foreach collection= "list" item= "record" separator= "," >
(
#{record.sysId,jdbcType=INTEGER}, #{record.noticeTypeFlag,jdbcType=VARCHAR},
#{record.noticeTypeName,jdbcType=VARCHAR}, #{record.noticeTitle,jdbcType=VARCHAR}, #{record.noticeContent,jdbcType=VARCHAR},
#{record.noticeSend,jdbcType=VARCHAR}, #{record.noticeDate,jdbcType=CHAR}, #{record.noticeReceive,jdbcType=VARCHAR},
#{record.effective,jdbcType=INTEGER}, #{record.readFlag,jdbcType=INTEGER}, #{record.parentId,jdbcType=INTEGER},
#{record.remark,jdbcType=VARCHAR}
)
</foreach>
</insert>
</mapper>