Files
cisd/src/main/resources/mapper/device/DeviceSoftwareVersionMapper.xml
T

38 lines
1.7 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.cisd.tms.modules.device.mapper.DeviceSoftwareVersionMapper">
<resultMap id="DeviceSoftwareVersionResultMap" type="com.cisd.tms.modules.device.entity.DeviceSoftwareVersionEntity">
<id property="id" column="id"/>
<result property="componentCode" column="component_code"/>
<result property="componentName" column="component_name"/>
<result property="currentVersion" column="current_version"/>
<result property="sourceType" column="source_type"/>
<result property="detectedAt" column="detected_at"/>
<result property="remarks" column="remarks"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<select id="selectByComponentCode" parameterType="string" resultMap="DeviceSoftwareVersionResultMap">
SELECT id, component_code, component_name, current_version, source_type, detected_at, remarks, create_time, update_time
FROM tms_device_software_version
WHERE component_code = #{componentCode}
LIMIT 1
</select>
<update id="updateByComponentCode" parameterType="com.cisd.tms.modules.device.entity.DeviceSoftwareVersionEntity">
UPDATE tms_device_software_version
SET component_name = #{componentName},
current_version = #{currentVersion},
source_type = #{sourceType},
detected_at = #{detectedAt},
remarks = #{remarks},
update_time = NOW()
WHERE component_code = #{componentCode}
</update>
</mapper>