MedGuardian.xml 1.87 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
<?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.MedGuardianMapper">

<resultMap id="MedGuardianResultMap" type="com.lymsh.yimiao.main.data.model.MedGuardian">
<result column="g_id" property="id" jdbcType="VARCHAR" />
<result column="g_name" property="name" jdbcType="VARCHAR" />
<result column="g_relationid" property="relationId" jdbcType="VARCHAR" />
<result column="g_linkway" property="linkWay" jdbcType="VARCHAR" />
</resultMap>

<select id="getMedGuardian" resultMap="MedGuardianResultMap" parameterType="java.lang.String">
select g_id,g_name,g_relationid,g_linkway
FROM med_guardian
WHERE g_id = g_id = #{id,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="MedGuardianCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and g_id = #{id,jdbcType=VARCHAR}
</if>
<if test="name != null and name != ''">
and g_name = #{name,jdbcType=VARCHAR}
</if>
<if test="relationId != null and relationId != ''">
and g_relationid = #{relationId,jdbcType=VARCHAR}
</if>
<if test="linkWay != null and linkWay != ''">
and g_linkway = #{linkWay,jdbcType=VARCHAR}
</if>
</where>
</sql>



<select id="queryMedGuardian" resultMap="MedGuardianResultMap" parameterType="com.lymsh.yimiao.main.data.model.MedGuardianQuery">
select g_id,g_name,g_relationid,g_linkway
from med_guardian
<include refid="MedGuardianCondition" />
<include refid="orderAndLimit" />
</select>



<select id="queryMedGuardianCount" resultType="int" parameterType="com.lymsh.yimiao.main.data.model.MedGuardianQuery">
select count(1) from med_guardian
<include refid="MedGuardianCondition" />
</select>



</mapper>