<?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.pz.system.mapper.ZqghOrderMapper"> <resultMap type="com.pz.system.domain.ZqghOrder" id="ZqghOrderResult"> <result property="id" column="id"/> <result property="orderId" column="order_id"/> <result property="hid" column="hid"/> <result property="did" column="did"/> <result property="doctorId" column="doctor_id"/> <result property="timeOfAppointment" column="time_of_appointment"/> <result property="status" column="status"/> <result property="overTime" column="over_time"/> <result property="voucher" column="voucher"/> <result property="isCal" column="is_cal"/> <result property="delFlag" column="del_flag"/> <result property="createBy" column="create_by"/> <result property="createTime" column="create_time"/> <result property="updateBy" column="update_by"/> <result property="updateTime" column="update_time"/> <result property="remark" column="remark"/> </resultMap> <select id="findZqghOrderVoPage" resultType="com.pz.system.domain.vo.ZqghOrderVo"> SELECT yyod.id as id, tlo.order_sn AS orderSn, tlo.pay_money AS PayMoney, s.`name` AS serviceName, c.`name` AS cityName, d.title AS title, tlo.remark AS remark, yyod.`status` AS yStatus, h.`name` AS hName, tlo.`status` AS tStatus, tlo.is_satisfaction AS isSatisfaction, tlo.evaluation_content AS evaluationContent, yyod.over_time AS overtime, yyod.voucher AS voucher, su.user_name AS userName, yyod.create_Time as createTime, yyod.time_of_appointment as timeOfAppointment FROM zqgh_order AS yyod LEFT JOIN total_order AS tlo ON yyod.order_id = tlo.id LEFT JOIN city AS c ON c.id = tlo.city_id LEFT JOIN hospital AS h ON h.id = yyod.hid LEFT JOIN department AS d ON d.id = yyod.did LEFT JOIN doctor AS s ON s.id = yyod.doctor_id LEFT JOIN sys_user as su on su.user_id = tlo.uid <where> <if test="bo.orderSn != null and bo.orderSn != ''"> and tlo.order_sn LIKE CONCAT('%', #{bo.orderSn}, '%') </if> <if test="bo.startTime != null and bo.startTime != '' and bo.endTime != null and bo.endTime != ''"> and yyod.create_time > = #{bo.startTime} and yyod.create_time < = #{bo.endTime} </if> and yyod.create_time < NOW() </where> order by tlo.create_time desc </select> <select id="selectSonOrderInfoByTotalId" resultType="com.pz.merchant.domain.vo.SonOrderVo"> select user.nick_name as userName, zqgh_order.status as orderStatus, user.avatar, zqgh_order.id as sonOrderId from zqgh_order left join total_order on total_order.id = zqgh_order.order_id left join sys_user as user on user.user_id = total_order.uid where zqgh_order.order_id = #{id} </select> <select id="selectZqghOrderDetailDateByTotalId" resultType="com.pz.system.domain.vo.ZqghOrderItemVo"> select total_order.id as orderId, zqgh_order.id as serviceOrderId, total_order.business_id, total_order.status as orderStatus, zqgh_order.status as serviceStatus, hospital.name as hospital, zqgh_order.did_name as department, zqgh_order.time_of_appointment as visitTime, total_order.uid as userId, doctor.name as doctor from total_order left join zqgh_order on zqgh_order.id = total_order.id left join hospital on zqgh_order.hid = hospital.id left join department on department.id = zqgh_order.did left join doctor on zqgh_order.doctor_id = doctor.id where total_order.id = #{id} </select> <select id="selectFinishTime" resultType="java.lang.String"> select DATE_FORMAT(time_of_appointment, '%Y-%m-%d') FROM total_order t left join zqgh_order d on d.order_id = t.id where t.id = #{id} </select> </mapper>