0675583f
王彪总
fix(config): 更新配置...
|
6
7
|
INSERT INTO attendance_record(id, user_id, user_name, work_type, punch_type, punch_time, punch_address, longitude, latitude, store_id, photo_url, create_time)
VALUES(#{id}, #{userId}, #{userName}, #{workType}, #{punchType}, #{punchTime}, #{punchAddress}, #{longitude}, #{latitude}, #{storeId}, #{photoUrl}, NOW())
|
88e030b7
王彪总
init project
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
</insert>
<select id="queryAttendanceRecords" parameterType="map" resultType="map">
SELECT * FROM attendance_record WHERE 1=1
<if test="userId != null and userId != ''">AND user_id = #{userId}</if>
<if test="workType != null and workType != ''">AND work_type = #{workType}</if>
<if test="punchType != null and punchType != ''">AND punch_type = #{punchType}</if>
<if test="startTime != null and startTime != ''">AND punch_time >= #{startTime}</if>
<if test="endTime != null and endTime != ''">AND punch_time <= #{endTime}</if>
<if test="storeId != null and storeId != ''">AND store_id = #{storeId}</if>
ORDER BY punch_time DESC
<if test="page != null and page != '' and row != null and row != ''">
LIMIT #{page}, #{row}
</if>
</select>
<select id="queryAttendanceRecordsCount" parameterType="map" resultType="map">
SELECT COUNT(1) count FROM attendance_record WHERE 1=1
<if test="userId != null and userId != ''">AND user_id = #{userId}</if>
<if test="workType != null and workType != ''">AND work_type = #{workType}</if>
<if test="punchType != null and punchType != ''">AND punch_type = #{punchType}</if>
<if test="startTime != null and startTime != ''">AND punch_time >= #{startTime}</if>
<if test="endTime != null and endTime != ''">AND punch_time <= #{endTime}</if>
<if test="storeId != null and storeId != ''">AND store_id = #{storeId}</if>
</select>
<select id="queryTodayAttendanceByType" parameterType="map" resultType="map">
SELECT * FROM attendance_record
WHERE user_id = #{userId} AND punch_type = #{punchType}
AND DATE(punch_time) = CURDATE()
LIMIT 1
</select>
|
6a812631
王彪总
fix(config): 更新配置...
|
41
42
43
44
45
46
47
48
49
50
51
52
53
|
<select id="countTodayByType" parameterType="map" resultType="int">
SELECT COUNT(1) FROM attendance_record
WHERE user_id = #{userId} AND punch_type = #{punchType}
AND DATE(punch_time) = CURDATE()
</select>
<select id="getLastPunch" parameterType="map" resultType="map">
SELECT * FROM attendance_record
WHERE user_id = #{userId}
ORDER BY punch_time DESC
LIMIT 1
</select>
|