| | |
| | | </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} |