MedVaccinename.xml 3.01 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
<?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.MedVaccinenameMapper">

<resultMap id="MedVaccinenameResultMap" type="com.lymsh.yimiao.main.data.model.MedVaccinename">
<result column="vn_id" property="vnId" jdbcType="VARCHAR" />
<result column="vn_name" property="vnName" jdbcType="VARCHAR" />
<result column="vn_preventDisease" property="vnPreventDisease" jdbcType="VARCHAR" />
<result column="vn_monthAge" property="vnMonthAge" jdbcType="VARCHAR" />
<result column="vn_position" property="vnPosition" jdbcType="VARCHAR" />
<result column="vn_taboo" property="vnTaboo" jdbcType="VARCHAR" />
<result column="vn_description" property="vnDescription" jdbcType="VARCHAR" />
<result column="vn_isValid" property="vnIsValid" jdbcType="VARCHAR" />
<result column="vn_vaccineType" property="vnVaccineType" jdbcType="INTEGER" />
</resultMap>

<select id="getMedVaccinename" resultMap="MedVaccinenameResultMap" parameterType="java.lang.String">
select vn_id,vn_name,vn_preventDisease,vn_monthAge,vn_position,vn_taboo,vn_description,vn_isValid,vn_vaccineType
from med_vaccinename
WHERE vn_id = #{vnId,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="MedVaccinenameCondition">
<where>
1 = 1
<if test="vnId != null and vnId != ''">
and vn_id = #{vnId,jdbcType=VARCHAR}
</if>
<if test="vnName != null and vnName != ''">
and vn_name = #{vnName,jdbcType=VARCHAR}
</if>
<if test="vnPreventDisease != null and vnPreventDisease != ''">
and vn_preventDisease = #{vnPreventDisease,jdbcType=VARCHAR}
</if>
<if test="vnMonthAge != null and vnMonthAge != ''">
and vn_monthAge = #{vnMonthAge,jdbcType=VARCHAR}
</if>
<if test="vnPosition != null and vnPosition != ''">
and vn_position = #{vnPosition,jdbcType=VARCHAR}
</if>
<if test="vnTaboo != null and vnTaboo != ''">
and vn_taboo = #{vnTaboo,jdbcType=VARCHAR}
</if>
<if test="vnDescription != null and vnDescription != ''">
and vn_description = #{vnDescription,jdbcType=VARCHAR}
</if>
<if test="vnIsValid != null and vnIsValid != ''">
and vn_isValid = #{vnIsValid,jdbcType=VARCHAR}
</if>
<if test="vnVaccineType != null and vnVaccineType != ''">
and vn_vaccineType = #{vnVaccineType,jdbcType=INTEGER}
</if>
</where>
</sql>



<select id="queryMedVaccinename" resultMap="MedVaccinenameResultMap" parameterType="com.lymsh.yimiao.main.data.model.MedVaccinenameQuery">
select vn_id,vn_name,vn_preventDisease,vn_monthAge,vn_position,vn_taboo,vn_description,vn_isValid
from med_vaccinename
<include refid="MedVaccinenameCondition" />
<include refid="orderAndLimit" />
</select>



<select id="queryMedVaccinenameCount" resultType="int" parameterType="com.lymsh.yimiao.main.data.model.MedVaccinenameQuery">
select count(1) from med_vaccinename
<include refid="MedVaccinenameCondition" />
</select>



</mapper>