西藏巴青项目

BizYakAssetMapper.xml 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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.ruoyi.web.modules.industryservice.mapper.BizYakAssetMapper">
  4. <resultMap type="com.ruoyi.web.modules.industryservice.domain.BizYakAsset" id="BizYakAssetResult">
  5. <id property="id" column="id"/>
  6. <result property="externalId" column="external_id"/>
  7. <result property="yakNo" column="yak_no"/>
  8. <result property="pastureId" column="pasture_id"/>
  9. <result property="pastureName" column="pasture_name"/>
  10. <result property="batchNo" column="batch_no"/>
  11. <result property="gender" column="gender"/>
  12. <result property="birthDate" column="birth_date"/>
  13. <result property="ageMonths" column="age_months"/>
  14. <result property="entryDate" column="entry_date"/>
  15. <result property="entryWeightKg" column="entry_weight_kg"/>
  16. <result property="source" column="source"/>
  17. <result property="breedingMethod" column="breeding_method"/>
  18. <result property="assetStatus" column="asset_status"/>
  19. <result property="statusChangeDate" column="status_change_date"/>
  20. <result property="statusChangeReason" column="status_change_reason"/>
  21. <result property="penLocation" column="pen_location"/>
  22. <result property="expectedOutDate" column="expected_out_date"/>
  23. <result property="supplementPlan" column="supplement_plan"/>
  24. <result property="realtimeTemp" column="realtime_temp"/>
  25. <result property="realtimeSteps" column="realtime_steps"/>
  26. <result property="envTemp" column="env_temp"/>
  27. <result property="location" column="location"/>
  28. <result property="physioCollectTime" column="physio_collect_time"/>
  29. <result property="fatherYakNo" column="father_yak_no"/>
  30. <result property="motherYakNo" column="mother_yak_no"/>
  31. <result property="lastSyncTime" column="last_sync_time"/>
  32. <result property="delFlag" column="del_flag"/>
  33. <result property="createTime" column="create_time"/>
  34. <result property="updateTime" column="update_time"/>
  35. </resultMap>
  36. <sql id="selectVo">
  37. select id, external_id, yak_no, pasture_id, pasture_name, batch_no, gender, birth_date, age_months,
  38. entry_date, entry_weight_kg, source, breeding_method, asset_status, status_change_date,
  39. status_change_reason, pen_location, expected_out_date, supplement_plan,
  40. realtime_temp, realtime_steps, env_temp, location, physio_collect_time,
  41. father_yak_no, mother_yak_no, last_sync_time, del_flag, create_time, update_time
  42. from biz_yak_asset
  43. </sql>
  44. <select id="selectBizYakAssetById" parameterType="long" resultMap="BizYakAssetResult">
  45. <include refid="selectVo"/>
  46. where id = #{id} and del_flag = '0'
  47. </select>
  48. <select id="selectBizYakAssetByYakNo" parameterType="string" resultMap="BizYakAssetResult">
  49. <include refid="selectVo"/>
  50. where yak_no = #{yakNo} and del_flag = '0'
  51. </select>
  52. <select id="selectBizYakAssetByExternalId" parameterType="long" resultMap="BizYakAssetResult">
  53. <include refid="selectVo"/>
  54. where external_id = #{externalId} and del_flag = '0'
  55. </select>
  56. <select id="selectBizYakAssetList" parameterType="com.ruoyi.web.modules.industryservice.domain.BizYakAsset" resultMap="BizYakAssetResult">
  57. <include refid="selectVo"/>
  58. <where>
  59. del_flag = '0'
  60. <if test="keyword != null and keyword != ''">
  61. and yak_no like concat('%', #{keyword}, '%')
  62. </if>
  63. <if test="assetStatus != null">
  64. and asset_status = #{assetStatus}
  65. </if>
  66. </where>
  67. order by status_change_date desc, id desc
  68. </select>
  69. <insert id="insertBizYakAsset" parameterType="com.ruoyi.web.modules.industryservice.domain.BizYakAsset" useGeneratedKeys="true" keyProperty="id">
  70. insert into biz_yak_asset (
  71. external_id, yak_no, pasture_id, pasture_name, batch_no, gender, birth_date, age_months,
  72. entry_date, entry_weight_kg, source, breeding_method, asset_status, status_change_date,
  73. status_change_reason, pen_location, expected_out_date, supplement_plan,
  74. realtime_temp, realtime_steps, env_temp, location, physio_collect_time,
  75. father_yak_no, mother_yak_no, last_sync_time, del_flag, create_time
  76. ) values (
  77. #{externalId}, #{yakNo}, #{pastureId}, #{pastureName}, #{batchNo}, #{gender}, #{birthDate}, #{ageMonths},
  78. #{entryDate}, #{entryWeightKg}, #{source}, #{breedingMethod}, #{assetStatus}, #{statusChangeDate},
  79. #{statusChangeReason}, #{penLocation}, #{expectedOutDate}, #{supplementPlan},
  80. #{realtimeTemp}, #{realtimeSteps}, #{envTemp}, #{location}, #{physioCollectTime},
  81. #{fatherYakNo}, #{motherYakNo}, #{lastSyncTime}, #{delFlag}, sysdate()
  82. )
  83. </insert>
  84. <update id="updateBizYakAsset" parameterType="com.ruoyi.web.modules.industryservice.domain.BizYakAsset">
  85. update biz_yak_asset set
  86. external_id = #{externalId},
  87. yak_no = #{yakNo},
  88. pasture_id = #{pastureId},
  89. pasture_name = #{pastureName},
  90. batch_no = #{batchNo},
  91. gender = #{gender},
  92. birth_date = #{birthDate},
  93. age_months = #{ageMonths},
  94. entry_date = #{entryDate},
  95. entry_weight_kg = #{entryWeightKg},
  96. source = #{source},
  97. breeding_method = #{breedingMethod},
  98. asset_status = #{assetStatus},
  99. status_change_date = #{statusChangeDate},
  100. status_change_reason = #{statusChangeReason},
  101. pen_location = #{penLocation},
  102. expected_out_date = #{expectedOutDate},
  103. supplement_plan = #{supplementPlan},
  104. realtime_temp = #{realtimeTemp},
  105. realtime_steps = #{realtimeSteps},
  106. env_temp = #{envTemp},
  107. location = #{location},
  108. physio_collect_time = #{physioCollectTime},
  109. father_yak_no = #{fatherYakNo},
  110. mother_yak_no = #{motherYakNo},
  111. last_sync_time = #{lastSyncTime},
  112. update_time = sysdate()
  113. where id = #{id} and del_flag = '0'
  114. </update>
  115. </mapper>