| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.template.mapper.SmartAttendanceMapper">
- <select id="getGroup" resultType="java.lang.Integer">
- SELECT
- `status`
- FROM
- `smart_attendance`
- GROUP BY
- `status`
- </select>
- <select id="askForLeavePage" resultType="com.template.model.vo.AskForLeaveVo">
- SELECT
- sa.id,
- su.head_image as image,
- sa.xw_user_name,
- su.card_no,
- sa.start_time,
- sa.end_time,
- sa.reason,
- sa.if_verification,
- sa.initiate_time
- FROM
- `smart_attendance` sa
- LEFT JOIN smart_user su ON su.id = sa.user_id
- WHERE
- sa.`status` = 6
- AND sa.deleted = 0
- <if test="name != null and name != ''">
- and sa.xw_user_name = #{name}
- </if>
- <if test="cardNo != null and cardNo != ''">
- and su.card_no = #{cardNo}
- </if>
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
- and sa.initiate_time >= #{startTime} and sa.initiate_time <= #{endTime}
- </if>
- <if test="ifVerification != null and ifVerification != ''">
- and sa.if_verification = #{ifVerification}
- </if>
- <if test="classId != null and classId != ''">
- and sa.class_id = #{classId}
- </if>
- ORDER BY sa.initiate_time desc
- </select>
- <select id="queryPage" resultType="com.template.model.vo.SmartAttendanceVo">
- SELECT
- sa.id,
- sa.xw_user_name as name,
- sc.`name` as className,
- sg.`name` as gradeName,
- su.card_no as cardNo,
- su.head_image as headImage,
- sa.attend_time as attendTime,
- sa.initiate_time as initiateTime,
- sa.`status`
- FROM
- `smart_attendance` sa
- LEFT JOIN smart_class sc on sa.class_id=sc.id
- LEFT JOIN smart_grade sg on sc.grade_id=sg.id
- LEFT JOIN smart_user su on sa.user_id=su.id
- where sa.deleted = 0
- <if test="gradeId != null and gradeId != ''">
- and sc.grade_id=#{gradeId}
- </if>
- <if test="classId != null and classId != ''">
- and sa.class_id = #{classId}
- </if>
- <if test="status != null and status != ''">
- and sa.`status` = #{status}
- </if>
- <if test="studentNo != null and studentNo != ''">
- and su.card_no = #{studentNo}
- </if>
- <if test="name != null and name != ''">
- and sa.xw_user_name = #{name}
- </if>
- <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
- and sa.attend_time >= #{startTime} and sa.attend_time <= #{endTime}
- </if>
- ORDER BY sa.create_time desc
- </select>
- </mapper>
|