1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?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.PigDao">
- <!-- 可根据自己的需求,是否要使用 -->
- <resultMap type="com.huimv.apiservice.entity.YearPigBaseEntity" id="yearPigBaseMap">
- <result property="id" column="id"/>
- <result property="eartag" column="eartag"/>
- <result property="dayAge" column="day_age"/>
- <result property="unitId" column="unit_id"/>
- <result property="weight" column="weight"/>
- <result property="fosterStatus" column="foster_status"/>
- <result property="healthStatus" column="health_status"/>
- <result property="whereDidYouGo" column="where_did_you_go"/>
- <result property="breed" column="breed"/>
- <result property="sex" column="sex"/>
- <result property="birthday" column="birthday"/>
- <result property="pigstyId" column="pigsty_id"/>
- <result property="periodId" column="period_id"/>
- <result property="deleted" column="deleted"/>
- <result property="gmtCreate" column="gmt_create"/>
- <result property="gmtModified" column="gmt_modified"/>
- </resultMap>
- <select id="selectFeederInfoByPigEarTagNo" parameterType="string" resultType="com.huimv.apiservice.entity.EmployeeEntity">
- SELECT me.*
- FROM mgt_employee me
- JOIN mgt_pigsty mp
- ON me.id = mp.feeder_id
- JOIN mgt_pigsty_pig mpp
- ON mpp.pigsty_id = mp.id
- WHERE mpp.eartag = #{pigEarTagNo}
- </select>
- <select id="selectPastureNameByPigstyId" resultType="java.lang.String">
- SELECT mc.name
- FROM mgt_pigsty zs
- JOIN mgt_pasture mc
- ON zs.pasture_id = mc.id
- WHERE zs.id = #{pigstyId}
- </select>
- </mapper>
|