<?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.ruoyi.shop.mapper.shop.ShopAppointableTimeMapper">
|
|
|
<select id="pageMyAppointmentList" resultType="com.ruoyi.shop.domain.vo.MyAppointmentListVo">
|
select * from (
|
select
|
a.id,
|
DATE_FORMAT(a.appointment_time, '%Y-%m-%d %H:%i') as appointmentTime,
|
a.status,
|
b.shop_name as shopName,
|
a.reason as cancelReason,
|
CASE WHEN a.`status` in (1, 2) THEN 1 WHEN a.`status` = 3 THEN 2 ELSE 3 END as sort
|
from t_shop_appointable_time a
|
left join t_shop b on (a.shop_id = b.shop_id)
|
where a.user_id = #{userId}
|
<if test="status != null">
|
and a.status = #{status}
|
</if>
|
) as aa order by aa.sort, aa.appointmentTime
|
</select>
|
|
|
|
|
<select id="getShopAppointableTimeList" resultType="com.ruoyi.system.api.domain.poji.shop.TShopAppointableTime">
|
select * from (
|
select
|
a.*,
|
CASE WHEN a.`status` = 3 THEN 3 WHEN a.`status` = 0 THEN 2 ELSE 1 END as sort
|
from t_shop_appointable_time a where shop_id = #{item.shopId}
|
<if test="null != item.status">
|
and a.status = #{item.status}
|
</if>
|
) as aa order by aa.sort,aa.appointment_time
|
</select>
|
|
|
|
<update id="taskUpdateStatus">
|
update t_shop_appointable_time set status = 3 where status in (1, 2) and appointment_time < now()
|
</update>
|
</mapper>
|