<?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>