<?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.MedInoculateOrderMapper">
<resultMap id="MedInoculateOrderResultMap" type="com.lymsh.yimiao.main.data.model.MedInoculateOrder">
<result column="io_id" property="ioId" jdbcType="VARCHAR" />
<result column="io_kidId" property="ioKidId" jdbcType="VARCHAR" />
<result column="io_vaccineId" property="ioVaccineId" jdbcType="VARCHAR" />
<result column="io_organizationId" property="ioOrganizationId" jdbcType="VARCHAR" />
<result column="io_inoculateDate" property="ioInoculateDate" jdbcType="VARCHAR" />
<result column="io_inoculateTime" property="ioInoculateTime" jdbcType="VARCHAR" />
<result column="io_orderOper" property="ioOrderOPer" jdbcType="VARCHAR" />
<result column="io_orderTime" property="ioOrderTime" jdbcType="VARCHAR" />
</resultMap>
<select id="getMedInoculateOrder" resultMap="MedInoculateOrderResultMap" parameterType="java.lang.String">
select io_id,io_kidId,io_vaccineId,io_organizationId,io_inoculateDate,io_inoculateTime,io_orderOper,io_orderTime
FROM med_inoculateorder
WHERE io_id = #{ioId,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="MedInoculateOrderCondition">
<where>
1 = 1
<if test="ioId != null and ioId != ''">
and io_id = #{ioId,jdbcType=VARCHAR}
</if>
<if test="ioKidId != null and ioKidId != ''">
and io_kidId = #{ioKidId,jdbcType=VARCHAR}
</if>
<if test="ioVaccineId != null and ioVaccineId != ''">
and io_vaccineId = #{ioVaccineId,jdbcType=VARCHAR}
</if>
<if test="ioOrganizationId != null and ioOrganizationId != ''">
and io_organizationId = #{ioOrganizationId,jdbcType=VARCHAR}
</if>
<if test="ioInoculateDate != null and ioInoculateDate != ''">
and io_inoculateDate = #{ioInoculateDate,jdbcType=VARCHAR}
</if>
<if test="ioInoculateTime != null and ioInoculateTime != ''">
and io_inoculateTime = #{ioInoculateTime,jdbcType=VARCHAR}
</if>
<if test="ioOrderOPer != null and ioOrderOPer != ''">
and io_orderOper = #{ioOrderOPer,jdbcType=VARCHAR}
</if>
<if test="ioOrderTime != null and ioOrderTime != ''">
and io_orderTime = #{ioOrderTime,jdbcType=VARCHAR}
</if>
</where>
</sql>
<select id="queryMedInoculateOrder" resultMap="MedInoculateOrderResultMap" parameterType="com.lymsh.yimiao.main.data.model.MedInoculateOrderQuery">
select io_id,io_kidId,io_vaccineId,io_organizationId,io_inoculateDate,io_inoculateTime,io_orderOper,io_orderTime
from med_inoculateorder
<include refid="MedInoculateOrderCondition" />
<include refid="orderAndLimit" />
</select>
<select id="queryMedInoculateOrderCount" resultType="int" parameterType="com.lymsh.yimiao.main.data.model.MedInoculateOrderQuery">
select count(1) from med_inoculateorder
<include refid="MedInoculateOrderCondition" />
</select>
</mapper>