mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-19 01:15:54 +08:00
固件升级完善
This commit is contained in:
@@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="tenantId" column="tenant_id" />
|
||||
<result property="tenantName" column="tenant_name" />
|
||||
<result property="isSys" column="is_sys" />
|
||||
<result property="isLatest" column="is_latest" />
|
||||
<result property="version" column="version" />
|
||||
<result property="filePath" column="file_path" />
|
||||
<result property="createTime" column="create_time" />
|
||||
@@ -20,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFirmwareVo">
|
||||
select firmware_id, firmware_name, product_id, product_name, tenant_id, tenant_name, is_sys, version, file_path, create_time, update_time, remark from iot_firmware
|
||||
select firmware_id, firmware_name, product_id, product_name, tenant_id, tenant_name, is_sys,is_latest, version, file_path, create_time, update_time, remark from iot_firmware
|
||||
</sql>
|
||||
|
||||
<select id="selectFirmwareList" parameterType="com.ruoyi.iot.domain.Firmware" resultMap="FirmwareResult">
|
||||
@@ -30,6 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
||||
<if test="tenantId != null and tenantId != ''"> and tenant_id = #{tenantId}</if>
|
||||
<if test="productId != null"> and product_id = #{productId}</if>
|
||||
<if test="isLatest != null"> and is_latest = #{isLatest}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
@@ -38,6 +40,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectFirmwareVo"/>
|
||||
where firmware_id = #{firmwareId}
|
||||
</select>
|
||||
|
||||
<select id="selectLatestFirmware" parameterType="Long" resultMap="FirmwareResult">
|
||||
select f.firmware_id, f.firmware_name, f.product_id, f.product_name, f.tenant_id, f.tenant_name, f.is_sys,f.is_latest, f.version,
|
||||
f.file_path, f.create_time, f.remark
|
||||
from iot_device d
|
||||
left join iot_firmware f on d.product_id = f.product_id
|
||||
where d.device_id=#{deviceId} and f.is_latest=1
|
||||
order by f.create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertFirmware" parameterType="com.ruoyi.iot.domain.Firmware" useGeneratedKeys="true" keyProperty="firmwareId">
|
||||
insert into iot_firmware
|
||||
@@ -48,6 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="tenantId != null">tenant_id,</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name,</if>
|
||||
<if test="isSys != null">is_sys,</if>
|
||||
<if test="isLatest != null">is_latest,</if>
|
||||
<if test="version != null">version,</if>
|
||||
<if test="filePath != null and filePath != ''">file_path,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
@@ -64,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="tenantId != null">#{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">#{tenantName},</if>
|
||||
<if test="isSys != null">#{isSys},</if>
|
||||
<if test="isLatest != null">#{isLatest},</if>
|
||||
<if test="version != null">#{version},</if>
|
||||
<if test="filePath != null and filePath != ''">#{filePath},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
@@ -84,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
||||
<if test="tenantName != null and tenantName != ''">tenant_name = #{tenantName},</if>
|
||||
<if test="isSys != null">is_sys = #{isSys},</if>
|
||||
<if test="isLatest != null">is_latest = #{isLatest},</if>
|
||||
<if test="version != null">version = #{version},</if>
|
||||
<if test="filePath != null and filePath != ''">file_path = #{filePath},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
|
||||
Reference in New Issue
Block a user