11 changed files with 134 additions and 23 deletions
@ -1,8 +1,18 @@ |
|||
package com.ccsens.health.persist.dao; |
|||
|
|||
import com.ccsens.health.bean.dto.JourneyDto; |
|||
import com.ccsens.health.bean.vo.ClockVo; |
|||
import com.ccsens.health.persist.mapper.SiteMapper; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Repository |
|||
public interface SiteDao extends SiteMapper { |
|||
/** |
|||
* 查询场所信息 |
|||
* @param query |
|||
* @return |
|||
*/ |
|||
List<ClockVo.SiteList> queryAll(JourneyDto.Query query); |
|||
} |
|||
|
@ -0,0 +1,21 @@ |
|||
<?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.SiteDao"> |
|||
|
|||
|
|||
<select id="queryAll" resultType="com.ccsens.health.bean.vo.ClockVo$SiteList"> |
|||
select t.id, t.site_name as siteName, t.site_code as siteCode, t.longitude, t.latitude, t1.qrcode_path as inUrl, t2.qrcode_path as outUrl |
|||
from |
|||
(select * from t_site |
|||
<if test="parentCode != null and parentCode != ''"> |
|||
where parent_code = #{parentCode, jdbcType=VARCHAR} |
|||
</if> |
|||
) t |
|||
left join |
|||
(select * from t_site_qrcode where out_or_in = 0 ) t1 |
|||
on t.id = t1.site_id |
|||
left join |
|||
(select * from t_site_qrcode where out_or_in = 1) t2 |
|||
on t.id = t2.site_id |
|||
</select> |
|||
</mapper> |
Loading…
Reference in new issue