MedEmployee.xml 1.65 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
<?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>