@ -1,28 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace= "com.manage.dao.Power_NoticeMapper" >
<resultMap id= "BaseResultMap" type= "com.manage.vo.Power_NoticeVo" >
<id column= "notice_id" property= "noticeId" jdbcType= "INTEGER" />
<result column= "sys_id" property= "sysId" jdbcType= "INTEGER" />
<result column= "notice_type_flag" property= "noticeTypeFlag" jdbcType= "VARCHAR" />
<result column= "notice_type_name" property= "noticeTypeName" jdbcType= "VARCHAR" />
<result column= "notice_title" property= "noticeTitle" jdbcType= "VARCHAR" />
<result column= "notice_content" property= "noticeContent" jdbcType= "VARCHAR" />
<result column= "notice_send" property= "noticeSend" jdbcType= "VARCHAR" />
<result column= "notice_date" property= "noticeDate" jdbcType= "CHAR" />
<result column= "notice_receive" property= "noticeReceive" jdbcType= "VARCHAR" />
<result column= "effective" property= "effective" jdbcType= "INTEGER" />
<result column= "read_flag" property= "readFlag" jdbcType= "INTEGER" />
<result column= "parent_id" property= "parentId" jdbcType= "INTEGER" />
<result column= "remark" property= "remark" jdbcType= "VARCHAR" />
<mapper namespace= "com.manage.dao.Power_NoticeMapper" >
<resultMap id= "BaseResultMap" type= "com.manage.vo.Power_NoticeVo" >
<id column= "notice_id" property= "noticeId" jdbcType= "INTEGER" />
<result column= "sys_id" property= "sysId" jdbcType= "INTEGER" />
<result column= "notice_type_flag" property= "noticeTypeFlag" jdbcType= "VARCHAR" />
<result column= "notice_type_name" property= "noticeTypeName" jdbcType= "VARCHAR" />
<result column= "notice_title" property= "noticeTitle" jdbcType= "VARCHAR" />
<result column= "notice_content" property= "noticeContent" jdbcType= "VARCHAR" />
<result column= "notice_send" property= "noticeSend" jdbcType= "VARCHAR" />
<result column= "notice_date" property= "noticeDate" jdbcType= "CHAR" />
<result column= "notice_receive" property= "noticeReceive" jdbcType= "VARCHAR" />
<result column= "effective" property= "effective" jdbcType= "INTEGER" />
<result column= "read_flag" property= "readFlag" jdbcType= "INTEGER" />
<result column= "parent_id" property= "parentId" jdbcType= "INTEGER" />
<result column= "remark" property= "remark" jdbcType= "VARCHAR" />
</resultMap>
<sql id= "Base_Column_List" >
<sql id= "Base_Column_List" >
notice_id, sys_id, notice_type_flag, notice_type_name, notice_title, notice_content,
notice_send, notice_date, notice_receive, effective, read_flag, parent_id, remark
</sql>
<select id= "selectByPrimaryKey" resultMap= "BaseResultMap" parameterType= "java.lang.Integer" >
<select id= "selectByPrimaryKey" resultMap= "BaseResultMap" parameterType= "java.lang.Integer" >
select
<include refid= "Base_Column_List" />
<include refid= "Base_Column_List" />
from power_notice
where notice_id = #{noticeId,jdbcType=INTEGER}
</select>
@ -42,134 +42,134 @@
#{effective,jdbcType=INTEGER}, #{readFlag,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id= "insertSelective" parameterType= "com.manage.entity.Power_Notice" >
<insert id= "insertSelective" parameterType= "com.manage.entity.Power_Notice" >
insert into power_notice
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "noticeId != null" >
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
<if test= "noticeId != null" >
notice_id,
</if>
<if test= "sysId != null" >
<if test= "sysId != null" >
sys_id,
</if>
<if test= "noticeTypeFlag != null" >
<if test= "noticeTypeFlag != null" >
notice_type_flag,
</if>
<if test= "noticeTypeName != null" >
<if test= "noticeTypeName != null" >
notice_type_name,
</if>
<if test= "noticeTitle != null" >
<if test= "noticeTitle != null" >
notice_title,
</if>
<if test= "noticeContent != null" >
<if test= "noticeContent != null" >
notice_content,
</if>
<if test= "noticeSend != null" >
<if test= "noticeSend != null" >
notice_send,
</if>
<if test= "noticeDate != null" >
<if test= "noticeDate != null" >
notice_date,
</if>
<if test= "noticeReceive != null" >
<if test= "noticeReceive != null" >
notice_receive,
</if>
<if test= "effective != null" >
<if test= "effective != null" >
effective,
</if>
<if test= "readFlag != null" >
<if test= "readFlag != null" >
read_flag,
</if>
<if test= "parentId != null" >
<if test= "parentId != null" >
parent_id,
</if>
<if test= "remark != null" >
<if test= "remark != null" >
remark,
</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "noticeId != null" >
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
<if test= "noticeId != null" >
#{noticeId,jdbcType=INTEGER},
</if>
<if test= "sysId != null" >
<if test= "sysId != null" >
#{sysId,jdbcType=INTEGER},
</if>
<if test= "noticeTypeFlag != null" >
<if test= "noticeTypeFlag != null" >
#{noticeTypeFlag,jdbcType=VARCHAR},
</if>
<if test= "noticeTypeName != null" >
<if test= "noticeTypeName != null" >
#{noticeTypeName,jdbcType=VARCHAR},
</if>
<if test= "noticeTitle != null" >
<if test= "noticeTitle != null" >
#{noticeTitle,jdbcType=VARCHAR},
</if>
<if test= "noticeContent != null" >
<if test= "noticeContent != null" >
#{noticeContent,jdbcType=VARCHAR},
</if>
<if test= "noticeSend != null" >
<if test= "noticeSend != null" >
#{noticeSend,jdbcType=VARCHAR},
</if>
<if test= "noticeDate != null" >
<if test= "noticeDate != null" >
#{noticeDate,jdbcType=CHAR},
</if>
<if test= "noticeReceive != null" >
<if test= "noticeReceive != null" >
#{noticeReceive,jdbcType=VARCHAR},
</if>
<if test= "effective != null" >
<if test= "effective != null" >
#{effective,jdbcType=INTEGER},
</if>
<if test= "readFlag != null" >
<if test= "readFlag != null" >
#{readFlag,jdbcType=INTEGER},
</if>
<if test= "parentId != null" >
<if test= "parentId != null" >
#{parentId,jdbcType=INTEGER},
</if>
<if test= "remark != null" >
<if test= "remark != null" >
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id= "updateByPrimaryKeySelective" parameterType= "com.manage.entity.Power_Notice" >
<update id= "updateByPrimaryKeySelective" parameterType= "com.manage.entity.Power_Notice" >
update power_notice
<set >
<if test= "sysId != null" >
<set >
<if test= "sysId != null" >
sys_id = #{sysId,jdbcType=INTEGER},
</if>
<if test= "noticeTypeFlag != null" >
<if test= "noticeTypeFlag != null" >
notice_type_flag = #{noticeTypeFlag,jdbcType=VARCHAR},
</if>
<if test= "noticeTypeName != null" >
<if test= "noticeTypeName != null" >
notice_type_name = #{noticeTypeName,jdbcType=VARCHAR},
</if>
<if test= "noticeTitle != null" >
<if test= "noticeTitle != null" >
notice_title = #{noticeTitle,jdbcType=VARCHAR},
</if>
<if test= "noticeContent != null" >
<if test= "noticeContent != null" >
notice_content = #{noticeContent,jdbcType=VARCHAR},
</if>
<if test= "noticeSend != null" >
<if test= "noticeSend != null" >
notice_send = #{noticeSend,jdbcType=VARCHAR},
</if>
<if test= "noticeDate != null" >
<if test= "noticeDate != null" >
notice_date = #{noticeDate,jdbcType=CHAR},
</if>
<if test= "noticeReceive != null" >
<if test= "noticeReceive != null" >
notice_receive = #{noticeReceive,jdbcType=VARCHAR},
</if>
<if test= "effective != null" >
<if test= "effective != null" >
effective = #{effective,jdbcType=INTEGER},
</if>
<if test= "readFlag != null" >
<if test= "readFlag != null" >
read_flag = #{readFlag,jdbcType=INTEGER},
</if>
<if test= "parentId != null" >
<if test= "parentId != null" >
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test= "remark != null" >
<if test= "remark != null" >
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where notice_id = #{noticeId,jdbcType=INTEGER}
</update>
<update id= "updateByPrimaryKey" parameterType= "com.manage.entity.Power_Notice" >
<update id= "updateByPrimaryKey" parameterType= "com.manage.entity.Power_Notice" >
update power_notice
set sys_id = #{sysId,jdbcType=INTEGER},
notice_type_flag = #{noticeTypeFlag,jdbcType=VARCHAR},
@ -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>