feat (farm): 业务功能

- 字典表,收纳所有的字典内容
- 管理中心 (农事类型,农事名称)维护到字典表中
- 种植中心 (生产计划,农事记录)业务逻辑接口实现
This commit is contained in:
达富斌
2025-08-20 15:32:00 +08:00
parent 615a804c61
commit 0f48b11330
45 changed files with 1841 additions and 480 deletions

View File

@@ -9,4 +9,61 @@
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
<resultMap id="DisasterDataResultMap" type="cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO">
<!-- 基础字段 -->
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="category" property="category"/>
<result column="type" property="type"/>
<result column="disaster_description" property="disasterDescription"/>
<result column="treatment_suggestion" property="treatmentSuggestion"/>
<result column="img_url" property="imgUrl"/>
<result column="disaster_count" property="disasterCount"/>
<result column="disaster_time" property="disasterTime"/>
<result column="creator" property="creator"/>
<result column="create_time" property="createTime"/>
<!-- 其他字段 -->
<result column="foundation_id" property="foundationId"/>
<result column="base_id" property="baseId"/>
<result column="base_name" property="baseName"/>
<result column="plot_id" property="plotId"/>
<result column="plot_name" property="plotName"/>
<result column="tenant_id" property="tenantId"/>
<!-- 表中存在但DO中没有的字段 -->
<result column="updater" property="updater"/>
<result column="update_time" property="updateTime"/>
<result column="deleted" property="deleted"/>
</resultMap>
<select id="selectDisasterDataPage" resultMap="DisasterDataResultMap">
SELECT *
FROM farm_disaster_data
WHERE deleted = 0
<if test="req.name != null and req.name != ''">
AND name LIKE CONCAT('%', #{req.name}, '%')
</if>
<if test="req.category != null">
AND category = #{req.category}
</if>
<if test="req.type != null">
AND type = #{req.type}
</if>
LIMIT #{req.pageSize} OFFSET #{req.pageNo}
</select>
<select id="selectDisasterDataCount" resultType="java.lang.Long">
SELECT COUNT(*)
FROM farm_disaster_data
WHERE deleted = 0
<if test="req.name != null and req.name != ''">
AND name LIKE CONCAT('%', #{req.name}, '%')
</if>
<if test="req.category != null">
AND category = #{req.category}
</if>
<if test="req.type != null">
AND type = #{req.type}
</if>
</select>
</mapper>