MedKids.xml 3.26 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
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
<?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.MedKidsMapper">

<resultMap id="MedKidsResultMap" type="com.lymsh.yimiao.main.data.model.MedKids">
<result column="ki_id" property="id" jdbcType="VARCHAR" />
<result column="ki_name" property="name" jdbcType="VARCHAR" />
<result column="ki_sex" property="sex" jdbcType="VARCHAR" />
<result column="ki_birthday" property="birthday" jdbcType="VARCHAR" />
<result column="ki_guardianid" property="guardianId" jdbcType="VARCHAR" />
<result column="ki_currentOrganizationid" property="currentOrganizationId" jdbcType="VARCHAR" />
<result column="ki_barCode" property="barCode" jdbcType="VARCHAR" />
<result column="phone" property="phone" jdbcType="VARCHAR" />
<result column="ki_buildoper" property="buildOPer" jdbcType="VARCHAR" />
<result column="ki_buildtime" property="buildTime" jdbcType="VARCHAR" />
<result column="isdelete" property="isDelete" jdbcType="VARCHAR" />
</resultMap>

<select id="getMedKids" resultMap="MedKidsResultMap" parameterType="java.lang.String">
select ki_id,ki_name,ki_sex,ki_birthday,ki_guardianid,ki_currentOrganizationid,ki_barCode,phone,ki_buildoper, ki_buildtime,isdelete,fathername,mothername
from med_kids
WHERE ki_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="MedKidsCondition">
<where>
1 = 1
<if test="id != null and id != ''">
and ki_id = #{id,jdbcType=VARCHAR}
</if>
<if test="name != null and name != ''">
and ki_name = #{name,jdbcType=VARCHAR}
</if>
<if test="sex != null and sex != ''">
and ki_sex = #{sex,jdbcType=VARCHAR}
</if>
<if test="birthday != null and birthday != ''">
and ki_birthday = #{birthday,jdbcType=VARCHAR}
</if>
<if test="guardianId != null and guardianId != ''">
and ki_guardianid = #{guardianId,jdbcType=VARCHAR}
</if>
<if test="currentOrganizationId != null and currentOrganizationId != ''">
and ki_currentOrganizationid = #{currentOrganizationId,jdbcType=VARCHAR}
</if>
<if test="barCode != null and barCode != ''">
and ki_barCode = #{barCode,jdbcType=VARCHAR}
</if>
<if test="phone != null and barCode != ''">
and phone = #{phone,jdbcType=VARCHAR}
</if>
<if test="buildOPer != null and buildOPer != ''">
and ki_buildoper = #{buildOPer,jdbcType=VARCHAR}
</if>
<if test="buildTime != null and buildTime != ''">
and ki_buildtime = #{buildTime,jdbcType=VARCHAR}
</if>
<if test="isDelete != null and isDelete != ''">
and isdelete = #{isDelete,jdbcType=VARCHAR}
</if>
</where>
</sql>



<select id="queryMedKids" resultMap="MedKidsResultMap" parameterType="com.lymsh.yimiao.main.data.model.MedKidsQuery">
select ki_id,ki_name,ki_sex,ki_birthday,ki_guardianid,ki_currentOrganizationid,ki_barCode,phone,ki_buildoper, ki_buildtime,isdelete,fathername,mothername
from med_kids
<include refid="MedKidsCondition" />
<include refid="orderAndLimit" />
</select>



<select id="queryMedKidsCount" resultType="int" parameterType="com.lymsh.yimiao.main.data.model.MedKidsQuery">
select count(1) from med_kids
<include refid="MedKidsCondition" />
</select>



</mapper>