AttendanceClassesServiceDaoImplMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="attendanceClassesServiceDaoImpl">
  5. <!-- 保存考勤班次信息 add by wuxw 2018-07-03 -->
  6. <insert id="saveBusinessAttendanceClassesInfo" parameterType="Map">
  7. insert into business_attendance_classes(time_offset, clock_count, classes_obj_type, store_id, clock_type,
  8. classes_obj_id, classes_name, classes_id, operate,
  9. leave_offset, late_offset, b_id, clock_type_value,max_last_offset)
  10. values (#{timeOffset}, #{clockCount}, #{classesObjType}, #{storeId}, #{clockType}},
  11. #{classesName}, #{classesId}, #{operate},
  12. #{leaveOffset}, #{lateOffset}, #{bId}, #{clockTypeValue},#{maxLastOffset})
  13. </insert>
  14. <!-- 查询考勤班次信息(Business) add by wuxw 2018-07-03 -->
  15. <select id="getBusinessAttendanceClassesInfo" parameterType="Map" resultType="Map">
  16. select t.time_offset,t.time_offset timeOffset,t.clock_count,t.clock_count
  17. clockCount,t.classes_obj_type,t.classes_obj_type classesObjType,t.store_id,t.store_id
  18. storeId,t.clock_type,t.clock_type clockType,t.classes_obj_id,t.classes_obj_id
  19. classesObjId,t.classes_name,t.classes_name classesName,t.classes_id,t.classes_id
  20. classesId,t.operate,t.leave_offset,t.leave_offset leaveOffset,t.late_offset,t.late_offset
  21. lateOffset,t.b_id,t.b_id bId,t.clock_type_value,t.clock_type_value clockTypeValue,
  22. t.classes_obj_name,t.classes_obj_name classesObjName
  23. from business_attendance_classes t
  24. where 1 =1
  25. <if test="timeOffset !=null and timeOffset != ''">
  26. and t.time_offset= #{timeOffset}
  27. </if>
  28. <if test="clockCount !=null and clockCount != ''">
  29. and t.clock_count= #{clockCount}
  30. </if>
  31. <if test="classesObjType !=null and classesObjType != ''">
  32. and t.classes_obj_type= #{classesObjType}
  33. </if>
  34. <if test="storeId !=null and storeId != ''">
  35. and t.store_id= #{storeId}
  36. </if>
  37. <if test="clockType !=null and clockType != ''">
  38. and t.clock_type= #{clockType}
  39. </if>
  40. <if test="classesObjId !=null and classesObjId != ''">
  41. and t.classes_obj_id= #{classesObjId}
  42. </if>
  43. <if test="classesName !=null and classesName != ''">
  44. and t.classes_name= #{classesName}
  45. </if>
  46. <if test="classesId !=null and classesId != ''">
  47. and t.classes_id= #{classesId}
  48. </if>
  49. <if test="operate !=null and operate != ''">
  50. and t.operate= #{operate}
  51. </if>
  52. <if test="leaveOffset !=null and leaveOffset != ''">
  53. and t.leave_offset= #{leaveOffset}
  54. </if>
  55. <if test="lateOffset !=null and lateOffset != ''">
  56. and t.late_offset= #{lateOffset}
  57. </if>
  58. <if test="bId !=null and bId != ''">
  59. and t.b_id= #{bId}
  60. </if>
  61. <if test="clockTypeValue !=null and clockTypeValue != ''">
  62. and t.clock_type_value= #{clockTypeValue}
  63. </if>
  64. </select>
  65. <!-- 保存考勤班次信息至 instance表中 add by wuxw 2018-07-03 -->
  66. <insert id="saveAttendanceClassesInfoInstance" parameterType="Map">
  67. insert into attendance_classes(
  68. time_offset,status_cd,clock_count,classes_obj_type,store_id,clock_type,classes_obj_id,classes_name,classes_id,
  69. leave_offset,late_offset,b_id,clock_type_value,classes_obj_name
  70. ) select
  71. t.time_offset,'0',t.clock_count,t.classes_obj_type,t.store_id,t.clock_type,t.classes_obj_id,t.classes_name,t.classes_id,
  72. t.leave_offset,t.late_offset,t.b_id,t.clock_type_value,t.classes_obj_name
  73. from business_attendance_classes t where 1=1
  74. <if test="timeOffset !=null and timeOffset != ''">
  75. and t.time_offset= #{timeOffset}
  76. </if>
  77. <if test="clockCount !=null and clockCount != ''">
  78. and t.clock_count= #{clockCount}
  79. </if>
  80. <if test="classesObjType !=null and classesObjType != ''">
  81. and t.classes_obj_type= #{classesObjType}
  82. </if>
  83. <if test="storeId !=null and storeId != ''">
  84. and t.store_id= #{storeId}
  85. </if>
  86. <if test="clockType !=null and clockType != ''">
  87. and t.clock_type= #{clockType}
  88. </if>
  89. <if test="classesObjId !=null and classesObjId != ''">
  90. and t.classes_obj_id= #{classesObjId}
  91. </if>
  92. <if test="classesName !=null and classesName != ''">
  93. and t.classes_name= #{classesName}
  94. </if>
  95. <if test="classesId !=null and classesId != ''">
  96. and t.classes_id= #{classesId}
  97. </if>
  98. and t.operate= 'ADD'
  99. <if test="leaveOffset !=null and leaveOffset != ''">
  100. and t.leave_offset= #{leaveOffset}
  101. </if>
  102. <if test="lateOffset !=null and lateOffset != ''">
  103. and t.late_offset= #{lateOffset}
  104. </if>
  105. <if test="bId !=null and bId != ''">
  106. and t.b_id= #{bId}
  107. </if>
  108. <if test="clockTypeValue !=null and clockTypeValue != ''">
  109. and t.clock_type_value= #{clockTypeValue}
  110. </if>
  111. </insert>
  112. <!-- 查询考勤班次信息 add by wuxw 2018-07-03 -->
  113. <select id="getAttendanceClassesInfo" parameterType="Map" resultType="Map">
  114. select t.time_offset,t.time_offset timeOffset,t.status_cd,t.status_cd statusCd,t.clock_count,t.clock_count
  115. clockCount,t.store_id,t.store_id
  116. storeId,t.clock_type,t.clock_type clockType,t.classes_name,t.classes_name classesName,t.classes_id,t.classes_id
  117. classesId,t.leave_offset,t.leave_offset leaveOffset,t.late_offset,t.late_offset lateOffset,t.b_id,t.b_id
  118. bId,t.clock_type_value,t.clock_type_value clockTypeValue,t.max_last_offset maxLastOffset,
  119. td.name clockTypeName
  120. from attendance_classes t
  121. left join t_dict td on t.clock_type = td.status_cd and td.table_name = 'attendance_classes'
  122. and td.table_columns = 'clock_type'
  123. where 1 = 1
  124. <if test="timeOffset !=null and timeOffset != ''">
  125. and t.time_offset= #{timeOffset}
  126. </if>
  127. <if test="statusCd !=null and statusCd != ''">
  128. and t.status_cd= #{statusCd}
  129. </if>
  130. <if test="clockCount !=null and clockCount != ''">
  131. and t.clock_count= #{clockCount}
  132. </if>
  133. <if test="storeId !=null and storeId != ''">
  134. and t.store_id= #{storeId}
  135. </if>
  136. <if test="clockType !=null and clockType != ''">
  137. and t.clock_type= #{clockType}
  138. </if>
  139. <if test="classesName !=null and classesName != ''">
  140. and t.classes_name= #{classesName}
  141. </if>
  142. <if test="classesId !=null and classesId != ''">
  143. and t.classes_id= #{classesId}
  144. </if>
  145. <if test="leaveOffset !=null and leaveOffset != ''">
  146. and t.leave_offset= #{leaveOffset}
  147. </if>
  148. <if test="lateOffset !=null and lateOffset != ''">
  149. and t.late_offset= #{lateOffset}
  150. </if>
  151. <if test="maxLastOffset !=null and maxLastOffset != ''">
  152. and t.max_last_offset= #{maxLastOffset}
  153. </if>
  154. <if test="bId !=null and bId != ''">
  155. and t.b_id= #{bId}
  156. </if>
  157. <if test="clockTypeValue !=null and clockTypeValue != ''">
  158. and t.clock_type_value= #{clockTypeValue}
  159. </if>
  160. order by t.create_time desc
  161. <if test="page != -1 and page != null ">
  162. limit #{page}, #{row}
  163. </if>
  164. </select>
  165. <!-- 修改考勤班次信息 add by wuxw 2018-07-03 -->
  166. <update id="updateAttendanceClassesInfoInstance" parameterType="Map">
  167. update attendance_classes t set t.status_cd = #{statusCd}
  168. <if test="newBId != null and newBId != ''">
  169. ,t.b_id = #{newBId}
  170. </if>
  171. <if test="timeOffset !=null and timeOffset != ''">
  172. , t.time_offset= #{timeOffset}
  173. </if>
  174. <if test="clockCount !=null and clockCount != ''">
  175. , t.clock_count= #{clockCount}
  176. </if>
  177. <if test="storeId !=null and storeId != ''">
  178. , t.store_id= #{storeId}
  179. </if>
  180. <if test="clockType !=null and clockType != ''">
  181. , t.clock_type= #{clockType}
  182. </if>
  183. <if test="classesName !=null and classesName != ''">
  184. , t.classes_name= #{classesName}
  185. </if>
  186. <if test="leaveOffset !=null and leaveOffset != ''">
  187. , t.leave_offset= #{leaveOffset}
  188. </if>
  189. <if test="lateOffset !=null and lateOffset != ''">
  190. , t.late_offset= #{lateOffset}
  191. </if>
  192. <if test="maxLastOffset !=null and maxLastOffset != ''">
  193. , t.max_last_offset= #{maxLastOffset}
  194. </if>
  195. <if test="clockTypeValue !=null and clockTypeValue != ''">
  196. , t.clock_type_value= #{clockTypeValue}
  197. </if>
  198. where 1=1
  199. <if test="classesId !=null and classesId != ''">
  200. and t.classes_id= #{classesId}
  201. </if>
  202. <if test="bId !=null and bId != ''">
  203. and t.b_id= #{bId}
  204. </if>
  205. </update>
  206. <!-- 查询考勤班次数量 add by wuxw 2018-07-03 -->
  207. <select id="queryAttendanceClassessCount" parameterType="Map" resultType="Map">
  208. select count(1) count
  209. from attendance_classes t
  210. where 1 =1
  211. <if test="timeOffset !=null and timeOffset != ''">
  212. and t.time_offset= #{timeOffset}
  213. </if>
  214. <if test="statusCd !=null and statusCd != ''">
  215. and t.status_cd= #{statusCd}
  216. </if>
  217. <if test="clockCount !=null and clockCount != ''">
  218. and t.clock_count= #{clockCount}
  219. </if>
  220. <if test="storeId !=null and storeId != ''">
  221. and t.store_id= #{storeId}
  222. </if>
  223. <if test="clockType !=null and clockType != ''">
  224. and t.clock_type= #{clockType}
  225. </if>
  226. <if test="classesName !=null and classesName != ''">
  227. and t.classes_name= #{classesName}
  228. </if>
  229. <if test="classesId !=null and classesId != ''">
  230. and t.classes_id= #{classesId}
  231. </if>
  232. <if test="leaveOffset !=null and leaveOffset != ''">
  233. and t.leave_offset= #{leaveOffset}
  234. </if>
  235. <if test="lateOffset !=null and lateOffset != ''">
  236. and t.late_offset= #{lateOffset}
  237. </if>
  238. <if test="maxLastOffset !=null and maxLastOffset != ''">
  239. and t.max_last_offset= #{maxLastOffset}
  240. </if>
  241. <if test="bId !=null and bId != ''">
  242. and t.b_id= #{bId}
  243. </if>
  244. <if test="clockTypeValue !=null and clockTypeValue != ''">
  245. and t.clock_type_value= #{clockTypeValue}
  246. </if>
  247. </select>
  248. </mapper>