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.

29 lines
1.0 KiB

6 years ago
<?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.ct.persist.dao.SiteClockInDao">
<resultMap id="resultMap_siteClock" type="com.ccsens.ct.bean.vo.ClockVo$ClockStatistics">
<result column="sSiteName" property="siteName"/>
<result column="sType" property="type"/>
<result column="sTime" property="time"/>
</resultMap>
<select id="selectClockStatistics" resultMap="resultMap_siteClock" parameterType="java.util.Map">
select
s.site_name as sSiteName,
q.out_or_in as sType,
c.time as sTime
from
t_site s join t_site_qrcode q on q.site_id = s.id
join t_site_clock_in c on c.qrcode_id = q.id
where
s.rec_status = 0
<if test="businessId != null">
and
s.business_id = #{businessId}
</if>
and
c.user_id = #{userId}
ORDER By c.time DESC
</select>
</mapper>