吉安感知网项目-后端
linwei
2 days ago 51a551a7f8eae7654f973d45cd2fa2952774673d
drone-service/drone-fw/src/main/java/org/sxkj/fw/detection/mapper/FwDeviceConfigMapper.xml
@@ -19,8 +19,23 @@
        <result column="is_deleted" property="isDeleted"/>
    </resultMap>
    <resultMap id="fwDeviceConfigVoResultMap" type="org.sxkj.fw.detection.vo.FwDeviceConfigVO">
        <result column="id" property="id"/>
        <result column="device_id" property="deviceId"/>
        <result column="config_version" property="configVersion"/>
        <result column="is_latest" property="isLatest"/>
        <result column="config_json" property="configJson"/>
        <result column="area_code" property="areaCode"/>
        <result column="create_user" property="createUser"/>
        <result column="create_dept" property="createDept"/>
        <result column="create_time" property="createTime"/>
        <result column="update_user" property="updateUser"/>
        <result column="update_time" property="updateTime"/>
        <result column="status" property="status"/>
    </resultMap>
    <select id="selectFwDeviceConfigPage" resultMap="fwDeviceConfigResultMap">
    <select id="selectFwDeviceConfigPage" resultMap="fwDeviceConfigVoResultMap">
        select * from ja_fw_device_config
        <where>
            is_deleted = 0
@@ -66,6 +81,48 @@
        </where>
    </select>
    <select id="selectLatestByDeviceId" resultMap="fwDeviceConfigResultMap">
        select * from ja_fw_device_config
        <where>
            is_deleted = 0
            and device_id = #{deviceId}
            and is_latest = 1
        </where>
        order by config_version desc
        limit 1
    </select>
    <select id="selectLatestVersionByDeviceId" resultMap="fwDeviceConfigResultMap">
        select * from ja_fw_device_config
        <where>
            is_deleted = 0
            and device_id = #{deviceId}
        </where>
        order by config_version desc
        limit 1
    </select>
    <select id="selectMaxConfigVersion" resultType="java.lang.Integer">
        select max(config_version) from ja_fw_device_config
        <where>
            is_deleted = 0
            and device_id = #{deviceId}
        </where>
    </select>
    <update id="resetLatestByDeviceId">
        update ja_fw_device_config
        set is_latest = 0
        <where>
            is_deleted = 0
            and device_id = #{deviceId}
            and is_latest = 1
            <if test="excludeId != null">
                and id != #{excludeId}
            </if>
        </where>
    </update>
    <select id="exportFwDeviceConfig" resultType="org.sxkj.fw.detection.excel.FwDeviceConfigExcel">
        SELECT * FROM ja_fw_device_config ${ew.customSqlSegment}