<?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.huimv.management.dao.HealthImmuneRecordDao">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.huimv.management.entity.HealthImmuneRecordEntity" id="healthImmuneRecordMap">
        <result property="id" column="id"/>
        <result property="vaccineName" column="vaccine_name"/>
        <result property="pigId" column="pig_id"/>
        <result property="farmId" column="farm_id"/>
        <result property="manName" column="man_name"/>
        <result property="manId" column="man_id"/>
        <result property="effective" column="effective"/>
        <result property="createTime" column="create_time"/>
    </resultMap>

    <select id="vaccineCoount" resultType="com.huimv.management.entity.dto.ImmuneCountDto">
        select
            vaccine_name vaccineName,
            COUNT(id) vaccineCount
            FROM `health_immune_record`
        ${ew.customSqlSegment}
        GROUP BY  vaccine_name
    </select>


</mapper>