NewsMapper.xml 3.7 KB

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