<?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>