YearPigBaseDao.xml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.huimv.apiservice.dao.PigDao">
  4. <!-- 可根据自己的需求,是否要使用 -->
  5. <resultMap type="com.huimv.apiservice.entity.YearPigBaseEntity" id="yearPigBaseMap">
  6. <result property="id" column="id"/>
  7. <result property="eartag" column="eartag"/>
  8. <result property="dayAge" column="day_age"/>
  9. <result property="unitId" column="unit_id"/>
  10. <result property="weight" column="weight"/>
  11. <result property="fosterStatus" column="foster_status"/>
  12. <result property="healthStatus" column="health_status"/>
  13. <result property="whereDidYouGo" column="where_did_you_go"/>
  14. <result property="breed" column="breed"/>
  15. <result property="sex" column="sex"/>
  16. <result property="birthday" column="birthday"/>
  17. <result property="pigstyId" column="pigsty_id"/>
  18. <result property="periodId" column="period_id"/>
  19. <result property="deleted" column="deleted"/>
  20. <result property="gmtCreate" column="gmt_create"/>
  21. <result property="gmtModified" column="gmt_modified"/>
  22. </resultMap>
  23. <select id="selectFeederInfoByPigEarTagNo" parameterType="string" resultType="com.huimv.apiservice.entity.EmployeeEntity">
  24. SELECT me.*
  25. FROM mgt_employee me
  26. JOIN mgt_pigsty mp
  27. ON me.id = mp.feeder_id
  28. JOIN mgt_pigsty_pig mpp
  29. ON mpp.pigsty_id = mp.id
  30. WHERE mpp.eartag = #{pigEarTagNo}
  31. </select>
  32. <select id="selectPastureNameByPigstyId" resultType="java.lang.String">
  33. SELECT mc.name
  34. FROM mgt_pigsty zs
  35. JOIN mgt_pasture mc
  36. ON zs.pasture_id = mc.id
  37. WHERE zs.id = #{pigstyId}
  38. </select>
  39. </mapper>