AuditUserServiceDaoImplMapper.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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="auditUserServiceDaoImpl">
  6. <!-- 保存审核人员信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveBusinessAuditUserInfo" parameterType="Map">
  8. insert into business_audit_user(
  9. obj_code,audit_user_id,operate,store_id,user_name,b_id,user_id,audit_link
  10. ) values (
  11. #{objCode},#{auditUserId},#{operate},#{storeId},#{userName},#{bId},#{userId},#{auditLink}
  12. )
  13. </insert>
  14. <!-- 查询审核人员信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessAuditUserInfo" parameterType="Map" resultType="Map">
  16. select t.obj_code,t.obj_code objCode,t.audit_user_id,t.audit_user_id auditUserId,t.operate,t.store_id,t.store_id
  17. storeId,t.user_name,t.user_name userName,t.b_id,t.b_id bId,t.user_id,t.user_id userId,t.audit_link,t.audit_link
  18. auditLink
  19. from business_audit_user t
  20. where 1 =1
  21. <if test="objCode !=null and objCode != ''">
  22. and t.obj_code= #{objCode}
  23. </if>
  24. <if test="auditUserId !=null and auditUserId != ''">
  25. and t.audit_user_id= #{auditUserId}
  26. </if>
  27. <if test="operate !=null and operate != ''">
  28. and t.operate= #{operate}
  29. </if>
  30. <if test="storeId !=null and storeId != ''">
  31. and t.store_id= #{storeId}
  32. </if>
  33. <if test="userName !=null and userName != ''">
  34. and t.user_name= #{userName}
  35. </if>
  36. <if test="bId !=null and bId != ''">
  37. and t.b_id= #{bId}
  38. </if>
  39. <if test="userId !=null and userId != ''">
  40. and t.user_id= #{userId}
  41. </if>
  42. <if test="auditLink !=null and auditLink != ''">
  43. and t.audit_link= #{auditLink}
  44. </if>
  45. </select>
  46. <!-- 保存审核人员信息至 instance表中 add by wuxw 2018-07-03 -->
  47. <insert id="saveAuditUserInfoInstance" parameterType="Map">
  48. insert into audit_user(
  49. obj_code,audit_user_id,status_cd,store_id,user_name,b_id,user_id,audit_link
  50. ) select t.obj_code,t.audit_user_id,'0',t.store_id,t.user_name,t.b_id,t.user_id,t.audit_link from
  51. business_audit_user t where 1=1
  52. <if test="objCode !=null and objCode != ''">
  53. and t.obj_code= #{objCode}
  54. </if>
  55. <if test="auditUserId !=null and auditUserId != ''">
  56. and t.audit_user_id= #{auditUserId}
  57. </if>
  58. and t.operate= 'ADD'
  59. <if test="storeId !=null and storeId != ''">
  60. and t.store_id= #{storeId}
  61. </if>
  62. <if test="userName !=null and userName != ''">
  63. and t.user_name= #{userName}
  64. </if>
  65. <if test="bId !=null and bId != ''">
  66. and t.b_id= #{bId}
  67. </if>
  68. <if test="userId !=null and userId != ''">
  69. and t.user_id= #{userId}
  70. </if>
  71. <if test="auditLink !=null and auditLink != ''">
  72. and t.audit_link= #{auditLink}
  73. </if>
  74. </insert>
  75. <!-- 查询审核人员信息 add by wuxw 2018-07-03 -->
  76. <select id="getAuditUserInfo" parameterType="Map" resultType="Map">
  77. select t.obj_code,t.obj_code objCode,t.audit_user_id,t.audit_user_id auditUserId,t.status_cd,t.status_cd
  78. statusCd,t.store_id,t.store_id storeId,t.user_name,t.user_name userName,t.b_id,t.b_id bId,t.user_id,t.user_id
  79. userId,t.audit_link,t.audit_link auditLink,d1.name auditLinkName,d2.name objCodeName
  80. from audit_user t,t_dict d1,t_dict d2
  81. where 1 =1
  82. and t.audit_link = d1.status_cd
  83. and d1.table_name='audit_user'
  84. and d1.table_columns='audit_link'
  85. and t.obj_code = d2.status_cd
  86. and d2.table_name='audit_user'
  87. and d2.table_columns='obj_code'
  88. <if test="objCode !=null and objCode != ''">
  89. and t.obj_code= #{objCode}
  90. </if>
  91. <if test="auditUserId !=null and auditUserId != ''">
  92. and t.audit_user_id= #{auditUserId}
  93. </if>
  94. <if test="statusCd !=null and statusCd != ''">
  95. and t.status_cd= #{statusCd}
  96. </if>
  97. <if test="storeId !=null and storeId != ''">
  98. and t.store_id= #{storeId}
  99. </if>
  100. <if test="userName !=null and userName != ''">
  101. and t.user_name= #{userName}
  102. </if>
  103. <if test="bId !=null and bId != ''">
  104. and t.b_id= #{bId}
  105. </if>
  106. <if test="userId !=null and userId != ''">
  107. and t.user_id= #{userId}
  108. </if>
  109. <if test="auditLink !=null and auditLink != ''">
  110. and t.audit_link= #{auditLink}
  111. </if>
  112. <if test="page != -1 and page != null ">
  113. limit #{page}, #{row}
  114. </if>
  115. </select>
  116. <!-- 修改审核人员信息 add by wuxw 2018-07-03 -->
  117. <update id="updateAuditUserInfoInstance" parameterType="Map">
  118. update audit_user t set t.status_cd = #{statusCd}
  119. <if test="newBId != null and newBId != ''">
  120. ,t.b_id = #{newBId}
  121. </if>
  122. <if test="objCode !=null and objCode != ''">
  123. , t.obj_code= #{objCode}
  124. </if>
  125. <if test="storeId !=null and storeId != ''">
  126. , t.store_id= #{storeId}
  127. </if>
  128. <if test="userName !=null and userName != ''">
  129. , t.user_name= #{userName}
  130. </if>
  131. <if test="userId !=null and userId != ''">
  132. , t.user_id= #{userId}
  133. </if>
  134. <if test="auditLink !=null and auditLink != ''">
  135. , t.audit_link= #{auditLink}
  136. </if>
  137. where 1=1
  138. <if test="auditUserId !=null and auditUserId != ''">
  139. and t.audit_user_id= #{auditUserId}
  140. </if>
  141. <if test="bId !=null and bId != ''">
  142. and t.b_id= #{bId}
  143. </if>
  144. </update>
  145. <!-- 查询审核人员数量 add by wuxw 2018-07-03 -->
  146. <select id="queryAuditUsersCount" parameterType="Map" resultType="Map">
  147. select count(1) count
  148. from audit_user t,t_dict d1,t_dict d2
  149. where 1 =1
  150. and t.audit_link = d1.status_cd
  151. and d1.table_name='audit_user'
  152. and d1.table_columns='audit_link'
  153. and t.obj_code = d2.status_cd
  154. and d2.table_name='audit_user'
  155. and d2.table_columns='obj_code'
  156. <if test="objCode !=null and objCode != ''">
  157. and t.obj_code= #{objCode}
  158. </if>
  159. <if test="auditUserId !=null and auditUserId != ''">
  160. and t.audit_user_id= #{auditUserId}
  161. </if>
  162. <if test="statusCd !=null and statusCd != ''">
  163. and t.status_cd= #{statusCd}
  164. </if>
  165. <if test="storeId !=null and storeId != ''">
  166. and t.store_id= #{storeId}
  167. </if>
  168. <if test="userName !=null and userName != ''">
  169. and t.user_name= #{userName}
  170. </if>
  171. <if test="bId !=null and bId != ''">
  172. and t.b_id= #{bId}
  173. </if>
  174. <if test="userId !=null and userId != ''">
  175. and t.user_id= #{userId}
  176. </if>
  177. <if test="auditLink !=null and auditLink != ''">
  178. and t.audit_link= #{auditLink}
  179. </if>
  180. </select>
  181. </mapper>