<?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.apiservice.dao.PeriodDao">

	<!-- 可根据自己的需求，是否要使用 -->
    <resultMap type="com.huimv.apiservice.entity.PeriodEntity" id="periodMap">
        <result property="id" column="id"/>
        <result property="number" column="number"/>
        <result property="pigstyId" column="pigsty_id"/>
        <result property="pastureId" column="pasture_id"/>
        <result property="deleted" column="deleted"/>
        <result property="gmtCreate" column="gmt_create"/>
        <result property="gmtModified" column="gmt_modified"/>
    </resultMap>

    <select id="selectIdByPeriodNumber" parameterType="string" resultType="java.lang.Integer">
        SELECT id FROM mgt_period WHERE number = #{period} AND deleted = 0 limit 1
    </select>


</mapper>