NewsMapper.xml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. from xjr_oa_news t
  11. where t.delete_mark = 0
  12. <if test="dto.type != null">
  13. and t.type_id = #{dto.type}
  14. </if>
  15. <if test="dto.typeId != null">
  16. and t.type_id = #{dto.typeId}
  17. </if>
  18. <if test="dto.type != null and dto.type = 1">
  19. and t.wf_status = 1
  20. </if>
  21. <if test="dto.fullHead != null and dto.fullHead != ''">
  22. and t.full_head LIKE CONCAT('%',#{dto.fullHead},'%')
  23. </if>
  24. <if test="dto.loginId != null and dto.loginId > 0">
  25. and t.create_user_id = #{dto.loginId}
  26. </if>
  27. <if test="dto.keyword != null and dto.keyword != ''">
  28. and (t.full_head LIKE CONCAT('%',#{dto.keyword},'%')
  29. or t.news_content LIKE CONCAT('%',#{dto.keyword},'%'))
  30. </if>
  31. <if test="dto.guideShowRange != null and dto.guideShowRange != ''">
  32. and t.guide_show_range LIKE CONCAT('%',#{dto.guideShowRange},'%')
  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 t.*,t2.name as create_user_name from xjr_oa_news t
  39. left join xjr_user t2 on t.create_user_id = t2.id
  40. left join xjr_oa_news_relation t3 on t.id = t3.news_id
  41. where t.delete_mark = 0 and t.enabled_mark = 1
  42. and (t.send_end_date > now() or t.send_end_date is null)
  43. and t.status = 2 and t3.user_id = #{dto.loginId}
  44. <if test="dto.type != null and dto.type == 1">
  45. and t.wf_status = 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.typeId != null">
  51. and t.type_id = #{dto.typeId}
  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.full_head LIKE CONCAT('%',#{dto.keyword},'%')
  58. or t.news_content LIKE CONCAT('%',#{dto.keyword},'%'))
  59. </if>
  60. <if test="dto.loginId != null and dto.readMark != null">
  61. and t3.read_mark = #{dto.readMark}
  62. </if>
  63. <if test="dto.guideShowRange != null and dto.guideShowRange != ''">
  64. and t.guide_show_range LIKE CONCAT('%',#{dto.guideShowRange},'%')
  65. </if>
  66. order by
  67. t.release_time desc
  68. </select>
  69. <select id="getDeptIdOrClassId" parameterType="java.util.List"
  70. resultType="com.xjrsoft.module.oa.vo.DeptIdOrClassIdVo">
  71. select
  72. t.id as userId,
  73. t2.id as deptId,
  74. t3.id as classId
  75. from xjr_user t
  76. left join xjr_user_dept_relation t1 on t1.user_id = t.id
  77. LEFT JOIN xjr_department t2 ON t2.id = t1.dept_id
  78. left join base_student_school_roll t3 on t3.user_id = t.id
  79. left join base_class t4 on t4.id = t3.class_id
  80. where t.delete_mark = 0
  81. <if test="personalIdList != null and personalIdList.size() > 0">
  82. and t.id in
  83. <foreach item="userId" index="index" collection="personalIdList" open="(" close=")"
  84. separator=",">
  85. #{userId}
  86. </foreach>
  87. </if>
  88. </select>
  89. </mapper>