<?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.lymsh.yimiao.main.data.dao.MedEmployeeMapper">
<resultMap id="MedEmployeeResultMap" type="com.lymsh.yimiao.main.data.model.MedEmployee">
<result column="e_id" property="eId" jdbcType="VARCHAR" />
<result column="e_name" property="eName" jdbcType="VARCHAR" />
<result column="e_sex" property="eSex" jdbcType="VARCHAR" />
</resultMap>
<select id="getMedEmployee" resultMap="MedEmployeeResultMap" parameterType="java.lang.String">
select e_id,e_name,e_sex
from med_employee
WHERE e_id = #{eId,jdbcType=VARCHAR}
</select>
<sql id="orderAndLimit">
<if test="sort != null and sort != '' ">
order by ${sort}
<if test="need != null">
limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
</if>
</if>
</sql>
<sql id="MedEmployeeCondition">
<where>
1 = 1
<if test="eId != null and eId != ''">
and e_id = #{eId,jdbcType=VARCHAR}
</if>
<if test="eName != null and eName != ''">
and e_name = #{eName,jdbcType=VARCHAR}
</if>
<if test="eSex != null and eSex != ''">
and e_sex = #{eSex,jdbcType=VARCHAR}
</if>
</where>
</sql>
<select id="queryMedEmployee" resultMap="MedEmployeeResultMap" parameterType="com.lymsh.yimiao.main.data.model.MedEmployeeQuery">
select e_id,e_name,e_sex
from med_employee
<include refid="MedEmployeeCondition" />
<include refid="orderAndLimit" />
</select>
<select id="queryMedEmployeeCount" resultType="int" parameterType="com.lymsh.yimiao.main.data.model.MedEmployeeQuery">
select count(1) from med_employee
<include refid="MedEmployeeCondition" />
</select>
</mapper>