feat (farm): 业务功能
- 灾害库,气象灾害库
This commit is contained in:
@@ -20,40 +20,52 @@
|
||||
<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="use_status" property="useStatus"/>
|
||||
<result column="deleted" property="deleted"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDisasterDataPage" resultMap="DisasterDataResultMap">
|
||||
SELECT *
|
||||
<sql id="all_fields">
|
||||
id,
|
||||
name ,
|
||||
category ,
|
||||
type ,
|
||||
disaster_description ,
|
||||
treatment_suggestion ,
|
||||
img_url,
|
||||
disaster_count,
|
||||
disaster_time ,
|
||||
creator,
|
||||
create_time,
|
||||
updater,
|
||||
update_time,
|
||||
use_status,
|
||||
deleted
|
||||
</sql>
|
||||
|
||||
<!-- 分页查询 -->
|
||||
<select id="selectDisasterDataPage"
|
||||
parameterType="cn.iocoder.yudao.module.farm.controller.admin.disasterdata.vo.DisasterDataPageReqVO"
|
||||
resultMap="DisasterDataResultMap">
|
||||
SELECT
|
||||
<include refid="all_fields"/>
|
||||
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}
|
||||
<include refid="where_1"/>
|
||||
LIMIT #{req.offset}, #{req.pageSize}
|
||||
</select>
|
||||
|
||||
<!-- 统计总数 -->
|
||||
<select id="selectDisasterDataCount" resultType="java.lang.Long">
|
||||
SELECT COUNT(*)
|
||||
FROM farm_disaster_data
|
||||
<include refid="where_1"/>
|
||||
</select>
|
||||
|
||||
<sql id="where_1">
|
||||
WHERE deleted = 0
|
||||
<if test="req.name != null and req.name != ''">
|
||||
AND name LIKE CONCAT('%', #{req.name}, '%')
|
||||
@@ -64,6 +76,113 @@
|
||||
<if test="req.type != null">
|
||||
AND type = #{req.type}
|
||||
</if>
|
||||
<if test="req.deleted != null">
|
||||
AND deleted = #{req.deleted}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectById"
|
||||
resultType="cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO">
|
||||
|
||||
SELECT
|
||||
<include refid="all_fields"/>
|
||||
FROM farm_disaster_data
|
||||
WHERE deleted = 0 AND id = #{id}
|
||||
|
||||
</select>
|
||||
|
||||
<delete id="deleteByIds">
|
||||
|
||||
</delete>
|
||||
|
||||
<delete id="deleteById" parameterType="string">
|
||||
|
||||
|
||||
</delete>
|
||||
|
||||
<update id="updateById" parameterType="cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO">
|
||||
UPDATE farm_disaster_data
|
||||
<set>
|
||||
<if test="name != null and name != ''">
|
||||
name = #{name},
|
||||
</if>
|
||||
<if test="category != null">
|
||||
category = #{category},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type},
|
||||
</if>
|
||||
<if test="disasterDescription != null">
|
||||
disaster_description = #{disasterDescription},
|
||||
</if>
|
||||
<if test="treatmentSuggestion != null">
|
||||
treatment_suggestion = #{treatmentSuggestion},
|
||||
</if>
|
||||
<if test="imgUrl != null and imgUrl != ''">
|
||||
img_url = #{imgUrl},
|
||||
</if>
|
||||
<if test="disasterCount != null">
|
||||
disaster_count = #{disasterCount},
|
||||
</if>
|
||||
<if test="disasterTime != null and disasterTime != ''">
|
||||
disaster_time = #{disasterTime},
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
creator = #{creator},
|
||||
</if>
|
||||
<if test="updater != null and updater != ''">
|
||||
updater = #{updater},
|
||||
</if>
|
||||
<if test="useStatus != null">
|
||||
use_status = #{useStatus},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted},
|
||||
</if>
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE id = #{id}
|
||||
AND deleted = 0
|
||||
</update>
|
||||
|
||||
<insert id="insert" parameterType="cn.iocoder.yudao.module.farm.dal.dataobject.disasterdata.DisasterDataDO">
|
||||
|
||||
INSERT INTO farm_disaster_data
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
id,
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="category != null">category,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="disasterDescription != null">disaster_description,</if>
|
||||
<if test="treatmentSuggestion != null">treatment_suggestion,</if>
|
||||
<if test="imgUrl != null and imgUrl != ''">img_url,</if>
|
||||
<if test="disasterCount != null">disaster_count,</if>
|
||||
<if test="disasterTime != null and disasterTime != ''">disaster_time,</if>
|
||||
<if test="creator != null and creator != ''">creator,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updater != null and updater != ''">updater,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="useStatus != null">use_status,</if>
|
||||
<if test="deleted != null">deleted</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
#{id},
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="category != null">#{category},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="disasterDescription != null">#{disasterDescription},</if>
|
||||
<if test="treatmentSuggestion != null">#{treatmentSuggestion},</if>
|
||||
<if test="imgUrl != null and imgUrl != ''">#{imgUrl},</if>
|
||||
<if test="disasterCount != null">#{disasterCount},</if>
|
||||
<if test="disasterTime != null and disasterTime != ''">#{disasterTime},</if>
|
||||
<if test="creator != null and creator != ''">#{creator},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updater != null and updater != ''">#{updater},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="useStatus != null">#{useStatus},</if>
|
||||
<if test="deleted != null">#{deleted}</if>
|
||||
</trim>
|
||||
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user