AppointmentMapper.xml 2.97 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
<?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.platform.permission.dao.master.AppointmentMapper">

<resultMap id="BaseResultMap" type="com.lyms.platform.pojo.AppointmentModel">
<id property="id" column="id" jdbcType="INTEGER"/>
<result property="vccardNo" column="vccardNo" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="sex" column="sex" jdbcType="VARCHAR"/>
<result property="age" column="age" jdbcType="VARCHAR"/>
<result property="phone" column="phone" jdbcType="VARCHAR"/>
<result property="idCard" column="idCard" jdbcType="VARCHAR"/>
<result property="dept" column="dept" jdbcType="VARCHAR"/>
<result property="bhNum" column="bhNum" jdbcType="VARCHAR"/>
<result property="doctor" column="doctor" jdbcType="VARCHAR"/>
<result property="pinyin" column="pinyin" jdbcType="VARCHAR"/>
<result property="created" column="created" jdbcType="TIMESTAMP"/>
<result property="checkTime" column="checkTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="orderAndLimit">
<if test="need != null">
limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
</if>
</sql>

<select id="queryAppointment" resultMap="BaseResultMap" parameterType="com.lyms.platform.permission.model.AppointmentQuery">
select * from appointment
where
1=1
<if test="doctor!=null">
and doctor=#{doctor}
</if>
<if test="idCard!=null">
and idCard=#{idCard}
</if>
<if test="name!=null">
and (name like concat('%',#{name},'%') or pinyin like concat('%',#{name},'%'))
</if>
<if test="dept!=null">
and (dept like concat(#{dept},'%') or (dept like concat("产后",'%') and dept !='产后服务部'))
</if>
<if test="deptName!=null">
and dept=#{deptName}
</if>
and <![CDATA[checkTime>=#{startTime}]]>
and <![CDATA[checkTime<=#{endTime}]]>
<include refid="orderAndLimit"/>
</select>

<select id="queryAppointmentCount" resultType="int" parameterType="com.lyms.platform.permission.model.AppointmentQuery">
select count(id) from appointment
where
1=1
<if test="doctor!=null">
and doctor=#{doctor}
</if>
<if test="idCard!=null">
and idCard=#{idCard}
</if>
<if test="name!=null">
and (name like concat('%',#{name},'%') or pinyin like concat('%',#{name},'%'))
</if>
<if test="dept!=null">
and (dept like concat(#{dept},'%') or (dept like concat("产后",'%') and dept !='产后服务部'))
</if>
and <![CDATA[checkTime>=#{startTime}]]>
and <![CDATA[checkTime<=#{endTime}]]>
</select>
</mapper>