| | |
| | | order by o.createTime desc |
| | | </select> |
| | | |
| | | <select id="excelExportList" resultMap="BaseResultMap"> |
| | | select * |
| | | from t_order o |
| | | <where> |
| | | o.is_delete = 0 |
| | | <if test="data.fake != null "> |
| | | and o.fake = #{data.fake} |
| | | </if> |
| | | <if test="data.address != null and data.address != ''"> |
| | | and o.reservation_address like concat('%', #{data.address}, '%') |
| | | </if> |
| | | <if test="data.orderNumber != null and data.orderNumber != ''"> |
| | | and o.order_number like concat('%', #{data.orderNumber}, '%') |
| | | </if> |
| | | <if test="data.cityName != null and data.cityName != ''"> |
| | | and o.city like concat('%', #{data.cityName}, '%') |
| | | </if> |
| | | <if test="data.cityList != null and data.cityList.size() != 0"> |
| | | and o.city_code in |
| | | <foreach collection="data.cityList" item="c" open="(" separator="," close=")"> |
| | | #{c} |
| | | </foreach> |
| | | </if> |
| | | <if test="data.servIds != null and data.servIds.size() != 0"> |
| | | and o.serve_id in |
| | | <foreach collection="data.servIds" item="c" open="(" separator="," close=")"> |
| | | #{c} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="data.reservationName != null and data.reservationName != ''"> |
| | | and o.reservation_name like concat('%', #{data.reservationName}, '%') |
| | | </if> |
| | | <if test="data.reservationPhone != null and data.reservationPhone != ''"> |
| | | and o.reservation_phone like concat('%', #{data.reservationPhone}, '%') |
| | | </if> |
| | | <if test="data.state != null"> |
| | | and o.state = #{data.state} |
| | | </if> |
| | | <if test="data.type != null"> |
| | | and o.type = #{data.type} |
| | | </if> |
| | | <if test="data.workerName != null and data.workerName != ''"> |
| | | and o.server_name like concat('%', #{data.workerName}, '%') |
| | | </if> |
| | | <if test="data.workerPhone != null and data.workerPhone != ''"> |
| | | and o.server_phone like concat('%', #{data.workerPhone}, '%') |
| | | </if> |
| | | <if test="data.serveName != null and data.serveName != ''"> |
| | | and o.site_name like concat('%', #{data.serveName}, '%') |
| | | </if> |
| | | <if test="data.orderTimeStart != null and data.orderTimeStart != ''"> |
| | | and DATE(o.createTime) <![CDATA[ >= ]]> #{data.orderTimeStart} |
| | | </if> |
| | | <if test="data.orderTimeEnd != null and data.orderTimeEnd != ''"> |
| | | and DATE(o.createTime) <![CDATA[ <= ]]> #{data.orderTimeEnd} |
| | | </if> |
| | | <if test="data.startTime != null and data.startTime != ''"> |
| | | and STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', 1), '%Y-%m-%d %H:%i') <![CDATA[ >= ]]> #{data.startTime} |
| | | </if> |
| | | <if test="data.endTime != null and data.endTime != ''"> |
| | | AND STR_TO_DATE(SUBSTRING_INDEX(time, ' - ', -1), '%Y-%m-%d %H:%i') <![CDATA[ <= ]]> #{data.endTime} |
| | | </if> |
| | | <if test="data.completeTimeStart != null and data.completeTimeStart != ''"> |
| | | and DATE(o.complete_time) <![CDATA[ >= ]]> #{data.completeTimeStart} |
| | | </if> |
| | | <if test="data.completeTimeEnd != null and data.completeTimeEnd != ''"> |
| | | and DATE(o.complete_time) <![CDATA[ <= ]]> #{data.completeTimeEnd} |
| | | </if> |
| | | </where> |
| | | order by o.createTime desc |
| | | </select> |
| | | |
| | | <select id="orderPageCount" resultType="com.ruoyi.order.entity.Order"> |
| | | select |
| | | sum(case when o.state = 0 then 1 end) as toBeDispatched, |