订单时间区间查询修改

This commit is contained in:
liang.chao 2024-12-01 17:54:33 +08:00
parent b70bc3cddc
commit bd97f4a286
1 changed files with 6 additions and 3 deletions

View File

@ -99,7 +99,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND hh.order_status = #{orderStatus} AND hh.order_status = #{orderStatus}
</if> </if>
<if test="startTime != null and endTime != null "> <if test="startTime != null and endTime != null ">
AND hh.rent_begin_time BETWEEN CONCAT(#{startTime}, ' 00:00:00') AND CONCAT(#{endTime}, ' 23:59:59') AND ((hh.rent_begin_time BETWEEN #{startTime} AND #{endTime})
OR (hh.rent_end_time BETWEEN #{startTime} AND #{endTime})
OR (hh.rent_begin_time &lt; #{startTime} AND hh.rent_end_time > #{endTime}))
</if> </if>
<if test="czcompanyName != null and czcompanyName != ''"> <if test="czcompanyName != null and czcompanyName != ''">
AND c.company_name like concat('%',#{czcompanyName},'%') AND c.company_name like concat('%',#{czcompanyName},'%')
@ -169,8 +171,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sd1.dept_name AS companyName sd1.dept_name AS companyName
FROM FROM
sys_dept sd sys_dept sd
JOIN ( SELECT SUBSTRING_INDEX( ancestors, ',', 1 ) AS first_ancestor, dept_id FROM sys_dept ) AS subquery ON sd.dept_id = subquery.dept_id JOIN ( SELECT SUBSTRING_INDEX( ancestors, ',', 2 ) AS first_ancestor, dept_id FROM sys_dept ) AS subquery ON sd.dept_id = subquery.dept_id
LEFT JOIN sys_dept sd1 ON sd1.parent_id = subquery.first_ancestor LEFT JOIN sys_dept sd1 ON sd1.dept_id = subquery.first_ancestor
) dept ON dept.deptId = su.dept_id ) dept ON dept.deptId = su.dept_id
WHERE WHERE
mt.del_flag = '0' and moi.order_id = #{orderId} limit 1 mt.del_flag = '0' and moi.order_id = #{orderId} limit 1
@ -201,5 +203,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND bfi.file_type = 0 AND bfi.file_type = 0
WHERE WHERE
moi.order_id = #{orderId} moi.order_id = #{orderId}
GROUP BY hh.ma_id
</select> </select>
</mapper> </mapper>