NewsMapper.xml 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. left join base_class t2 on t2.id = t.class_id
  13. where t.delete_mark = 0
  14. <if test="dto.type != null and dto.type > 0">
  15. and t.type_id = #{dto.type}
  16. </if>
  17. <if test="dto.authorName != null and dto.authorName != ''">
  18. and t.author_name LIKE CONCAT('%',#{dto.authorName},'%')
  19. </if>
  20. <if test="dto.fullHead != null and dto.fullHead != ''">
  21. and t.full_head LIKE CONCAT('%',#{dto.fullHead},'%')
  22. </if>
  23. <if test="dto.keyword != null and dto.keyword != ''">
  24. and (t.keyword LIKE CONCAT('%',#{dto.keyword},'%')
  25. or t.full_head LIKE CONCAT('%',#{dto.keyword},'%')
  26. or t.author_name LIKE CONCAT('%',#{dto.keyword},'%'))
  27. </if>
  28. <if test="dto.loginId != null and dto.loginId > 0">
  29. and t.create_user_id = #{dto.loginId}
  30. </if>
  31. order by t.release_time desc
  32. </select>
  33. <select id="receiptBox" parameterType="com.xjrsoft.module.oa.dto.NewsPageDto"
  34. resultType="com.xjrsoft.module.oa.vo.NewsPageVo">
  35. select
  36. t.*,
  37. t2.name as classIdCN
  38. from xjr_oa_news t
  39. left join xjr_oa_news_relation t1 on t1.news_id = t.id
  40. left join base_class t2 on t2.id = t.class_id
  41. where t.delete_mark = 0 and
  42. (t.send_end_date > now() or t.send_end_date is null)
  43. and t.status = 2
  44. <if test="dto.type != null and dto.type == 2 and dto.loginId != null and dto.loginId > 0">
  45. and (t1.user_id = #{dto.loginId} or t.send_range = 1)
  46. </if>
  47. <if test="dto.type != null and dto.type > 0">
  48. and t.type_id = #{dto.type}
  49. </if>
  50. <if test="dto.authorName != null and dto.authorName != ''">
  51. and t.author_name LIKE CONCAT('%',#{dto.authorName},'%')
  52. </if>
  53. <if test="dto.fullHead != null and dto.fullHead != ''">
  54. and t.full_head LIKE CONCAT('%',#{dto.fullHead},'%')
  55. </if>
  56. <if test="dto.keyword != null and dto.keyword != ''">
  57. and (t.keyword LIKE CONCAT('%',#{dto.keyword},'%')
  58. or t.full_head LIKE CONCAT('%',#{dto.keyword},'%')
  59. or t.author_name LIKE CONCAT('%',#{dto.keyword},'%'))
  60. </if>
  61. order by
  62. t.send_start_date desc,t.release_time desc
  63. </select>
  64. <select id="getDeptIdOrClassId" parameterType="java.util.List"
  65. resultType="com.xjrsoft.module.oa.vo.DeptIdOrClassIdVo">
  66. select
  67. t.id as userId,
  68. t2.id as deptId,
  69. t3.id as classId
  70. from xjr_user t
  71. left join xjr_user_dept_relation t1 on t1.user_id = t.id
  72. LEFT JOIN xjr_department t2 ON t2.id = t1.dept_id
  73. left join base_student_school_roll t3 on t3.user_id = t.id
  74. left join base_class t4 on t4.id = t3.class_id
  75. where t.delete_mark = 0
  76. <if test="personalIdList != null and personalIdList.size() > 0">
  77. and t.id in
  78. <foreach item="userId" index="index" collection="personalIdList" open="(" close=")"
  79. separator=",">
  80. #{userId}
  81. </foreach>
  82. </if>
  83. </select>
  84. </mapper>