| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?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.xjrsoft.module.oa.mapper.NewsMapper">
- <select id="manageBox" parameterType="com.xjrsoft.module.oa.dto.NewsPageDto"
- resultType="com.xjrsoft.module.oa.vo.NewsPageVo">
- select
- t.*,
- t2.name as classIdCN,
- (select count(*) from xjr_oa_news_relation where reply_content is not null ) as replyContentNum
- from xjr_oa_news t
- left join xjr_oa_news_relation t1 on t1.news_id = t.id
- left join base_class t2 on t2.id = t.class_id
- where t.delete_mark = 0
- <if test="dto.type != null and dto.type > 0">
- and t.type_id = #{dto.type}
- </if>
- <if test="dto.authorName != null and dto.authorName != ''">
- and t.author_name LIKE CONCAT('%',#{dto.authorName},'%')
- </if>
- <if test="dto.fullHead != null and dto.fullHead != ''">
- and t.full_head LIKE CONCAT('%',#{dto.fullHead},'%')
- </if>
- <if test="dto.keyword != null and dto.keyword != ''">
- and t.keyword LIKE CONCAT('%',#{dto.keyword},'%')
- </if>
- <if test="dto.loginId != null and dto.loginId > 0">
- and t.create_user_id = #{dto.loginId}
- </if>
- order by t.release_time desc
- </select>
- <select id="receiptBox" parameterType="com.xjrsoft.module.oa.dto.NewsPageDto"
- resultType="com.xjrsoft.module.oa.vo.NewsPageVo">
- select
- t.*,
- t2.name as classIdCN,
- (select count(*) from xjr_oa_news_relation where reply_content is not null ) as replyContentNum
- from xjr_oa_news t
- left join xjr_oa_news_relation t1 on t1.news_id = t.id
- left join base_class t2 on t2.id = t.class_id
- where t.delete_mark = 0 and
- (t.send_end_date > now() or t.send_end_date is null)
- <if test="dto.type != null and dto.type > 0">
- and t.type_id = #{dto.type}
- </if>
- <if test="dto.authorName != null and dto.authorName != ''">
- and t.author_name LIKE CONCAT('%',#{dto.authorName},'%')
- </if>
- <if test="dto.fullHead != null and dto.fullHead != ''">
- and t.full_head LIKE CONCAT('%',#{dto.fullHead},'%')
- </if>
- <if test="dto.keyword != null and dto.keyword != ''">
- and t.keyword LIKE CONCAT('%',#{dto.keyword},'%')
- </if>
- <if test="dto.type != null and dto.type == 2 and dto.loginId != null and dto.loginId > 0">
- and t1.user_id = #{dto.loginId}
- </if>
- order by
- t.send_start_date desc
- </select>
- </mapper>
|