AppointmentMapper.xml 1.72 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
<?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>


<select id="queryAppointment" resultMap="BaseResultMap">
select * from appointment
where
1=1
<if test="doctor!=null">
and doctor=#{doctor}
</if>

<if test="name!=null">
and (name like concat("%",#{name},"%") or pinyin like concat("%",#{name},"%"))
</if>
<if test="dept!=null">
and dept=#{dept}
</if>
and <![CDATA[checkTime>=#{startTime}]]>
and <![CDATA[checkTime<=#{endTime}]]>
</select>
</mapper>