小bug修复,修改上传文件名称生成逻辑

This commit is contained in:
mi9688
2024-11-26 18:35:22 +08:00
parent 45b3381eb2
commit 032f980f34
14 changed files with 893 additions and 3 deletions

View File

@ -0,0 +1,71 @@
<?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.fastbee.crop.mapper.AgricultureCropInfoMapper">
<resultMap type="AgricultureCropInfo" id="AgricultureCropInfoResult">
<result property="id" column="id" />
<result property="cropName" column="crop_name" />
<result property="growthPeriod" column="growth_period" />
<result property="plantingArea" column="planting_area" />
<result property="otherInfo" column="other_info" />
</resultMap>
<sql id="selectAgricultureCropInfoVo">
select id, crop_name, growth_period, planting_area, other_info from agriculture_crop_info
</sql>
<select id="selectAgricultureCropInfoList" parameterType="AgricultureCropInfo" resultMap="AgricultureCropInfoResult">
<include refid="selectAgricultureCropInfoVo"/>
<where>
<if test="cropName != null and cropName != ''"> and crop_name like concat('%', #{cropName}, '%')</if>
<if test="growthPeriod != null and growthPeriod != ''"> and growth_period = #{growthPeriod}</if>
<if test="plantingArea != null "> and planting_area = #{plantingArea}</if>
<if test="otherInfo != null and otherInfo != ''"> and other_info = #{otherInfo}</if>
</where>
</select>
<select id="selectAgricultureCropInfoById" parameterType="Long" resultMap="AgricultureCropInfoResult">
<include refid="selectAgricultureCropInfoVo"/>
where id = #{id}
</select>
<insert id="insertAgricultureCropInfo" parameterType="AgricultureCropInfo" useGeneratedKeys="true" keyProperty="id">
insert into agriculture_crop_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="cropName != null">crop_name,</if>
<if test="growthPeriod != null">growth_period,</if>
<if test="plantingArea != null">planting_area,</if>
<if test="otherInfo != null">other_info,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cropName != null">#{cropName},</if>
<if test="growthPeriod != null">#{growthPeriod},</if>
<if test="plantingArea != null">#{plantingArea},</if>
<if test="otherInfo != null">#{otherInfo},</if>
</trim>
</insert>
<update id="updateAgricultureCropInfo" parameterType="AgricultureCropInfo">
update agriculture_crop_info
<trim prefix="SET" suffixOverrides=",">
<if test="cropName != null">crop_name = #{cropName},</if>
<if test="growthPeriod != null">growth_period = #{growthPeriod},</if>
<if test="plantingArea != null">planting_area = #{plantingArea},</if>
<if test="otherInfo != null">other_info = #{otherInfo},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAgricultureCropInfoById" parameterType="Long">
delete from agriculture_crop_info where id = #{id}
</delete>
<delete id="deleteAgricultureCropInfoByIds" parameterType="String">
delete from agriculture_crop_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,71 @@
<?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.fastbee.crop.mapper.AgricultureCropYieldMapper">
<resultMap type="AgricultureCropYield" id="AgricultureCropYieldResult">
<result property="id" column="id" />
<result property="yieldValue" column="yield_value" />
<result property="harvestYear" column="harvest_year" />
<result property="cropType" column="crop_type" />
<result property="harvestMonth" column="harvest_month" />
</resultMap>
<sql id="selectAgricultureCropYieldVo">
select id, yield_value, harvest_year, crop_type, harvest_month from agriculture_crop_yield
</sql>
<select id="selectAgricultureCropYieldList" parameterType="AgricultureCropYield" resultMap="AgricultureCropYieldResult">
<include refid="selectAgricultureCropYieldVo"/>
<where>
<if test="yieldValue != null "> and yield_value = #{yieldValue}</if>
<if test="harvestYear != null and harvestYear != ''"> and harvest_year = #{harvestYear}</if>
<if test="cropType != null and cropType != ''"> and crop_type = #{cropType}</if>
<if test="harvestMonth != null and harvestMonth != ''"> and harvest_month = #{harvestMonth}</if>
</where>
</select>
<select id="selectAgricultureCropYieldById" parameterType="Long" resultMap="AgricultureCropYieldResult">
<include refid="selectAgricultureCropYieldVo"/>
where id = #{id}
</select>
<insert id="insertAgricultureCropYield" parameterType="AgricultureCropYield" useGeneratedKeys="true" keyProperty="id">
insert into agriculture_crop_yield
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="yieldValue != null">yield_value,</if>
<if test="harvestYear != null">harvest_year,</if>
<if test="cropType != null">crop_type,</if>
<if test="harvestMonth != null">harvest_month,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="yieldValue != null">#{yieldValue},</if>
<if test="harvestYear != null">#{harvestYear},</if>
<if test="cropType != null">#{cropType},</if>
<if test="harvestMonth != null">#{harvestMonth},</if>
</trim>
</insert>
<update id="updateAgricultureCropYield" parameterType="AgricultureCropYield">
update agriculture_crop_yield
<trim prefix="SET" suffixOverrides=",">
<if test="yieldValue != null">yield_value = #{yieldValue},</if>
<if test="harvestYear != null">harvest_year = #{harvestYear},</if>
<if test="cropType != null">crop_type = #{cropType},</if>
<if test="harvestMonth != null">harvest_month = #{harvestMonth},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAgricultureCropYieldById" parameterType="Long">
delete from agriculture_crop_yield where id = #{id}
</delete>
<delete id="deleteAgricultureCropYieldByIds" parameterType="String">
delete from agriculture_crop_yield where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>