MedInoculaterecord.xml 3.68 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
  95
  96
  97
  98
  99
 100
<?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.MedInoculateRecordMapper">

<resultMap id="MedInoculateRecordResultMap" type="com.lymsh.yimiao.main.data.model.MedInoculateRecord">
<result column="ic_id" property="icId" jdbcType="VARCHAR" />
<result column="ic_kidId" property="icKidId" jdbcType="VARCHAR" />
<result column="ic_vaccineId" property="icVaccineId" jdbcType="VARCHAR" />
<result column="ic_inoculateTime" property="icInoculateTime" jdbcType="VARCHAR" />
<result column="ic_doctor" property="icDoctor" jdbcType="VARCHAR" />
<result column="io_position" property="icPosition" jdbcType="VARCHAR" />
<result column="ic_batchNumber" property="icBatchNumber" jdbcType="VARCHAR" />
<result column="ic_organizationId" property="icOrganizationId" jdbcType="VARCHAR" />
<result column="ic_isInoculate" property="icIsInoculate" jdbcType="VARCHAR" />
<result column="ic_jici" property="icJiCi" jdbcType="VARCHAR" />
<result column="ic_delete" property="isDelete" jdbcType="VARCHAR" />
</resultMap>

<select id="getMedInoculateRecord" resultMap="MedInoculateRecordResultMap" parameterType="java.lang.String">
select ic_id,ic_kidId,ic_vaccineId,ic_inoculateTime,ic_doctor,io_position,ic_batchNumber,ic_organizationId,ic_isInoculate,ic_jici,ic_delete
FROM med_inoculaterecord
WHERE ic_id = #{icId,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="MedInoculateRecordCondition">
<where>
1 = 1
<if test="icId != null and icId != ''">
and ic_id = #{icId,jdbcType=VARCHAR}
</if>
<if test="icKidId != null and icKidId != ''">
and ic_kidId in (#{icKidId,jdbcType=VARCHAR})
</if>
<if test="icVaccineId != null and icVaccineId != ''">
and ic_vaccineId = #{icVaccineId,jdbcType=VARCHAR}
</if>
<if test="icInoculateTime != null and icInoculateTime != ''">
and ic_inoculateTime = #{icInoculateTime,jdbcType=VARCHAR}
</if>
<if test="icDoctor != null and icDoctor != ''">
and ic_doctor = #{icDoctor,jdbcType=VARCHAR}
</if>
<if test="icPosition != null and icPosition != ''">
and io_position = #{icPosition,jdbcType=VARCHAR}
</if>
<if test="icBatchNumber != null and icBatchNumber != ''">
and ic_batchNumber = #{icBatchNumber,jdbcType=VARCHAR}
</if>
<if test="icOrganizationId != null and icOrganizationId != ''">
and ic_organizationId = #{icOrganizationId,jdbcType=VARCHAR}
</if>
<if test="icIsInoculate != null and icIsInoculate != ''">
and ic_isInoculate = #{icIsInoculate,jdbcType=VARCHAR}
</if>
<if test="icJiCi != null and icJiCi != ''">
and ic_jici = #{icJiCi,jdbcType=VARCHAR}
</if>
<if test="isDelete != null and isDelete != ''">
and ic_delete = #{isDelete,jdbcType=VARCHAR}
</if>
<if test="ids != null ">
and ic_kidId in
<foreach collection="ids" index="index" item="item" open="(" separator="," close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
</where>
</sql>



<select id="queryMedInoculateRecord" resultMap="MedInoculateRecordResultMap" parameterType="com.lymsh.yimiao.main.data.model.MedInoculateRecordQuery">
select ic_id,ic_kidId,ic_vaccineId,ic_inoculateTime,ic_doctor,io_position,ic_batchNumber,ic_organizationId,ic_isInoculate,ic_jici,ic_delete
from med_inoculaterecord
<include refid="MedInoculateRecordCondition" />
<include refid="orderAndLimit" />
</select>



<select id="queryMedInoculateRecordCount" resultType="int" parameterType="com.lymsh.yimiao.main.data.model.MedInoculateRecordQuery">
select count(1) from med_inoculaterecord
<include refid="MedInoculateRecordCondition" />
</select>



</mapper>