SbUnusedMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.platform.dao.mapper.sbUnused.SbUnusedMapper">
  4. <sql id="Base_Column_List">
  5. unused.id,
  6. unused.name,
  7. unused.apply_time,
  8. unused.apply_user_id,
  9. unused.status,
  10. unused.created_user_id,
  11. unused.created_time,
  12. unused.update_user_id,
  13. unused.verity_user_id
  14. </sql>
  15. <sql id="Ref_Column_List">
  16. unused.name,
  17. unused.apply_time,
  18. unused.apply_user_id,
  19. unused.status,
  20. unused.verity_user_id
  21. </sql>
  22. <sql id="List_Condition">
  23. <if test="id != null and id != ''">
  24. and unused.id = #{id}
  25. </if>
  26. <if test="name != null and name != ''">
  27. and unused.name = #{name}
  28. </if>
  29. <if test="applyTimeStart != null">
  30. and unused.apply_time <![CDATA[>=]]>; #{applyTimeStart}
  31. </if>
  32. <if test="applyTimeEnd != null">
  33. and unused.apply_time <![CDATA[<=]]> #{applyTimeEnd}
  34. </if>
  35. <if test="applyTime != null">
  36. and unused.apply_time = #{applyTime}
  37. </if>
  38. <if test="applyUserId != null and applyUserId != ''">
  39. and unused.apply_user_id = #{applyUserId}
  40. </if>
  41. <if test="status != null">
  42. and unused.status = #{status}
  43. </if>
  44. <if test="createdUserId != null and createdUserId != ''">
  45. and unused.created_user_id = #{createdUserId}
  46. </if>
  47. <if test="createdTimeStart != null">
  48. and unused.created_time <![CDATA[>=]]>; #{createdTimeStart}
  49. </if>
  50. <if test="createdTimeEnd != null">
  51. and unused.created_time <![CDATA[<=]]> #{createdTimeEnd}
  52. </if>
  53. <if test="createdTime != null">
  54. and unused.created_time = #{createdTime}
  55. </if>
  56. <if test="updateUserId != null and updateUserId != ''">
  57. and unused.update_user_id = #{updateUserId}
  58. </if>
  59. <if test="verityUserId != null and verityUserId != ''">
  60. and unused.verity_user_id = #{verityUserId}
  61. </if>
  62. <if test="keyword != null and keyword != ''">
  63. and unused.name like concat(concat('%',#{keyword}),'%')
  64. </if>
  65. <if test="allUserId!=null">
  66. and (unused.verity_user_id=#{allUserId}
  67. or unused.verity_user_id2=#{allUserId}
  68. )
  69. </if>
  70. <if test="statusList!=null and statusList.size()>0">
  71. and unused.status in
  72. <foreach collection="statusList" separator="," close=")" open="(" item="item">
  73. #{item}
  74. </foreach>
  75. </if>
  76. <if test="hFlag!=null and hFlag == 1">
  77. and unused.status!=1
  78. </if>
  79. </sql>
  80. <select id="selectList" parameterType="com.platform.dao.dto.sbUnused.SbUnusedDTO" resultType="com.platform.dao.vo.query.sbUnused.SbUnusedVO">
  81. select unused.*,user.real_name as applyName,user2.real_name as verifyUserName,user3.real_name as verifyUserName2
  82. from t_sb_unused as unused left join t_sys_user user on user.user_id = unused.apply_user_id
  83. left join t_sys_user user2 on user2.user_id = unused.verity_user_id
  84. left join t_sys_user user3 on user3.user_id = unused.verity_user_id2
  85. <where>
  86. <include refid="List_Condition" />
  87. </where>
  88. </select>
  89. <select id="getUnusedVO" parameterType="java.lang.String"
  90. resultType="com.platform.dao.vo.query.sbUnused.SbUnusedVO">
  91. select unused.*,user.real_name as applyName,user2.real_name as verifyUserName,
  92. user3.real_name as verifyUserName2
  93. from t_sb_unused unused left join t_sys_user user
  94. on unused.apply_user_id = user.user_id
  95. left join t_sys_user user2 on user2.user_id = unused.verity_user_id
  96. left join t_sys_user user3 on user3.user_id = unused.verity_user_id2
  97. where id = #{id}
  98. </select>
  99. <select id="getSbUnusedCount" resultType="com.platform.dao.vo.SbUnusedCount"
  100. parameterType="com.platform.dao.dto.sbUnused.SbUnusedDTO">
  101. select count(1) as num,unused.status from t_sb_unused unused
  102. where 1=1
  103. <if test="allUserId!=null and allUserId!=''">
  104. and (unused.apply_user_id = #{allUserId} or
  105. unused.verity_user_id = #{allUserId} or
  106. unused.verity_user_id2 = #{allUserId}
  107. )
  108. </if>
  109. group by unused.status
  110. </select>
  111. </mapper>