You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 lines
1.8 KiB

<?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.ccsens.health.persist.dao.RealNameAuthDao">
<resultMap id="resultMap_trackInfo" type="com.ccsens.health.bean.vo.UserVo$TrackInfo">
<id column="id" property="id"/>
<result column="userId" property="userId"/>
<result column="name" property="name"/>
<result column="wkno" property="wkno"/>
<collection property="clockInList" ofType="com.ccsens.health.bean.vo.UserVo$ClockIn">
<id column="cId" property="id"/>
<result column="cName" property="name"/>
<result column="cTime" property="time"/>
<result column="cOutTime" property="outTime"/>
<result column="cType" property="type"/>
</collection>
</resultMap>
<select id="selectTrackInfoByWkno" resultMap="resultMap_trackInfo" parameterType="java.util.Map">
select
m.id as id,
m.name as name,
m.wkno as wkno,
s.id as cId,
s.site_name as cName,
sc.time as cTime,
sc.out_time as cOutTime
from
t_site s right JOIN t_site_qrcode sq on sq.site_id = s.id
right JOIN t_site_clock_in sc on sc.site_id = s.id
right JOIN t_real_name_auth r on sc.user_id = r.user_id
join t_member m on r.no = m.wkno
where
m.rec_status = 0
<if test="name != null and name !=''">
and
m.name = #{name}
</if>
<if test="wkno != null and wkno !=''">
and
m.wkno = #{wkno}
</if>
and
sc.time &lt;= #{endTime}
and
sc.time &gt;= #{startTime}
ORDER By sc.time DESC
</select>
</mapper>