|
@@ -29,12 +29,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</resultMap>
|
|
|
|
|
|
<select id="queryAllPageList" resultType="com.ruoyi.info.order.domain.vo.OrderVo">
|
|
|
-
|
|
|
+ <include refid="queryList"/>
|
|
|
</select>
|
|
|
|
|
|
<select id="queryAllList" resultType="com.ruoyi.info.order.domain.vo.OrderVo">
|
|
|
-
|
|
|
+ <include refid="queryList"/>
|
|
|
</select>
|
|
|
|
|
|
+ <sql id="queryList">
|
|
|
+ select o.*, u.mobile as userMobile, sp.name as serviceName from tb_order o
|
|
|
+ left join tb_user u on u.id = o.user_id
|
|
|
+ left join tb_service_product sp on sp.id = o.service_id
|
|
|
+ <where>
|
|
|
+ <if test="bo.orderNo != null and bo.orderNo != ''">
|
|
|
+ and o.order_no like concat('%', #{bo.orderNo}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.userId != null">
|
|
|
+ and o.user_id = #{bo.userId}
|
|
|
+ </if>
|
|
|
+ <if test="bo.status != null">
|
|
|
+ and o.status = #{bo.status.code}
|
|
|
+ </if>
|
|
|
+ <if test="bo.hospitalId != null">
|
|
|
+ and o.hospital_id = #{bo.hospitalId}
|
|
|
+ </if>
|
|
|
+ <if test="bo.userMobile != null and bo.userMobile != ''">
|
|
|
+ and u.mobile like concat('%', #{bo.userMobile}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.serviceName != null and bo.serviceName != ''">
|
|
|
+ and sp.name like concat('%', #{bo.serviceName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="bo.startTime != null">
|
|
|
+ and o.create_time >= #{bo.startTime}
|
|
|
+ </if>
|
|
|
+ <if test="bo.endTime != null">
|
|
|
+ and o.create_time <![CDATA[ <= ]]> #{bo.endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by o.create_time desc
|
|
|
+ </sql>
|
|
|
|
|
|
</mapper>
|