AttendanceClassesServiceDaoImplMapper.xml 11 KB

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