13 changed files with 211 additions and 40 deletions
@ -0,0 +1,13 @@ |
|||||
|
package com.ccsens.health.persist.dao; |
||||
|
|
||||
|
import com.ccsens.health.bean.vo.ClockVo; |
||||
|
import com.ccsens.health.persist.mapper.SiteClockInMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Repository |
||||
|
public interface SiteClockInDao extends SiteClockInMapper { |
||||
|
List<ClockVo.SiteClockInfo> selectHealthInfoByDate(@Param("employee")Long employee, @Param("startTime")Long startTime, @Param("endTime")Long endTime); |
||||
|
} |
||||
@ -0,0 +1,8 @@ |
|||||
|
package com.ccsens.health.persist.dao; |
||||
|
|
||||
|
import com.ccsens.health.persist.mapper.SiteQrcodeMapper; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
@Repository |
||||
|
public interface SiteQrcodeDao extends SiteQrcodeMapper { |
||||
|
} |
||||
@ -0,0 +1,48 @@ |
|||||
|
<?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.SiteClockInDao"> |
||||
|
<resultMap id="resultMap_siteClick" type="com.ccsens.health.bean.vo.ClockVo$SiteClockInfo"> |
||||
|
<id column="sId" property="siteId"/> |
||||
|
<result column="sSiteName" property="siteName"/> |
||||
|
<result column="sTime" property="time"/> |
||||
|
<result column="sLongitude" property="longitude"/> |
||||
|
<result column="sLatitude" property="latitude"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<select id="selectHealthInfoByDate" resultMap="resultMap_siteClick" parameterType="java.util.Map"> |
||||
|
select |
||||
|
s.id as sId, |
||||
|
c.employee_id as sSiteName, |
||||
|
c.time as sTime, |
||||
|
s.district as sLongitude, |
||||
|
s.address as sLatitude |
||||
|
from |
||||
|
t_site_clock_in c join t_site_qrcode q on q.id = c.qrcode_id join t_site s on q.site_id = s.id |
||||
|
where |
||||
|
c.rec_status = 0 |
||||
|
and |
||||
|
c.employee_id = #{employeeId} |
||||
|
and |
||||
|
c.time <= #{endTime} |
||||
|
and |
||||
|
c.time >= #{startTime} |
||||
|
ORDER By c.time DESC |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectByTypeId" parameterType="java.util.Map" resultType="int"> |
||||
|
|
||||
|
select |
||||
|
COUNT(*) |
||||
|
from |
||||
|
t_health_records h |
||||
|
where |
||||
|
h.rec_status = 0 |
||||
|
and |
||||
|
h.health_type_id = #{healthTypeId} |
||||
|
and |
||||
|
h.time <= #{endTime} |
||||
|
and |
||||
|
h.time >= #{startTime} |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
||||
Loading…
Reference in new issue