NewsMapper.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. left join xjr_oa_news_relation t1 on t1.news_id = t.id
  33. where t.delete_mark = 0 and
  34. (t.send_end_date > now() or t.send_end_date is null)
  35. and t.status = 2
  36. <if test="dto.type != null and dto.type == 2 and dto.loginId != null and dto.loginId > 0">
  37. and (t1.user_id = #{dto.loginId} or t.send_range = 1)
  38. </if>
  39. <if test="dto.type != null and dto.type == 1">
  40. and t.wf_status = 1
  41. </if>
  42. <if test="dto.type != null and dto.type > 0">
  43. and t.type_id = #{dto.type}
  44. </if>
  45. <if test="dto.fullHead != null and dto.fullHead != ''">
  46. and t.full_head LIKE CONCAT('%',#{dto.fullHead},'%')
  47. </if>
  48. order by
  49. t.release_time desc
  50. </select>
  51. <select id="getDeptIdOrClassId" parameterType="java.util.List"
  52. resultType="com.xjrsoft.module.oa.vo.DeptIdOrClassIdVo">
  53. select
  54. t.id as userId,
  55. t2.id as deptId,
  56. t3.id as classId
  57. from xjr_user t
  58. left join xjr_user_dept_relation t1 on t1.user_id = t.id
  59. LEFT JOIN xjr_department t2 ON t2.id = t1.dept_id
  60. left join base_student_school_roll t3 on t3.user_id = t.id
  61. left join base_class t4 on t4.id = t3.class_id
  62. where t.delete_mark = 0
  63. <if test="personalIdList != null and personalIdList.size() > 0">
  64. and t.id in
  65. <foreach item="userId" index="index" collection="personalIdList" open="(" close=")"
  66. separator=",">
  67. #{userId}
  68. </foreach>
  69. </if>
  70. </select>
  71. </mapper>