<?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.HealthIsolationRecordDao">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.huimv.management.entity.HealthIsolationRecordEntity" id="healthIsolationRecordMap">
        <result property="id" column="id"/>
        <result property="diseaseName" column="disease_name"/>
        <result property="pigCode" column="pig_code"/>
        <result property="medicalRecordId" column="medical_record_id"/>
        <result property="entryTime" column="entry_time"/>
        <result property="offTime" column="off_time"/>
        <result property="farmId" column="farm_id"/>
        <result property="effective" column="effective"/>
        <result property="createTime" column="create_time"/>
        <result property="manName" column="man_name"/>
        <result property="manId" column="man_id"/>
    </resultMap>
    <select id="isolationCount" resultType="com.huimv.management.entity.dto.IsolationDto">
        select
           DATE_FORMAT(create_time,"%Y-%m-%d") diseaseTime,
           COUNT(*) diseaseCount

        FROM health_isolation_record
        ${ew.customSqlSegment}
        GROUP BY diseaseTime

    </select>


</mapper>