| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?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
- from xjr_oa_news t
- 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},'%')
- or t.full_head LIKE CONCAT('%',#{dto.keyword},'%')
- or t.author_name 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
- 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)
- and t.status = 2
- <if test="dto.type != null and dto.type == 2 and dto.loginId != null and dto.loginId > 0">
- and (t1.user_id = #{dto.loginId} or t.send_range = 1)
- </if>
- <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},'%')
- or t.full_head LIKE CONCAT('%',#{dto.keyword},'%')
- or t.author_name LIKE CONCAT('%',#{dto.keyword},'%'))
- </if>
- order by
- t.send_start_date desc,t.release_time desc
- </select>
- <select id="getDeptIdOrClassId" parameterType="java.util.List"
- resultType="com.xjrsoft.module.oa.vo.DeptIdOrClassIdVo">
- select
- t.id as userId,
- t2.id as deptId,
- t3.id as classId
- from xjr_user t
- left join xjr_user_dept_relation t1 on t1.user_id = t.id
- LEFT JOIN xjr_department t2 ON t2.id = t1.dept_id
- left join base_student_school_roll t3 on t3.user_id = t.id
- left join base_class t4 on t4.id = t3.class_id
- where t.delete_mark = 0
- <if test="personalIdList != null and personalIdList.size() > 0">
- and t.id in
- <foreach item="userId" index="index" collection="personalIdList" open="(" close=")"
- separator=",">
- #{userId}
- </foreach>
- </if>
- </select>
- </mapper>
|