autosprout/AutoSprout-watering/src/main/resources/mapper/plant/AsPlantIdentifyLogMapper.xml
18650502300 927471c61f 1. 图片上传七牛云
2. 植物识别日志
3. 植物解析日志
4. 保存定时器的同时请求onenet保存参数
2024-03-31 10:07:19 +08:00

75 lines
3.2 KiB
XML

<?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.ruoyi.device.mapper.AsPlantIdentifyLogMapper">
<resultMap type="AsPlantIdentifyLog" id="AsPlantIdentifyLogResult">
<result property="id" column="id" />
<result property="userId" column="user_id" />
<result property="plantName" column="plant_name" />
<result property="response" column="response" />
<result property="msg" column="msg" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectAsPlantIdentifyLogVo">
select id, user_id, plant_name, url, response, msg, create_time from as_plant_identify_log
</sql>
<select id="selectAsPlantIdentifyLogList" parameterType="AsPlantIdentifyLog" resultMap="AsPlantIdentifyLogResult">
<include refid="selectAsPlantIdentifyLogVo"/>
<where>
</where>
</select>
<select id="selectAsPlantIdentifyLogById" parameterType="Long" resultMap="AsPlantIdentifyLogResult">
<include refid="selectAsPlantIdentifyLogVo"/>
where id = #{id}
</select>
<insert id="insertAsPlantIdentifyLog" parameterType="AsPlantIdentifyLog" useGeneratedKeys="true" keyProperty="id">
insert into as_plant_identify_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">user_id,</if>
<if test="plantName != null">plant_name,</if>
<if test="url != null">url,</if>
<if test="response != null">response,</if>
<if test="msg != null">msg,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">#{userId},</if>
<if test="plantName != null">#{plantName},</if>
<if test="url != null">#{url},</if>
<if test="response != null">#{response},</if>
<if test="msg != null">#{msg},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateAsPlantIdentifyLog" parameterType="AsPlantIdentifyLog">
update as_plant_identify_log
<trim prefix="SET" suffixOverrides=",">
<if test="userId != null">user_id = #{userId},</if>
<if test="plantName != null">plant_name = #{plantName},</if>
<if test="url != null">url = #{url},</if>
<if test="response != null">response = #{response},</if>
<if test="msg != null">msg = #{msg},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAsPlantIdentifyLogById" parameterType="Long">
delete from as_plant_identify_log where id = #{id}
</delete>
<delete id="deleteAsPlantIdentifyLogByIds" parameterType="String">
delete from as_plant_identify_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>