LymsOrderMapper.xml 3.33 KB
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
<?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.lyms.talkonlineweb.mapper.LymsOrderMapper">

<resultMap id="BaseResultMap" type="com.lyms.talkonlineweb.domain.LymsOrder">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="orderno" column="orderno" jdbcType="VARCHAR"/>
<result property="pid" column="pid" jdbcType="INTEGER"/>
<result property="pcid" column="pcid" jdbcType="INTEGER"/>
<result property="gid" column="gid" jdbcType="INTEGER"/>
<result property="price" column="price" jdbcType="INTEGER"/>
<result property="cnt" column="cnt" jdbcType="INTEGER"/>
<result property="amount" column="amount" jdbcType="INTEGER"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="payorderid" column="payorderid" jdbcType="VARCHAR"/>
<result property="transactionId" column="transaction_id" jdbcType="VARCHAR"/>
<result property="openid" column="openid" jdbcType="VARCHAR"/>
<result property="serviceStartTime" column="service_start_time" jdbcType="TIMESTAMP"/>
<result property="serviceEndTime" column="service_end_time" jdbcType="TIMESTAMP"/>
<result property="refundStatus" column="refund_status" jdbcType="INTEGER"/>
<result property="payTime" column="pay_time" jdbcType="TIMESTAMP"/>

<result property="createdby" column="createdby" jdbcType="INTEGER"/>
<result property="createdtime" column="createdtime" jdbcType="TIMESTAMP"/>
<result property="updatedby" column="updatedby" jdbcType="INTEGER"/>
<result property="updatedtime" column="updatedtime" jdbcType="TIMESTAMP"/>

</resultMap>

<select id="queryOrderList" parameterType="com.lyms.talkonlineweb.request.OrderRequest"
resultType="com.lyms.talkonlineweb.result.OrderListResponse">

select
p.pname,
p.sex,
p.birth,
p.idno,
o.orderno,
o.pay_time as payTime,
goods.name as goodName,
o.refund_status as refundStatus,
o.cnt,
o.pcid
from lyms_patient p,
lyms_order o ,
lyms_goods goods
where p.id = o.pid
and o.gid = goods.id
and o.status = 1
<if test="orderRequest.key != null and orderRequest.key != '' ">
and (p.pname = #{orderRequest.key} or p.enrolment_phone = #{orderRequest.key} or p.idno= #{orderRequest.key})
</if>
<if test="orderRequest.orderType != null and orderRequest.orderType == 1">
and ( o.pcid is not null)
</if>
<if test="orderRequest.orderType != null and orderRequest.orderType == 2">
and ( o.pcid is null)
</if>
<if test="orderRequest.payTimeStart != null and orderRequest.payTimeStart != ''">
and ( o.pay_time > #{orderRequest.payTimeStart})
</if>

<if test="orderRequest.payTimeEnd != null and orderRequest.payTimeEnd != ''">
and ( o.pay_time &lt; #{orderRequest.payTimeEnd})
</if>

order by o.pay_time desc

</select>
</mapper>