<?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.gkhy.exam.system.mapper.SysNoticeMapper">
|
|
<resultMap type="com.gkhy.exam.system.domain.SysNotice" id="SysNoticeResult">
|
<result property="id" column="id" />
|
<result property="title" column="title" />
|
<result property="type" column="type" />
|
<result property="content" column="content" />
|
<result property="status" column="status" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
<result property="remark" column="remark" />
|
<result property="filePath" column="file_path" />
|
<result property="fileName" column="file_name" />
|
<result property="deptId" column="dept_id" />
|
<result property="publishDate" column="publish_date" />
|
<result property="companyId" column="company_id" />
|
</resultMap>
|
<resultMap type="com.gkhy.exam.system.domain.SysNotice" id="SysNoticeVoResult">
|
<result property="deptName" column="dept_name" />
|
</resultMap>
|
|
<sql id="selectNoticeVo">
|
select id, title, type, cast(content as char) as content,company_id, status, create_by, create_time, update_by, update_time, remark, file_path, file_name, dept_id, publish_date
|
from sys_notice
|
</sql>
|
|
<select id="selectNoticeById" parameterType="Long" resultMap="SysNoticeResult">
|
<include refid="selectNoticeVo"/>
|
where id = #{noticeId}
|
</select>
|
|
<select id="selectNoticeList" resultMap="SysNoticeVoResult">
|
select a.id, a.title, a.type, cast(a.content as char) as content, a.status, a.create_by, a.create_time, a.update_by,
|
a.update_time, a.remark, a.file_path, a.file_name, a.dept_id, a.publish_date,b.dept_name,a.company_id
|
from sys_notice a
|
left join sys_dept b on a.dept_id = b.dept_id
|
where a.del_flag = 0
|
<if test="companyId != null">
|
AND a.company_id = #{companyId}
|
</if>
|
<if test="title != null and title != ''">
|
AND a.title like concat('%', #{title}, '%')
|
</if>
|
<if test="type != null and type != ''">
|
AND a.type = #{type}
|
</if>
|
<if test="deptId != null">
|
AND a.dept_id = #{deptId}
|
</if>
|
<if test="createBy != null and createBy != ''">
|
AND a.create_by like concat('%', #{createBy}, '%')
|
</if>
|
|
order by a.create_time desc
|
</select>
|
|
|
<delete id="deleteNoticeByIds" parameterType="Long">
|
update sys_notice set del_flag = 1 where id in
|
<foreach item="noticeId" collection="array" open="(" separator="," close=")">
|
#{noticeId}
|
</foreach>
|
</delete>
|
|
</mapper>
|