AttendanceLogServiceDaoImplMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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="attendanceLogServiceDaoImpl">
  6. <!-- 保存考勤日志信息 add by wuxw 2018-07-03 -->
  7. <insert id="saveAttendanceLogInfo" parameterType="Map">
  8. insert into attendance_log(
  9. department_name,department_id,staff_name,log_id,store_id,staff_id,clock_time,face_path
  10. ) values (
  11. #{departmentName},#{departmentId},#{staffName},#{logId},#{storeId},#{staffId},#{clockTime},#{facePath}
  12. )
  13. </insert>
  14. <!-- 查询考勤日志信息 add by wuxw 2018-07-03 -->
  15. <select id="getAttendanceLogInfo" parameterType="Map" resultType="Map">
  16. select t.department_name,t.department_name departmentName,t.department_id,t.department_id
  17. departmentId,t.staff_name,t.staff_name staffName,t.log_id,t.log_id logId,t.status_cd,t.status_cd
  18. statusCd,t.store_id,t.store_id storeId,t.staff_id,t.staff_id staffId,t.clock_time,t.clock_time clockTime,
  19. t.face_path facePath
  20. from attendance_log t
  21. where 1 =1
  22. <if test="departmentName !=null and departmentName != ''">
  23. and t.department_name= #{departmentName}
  24. </if>
  25. <if test="departmentId !=null and departmentId != ''">
  26. and t.department_id= #{departmentId}
  27. </if>
  28. <if test="staffName !=null and staffName != ''">
  29. and t.staff_name like concat('%', #{staffName},'%')
  30. </if>
  31. <if test="logId !=null and logId != ''">
  32. and t.log_id= #{logId}
  33. </if>
  34. <if test="statusCd !=null and statusCd != ''">
  35. and t.status_cd= #{statusCd}
  36. </if>
  37. <if test="storeId !=null and storeId != ''">
  38. and t.store_id= #{storeId}
  39. </if>
  40. <if test="staffId !=null and staffId != ''">
  41. and t.staff_id= #{staffId}
  42. </if>
  43. <if test="clockTime !=null and clockTime != ''">
  44. and DATE_FORMAT(t.clock_time,'%Y-%m-%d')= #{clockTime}
  45. </if>
  46. order by t.create_time desc
  47. <if test="page != -1 and page != null ">
  48. limit #{page}, #{row}
  49. </if>
  50. </select>
  51. <!-- 修改考勤日志信息 add by wuxw 2018-07-03 -->
  52. <update id="updateAttendanceLogInfo" parameterType="Map">
  53. update attendance_log t set t.status_cd = #{statusCd}
  54. <if test="newBId != null and newBId != ''">
  55. ,t.b_id = #{newBId}
  56. </if>
  57. <if test="departmentName !=null and departmentName != ''">
  58. , t.department_name= #{departmentName}
  59. </if>
  60. <if test="departmentId !=null and departmentId != ''">
  61. , t.department_id= #{departmentId}
  62. </if>
  63. <if test="staffName !=null and staffName != ''">
  64. , t.staff_name= #{staffName}
  65. </if>
  66. <if test="storeId !=null and storeId != ''">
  67. , t.store_id= #{storeId}
  68. </if>
  69. <if test="staffId !=null and staffId != ''">
  70. , t.staff_id= #{staffId}
  71. </if>
  72. <if test="clockTime !=null and clockTime != ''">
  73. , t.clock_time= #{clockTime}
  74. </if>
  75. <if test="facePath !=null and facePath != ''">
  76. , t.face_path = #{facePath}
  77. </if>
  78. where 1=1
  79. <if test="logId !=null and logId != ''">
  80. and t.log_id= #{logId}
  81. </if>
  82. </update>
  83. <!-- 查询考勤日志数量 add by wuxw 2018-07-03 -->
  84. <select id="queryAttendanceLogsCount" parameterType="Map" resultType="Map">
  85. select count(1) count
  86. from attendance_log t
  87. where 1 =1
  88. <if test="departmentName !=null and departmentName != ''">
  89. and t.department_name= #{departmentName}
  90. </if>
  91. <if test="departmentId !=null and departmentId != ''">
  92. and t.department_id= #{departmentId}
  93. </if>
  94. <if test="staffName !=null and staffName != ''">
  95. and t.staff_name= #{staffName}
  96. </if>
  97. <if test="logId !=null and logId != ''">
  98. and t.log_id= #{logId}
  99. </if>
  100. <if test="statusCd !=null and statusCd != ''">
  101. and t.status_cd= #{statusCd}
  102. </if>
  103. <if test="storeId !=null and storeId != ''">
  104. and t.store_id= #{storeId}
  105. </if>
  106. <if test="staffId !=null and staffId != ''">
  107. and t.staff_id= #{staffId}
  108. </if>
  109. <if test="clockTime !=null and clockTime != ''">
  110. and DATE_FORMAT(t.clock_time,'%Y-%m-%d')= #{clockTime}
  111. </if>
  112. </select>
  113. </mapper>