NewsMapper.xml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.xjrsoft.module.oa.mapper.NewsMapper">
  6. <select id="manageBox" parameterType="com.xjrsoft.module.oa.dto.NewsPageDto"
  7. resultType="com.xjrsoft.module.oa.vo.NewsPageVo">
  8. select
  9. t.*,
  10. t2.name as classIdCN
  11. from xjr_oa_news t
  12. where t.delete_mark = 0
  13. <if test="dto.type != null and dto.type > 0">
  14. and t.type_id = #{dto.type}
  15. </if>
  16. <if test="dto.type != null and dto.type = 1">
  17. and t.wf_status = 1
  18. </if>
  19. <if test="dto.fullHead != null and dto.fullHead != ''">
  20. and t.full_head LIKE CONCAT('%',#{dto.fullHead},'%')
  21. </if>
  22. <if test="dto.loginId != null and dto.loginId > 0">
  23. and t.create_user_id = #{dto.loginId}
  24. </if>
  25. order by t.release_time desc
  26. </select>
  27. <select id="receiptBox" parameterType="com.xjrsoft.module.oa.dto.NewsPageDto"
  28. resultType="com.xjrsoft.module.oa.vo.NewsPageVo">
  29. select
  30. t.*
  31. from xjr_oa_news t
  32. where t.delete_mark = 0 and
  33. (t.send_end_date > now() or t.send_end_date is null)
  34. and t.status = 2
  35. <if test="dto.type != null and dto.type == 2 and dto.loginId != null">
  36. and (t.send_range = 1 or t.id in (select news_id from xjr_oa_news_relation t1 where user_id = #{dto.loginId}))
  37. </if>
  38. <if test="dto.type != null and dto.type == 1">
  39. and t.wf_status = 1
  40. </if>
  41. <if test="dto.type != null and dto.type > 0">
  42. and t.type_id = #{dto.type}
  43. </if>
  44. <if test="dto.fullHead != null and dto.fullHead != ''">
  45. and t.full_head LIKE CONCAT('%',#{dto.fullHead},'%')
  46. </if>
  47. order by
  48. t.release_time desc
  49. </select>
  50. <select id="getDeptIdOrClassId" parameterType="java.util.List"
  51. resultType="com.xjrsoft.module.oa.vo.DeptIdOrClassIdVo">
  52. select
  53. t.id as userId,
  54. t2.id as deptId,
  55. t3.id as classId
  56. from xjr_user t
  57. left join xjr_user_dept_relation t1 on t1.user_id = t.id
  58. LEFT JOIN xjr_department t2 ON t2.id = t1.dept_id
  59. left join base_student_school_roll t3 on t3.user_id = t.id
  60. left join base_class t4 on t4.id = t3.class_id
  61. where t.delete_mark = 0
  62. <if test="personalIdList != null and personalIdList.size() > 0">
  63. and t.id in
  64. <foreach item="userId" index="index" collection="personalIdList" open="(" close=")"
  65. separator=",">
  66. #{userId}
  67. </foreach>
  68. </if>
  69. </select>
  70. </mapper>