|
@@ -40,22 +40,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
<select id="selectZxNoticeList" parameterType="ZxNotice" resultMap="ZxNoticeResult">
|
|
<select id="selectZxNoticeList" parameterType="ZxNotice" resultMap="ZxNoticeResult">
|
|
- select a.zx_notice_id, a.notice_title, a.notice_type, a.notice_content, a.status, a.issuer, a.issuer_dept, a.issuer_dept_id, a.issuer_time, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
|
|
|
|
- IFNULL( b.zx_notice_type, 'N' ) as type
|
|
|
|
- from zx_notice a
|
|
|
|
- left join zx_user_notice b on b.zx_notice_id = a.zx_notice_id
|
|
|
|
- where a.zx_notice_id = #{zxNoticeId}
|
|
|
|
- <where>
|
|
|
|
- <if test="noticeTitle != null and noticeTitle != ''"> and a.notice_title = #{noticeTitle}</if>
|
|
|
|
|
|
+ <where>
|
|
|
|
+ select * from ( select a.zx_notice_id, a.notice_title, a.notice_type, a.notice_content, a.status, a.issuer,
|
|
|
|
+ a.issuer_dept, a.issuer_dept_id, a.issuer_time, a.create_by, a.create_time, a.update_by, a.update_time,
|
|
|
|
+ a.remark,
|
|
|
|
+ IFNULL( b.zx_notice_type, 'N' ) as type
|
|
|
|
+ from zx_notice a
|
|
|
|
+ left join zx_user_notice b on b.zx_notice_id = a.zx_notice_id
|
|
|
|
+ where a.zx_notice_id = #{zxNoticeId}and a.notice_title = #{noticeTitle}<if test="noticeTitle != null and noticeTitle != ''"></if>
|
|
<if test="noticeType != null and noticeType != ''"> and a.notice_type = #{noticeType}</if>
|
|
<if test="noticeType != null and noticeType != ''"> and a.notice_type = #{noticeType}</if>
|
|
- <if test="noticeContent != null and noticeContent != ''"> and a.notice_content = #{noticeContent}</if>
|
|
|
|
|
|
+ <if test="noticeContent != null and noticeContent != ''">and a.notice_content =#{noticeContent}</if>
|
|
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
|
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
|
<if test="issuer != null and issuer != ''"> and a.issuer = #{issuer}</if>
|
|
<if test="issuer != null and issuer != ''"> and a.issuer = #{issuer}</if>
|
|
- <if test="issuerDept != null and issuerDept != ''"> and a.issuer_dept = #{issuerDept}</if>
|
|
|
|
- <if test="issuerDeptId != null "> and a.issuer_dept_id = #{issuerDeptId}</if>
|
|
|
|
- <if test="issuerTime != null "> and a.issuer_time = #{issuerTime}</if>
|
|
|
|
|
|
+ <if test="issuerDept != null and issuerDept != ''">and a.issuer_dept =#{issuerDept}</if>
|
|
|
|
+ <if test="issuerDeptId != null ">and a.issuer_dept_id= #{issuerDeptId}</if>
|
|
|
|
+ <if test="issuerTime != null ">and a.issuer_time =#{issuerTime}</if>
|
|
|
|
+
|
|
|
|
+ </where>
|
|
|
|
+ ) s
|
|
|
|
+ <where>
|
|
|
|
+ <if test="type != null and type != ''">and s.type =#{type}</if>
|
|
</where>
|
|
</where>
|
|
- order by issuer_time DESC
|
|
|
|
|
|
+ order by s.issuer_time DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectZxNoticeByZxNoticeId" parameterType="Long" resultMap="ZxNoticeZxUserNoticeResult">
|
|
<select id="selectZxNoticeByZxNoticeId" parameterType="Long" resultMap="ZxNoticeZxUserNoticeResult">
|
|
@@ -78,10 +84,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="issuerDeptId != null">issuer_dept_id,</if>
|
|
<if test="issuerDeptId != null">issuer_dept_id,</if>
|
|
<if test="issuerTime != null">issuer_time,</if>
|
|
<if test="issuerTime != null">issuer_time,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
- <if test="createTime != null">create_time,</if>
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="remark != null">remark,</if>
|
|
|
|
+ create_time
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
|
|
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
|
|
@@ -93,10 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<if test="issuerDeptId != null">#{issuerDeptId},</if>
|
|
<if test="issuerDeptId != null">#{issuerDeptId},</if>
|
|
<if test="issuerTime != null">#{issuerTime},</if>
|
|
<if test="issuerTime != null">#{issuerTime},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
- <if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
+ sysdate()
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
@@ -145,7 +151,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<insert id="batchZxUserNotice">
|
|
<insert id="batchZxUserNotice">
|
|
insert into zx_user_notice( user_id, user_name, zx_notice_id, create_time) values
|
|
insert into zx_user_notice( user_id, user_name, zx_notice_id, create_time) values
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
<foreach item="item" index="index" collection="list" separator=",">
|
|
- ( #{item.userId}, #{item.userName}, #{item.zxNoticeId}, #{item.createTime})
|
|
|
|
|
|
+ ( #{item.userId}, #{item.userName}, #{item.zxNoticeId}, sysdate())
|
|
</foreach>
|
|
</foreach>
|
|
</insert>
|
|
</insert>
|
|
|
|
+
|
|
|
|
+ <insert id="insterZxUserNotice" parameterType="zxUserNotice">
|
|
|
|
+ insert into zx_user_notice
|
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="userId != null and userId != ''">user_id,</if>
|
|
|
|
+ <if test="userName != null and userName != ''">user_name,</if>
|
|
|
|
+ <if test="zxNoticeId != null">zx_notice_id,</if>
|
|
|
|
+ <if test="zxNoticeType != null">zx_notice_type,</if>
|
|
|
|
+ create_time
|
|
|
|
+ </trim>
|
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
+ <if test="userId != null and userId != ''">#{userId},</if>
|
|
|
|
+ <if test="userName != null and userName != ''">#{userName},</if>
|
|
|
|
+ <if test="zxNoticeId != null">#{zxNoticeId},</if>
|
|
|
|
+ <if test="zxNoticeType != null">#{zxNoticeType},</if>
|
|
|
|
+ sysdate()
|
|
|
|
+ </trim>
|
|
|
|
+ </insert>
|
|
</mapper>
|
|
</mapper>
|