<?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.dsh.other.mapper.SiteMapper">
|
|
|
<select id="querySiteList" resultType="com.dsh.other.model.QuerySiteListVo">
|
select
|
a.id,
|
a.`name`,
|
c.`name` as siteTypeName,
|
b.`name` as storeName,
|
b.address as storeAddress,
|
b.lon as storeLon,
|
b.lat as storeLat,
|
CONCAT(a.appointmentStartTime, '-', a.appointmentEndTime) as times,
|
a.cashPrice as price
|
from t_site a
|
left join t_store b on (a.storeId = b.id)
|
left join t_site_type c on (a.siteTypeId = c.id)
|
where a.state = 1
|
<if test="null != item.startTime and '' != item.startTime and null != item.endTime and '' != item.endTime">
|
and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentStartTime) <= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', #{item.startTime}) and CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', a.appointmentEndTime) >= CONCAT(DATE_FORMAT(now(), '%Y-%m-%d'), ' ', #{item.endTime})
|
</if>
|
<if test="null != item.siteTypeId">
|
and a.siteTypeId = #{item.siteTypeId}
|
</if>
|
<if test="null != item.cityCode">
|
and b.cityCode = #{item.cityCode}
|
</if>
|
<if test="null != item.storeId">
|
and a.storeId = #{item.storeId}
|
</if>
|
<if test="null != item.search and '' != item.search">
|
and (a.name like CONCAT('%', #{item.search}, '%') or b.name like CONCAT('%', #{item.search}, '%'))
|
</if>
|
order by a.insertTime desc limit #{item.pageNum}, #{item.pageSize}
|
</select>
|
|
|
|
<select id="queryMySite" resultType="com.dsh.other.model.QueryMySiteVo">
|
select
|
a.id,
|
b.`name` as `name`,
|
d.`name` as siteTypeName,
|
c.`name` as storeName,
|
c.address as storeAddress,
|
c.lon as storeLon,
|
c.lat as storeLat,
|
a.payMoney as payMoney,
|
CONCAT(DATE_FORMAT(a.startTime, '%Y-%m-%d %H:%i'), '-', DATE_FORMAT(a.endTime, '%H:%i')) as appointment,
|
a.`status`,
|
UNIX_TIMESTAMP(a.insertTime) * 1000 as insertTime
|
from t_site_booking a
|
left join t_site b on (a.siteId = b.id)
|
left join t_store c on (b.storeId = c.id)
|
left join t_site_type d on (b.siteTypeId = d.id)
|
where a.state = 1 and a.appUserId = #{uid}
|
<if test="null != status">
|
and a.status = #{status}
|
</if>
|
order by a.insertTime desc limit #{pageNo}, #{pageSize}
|
</select>
|
</mapper>
|