mobilebroken/nflg-mobilebroken-repository/src/main/resources/mapper/DeviceComponentDetailMapper...

30 lines
1.3 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.nflg.mobilebroken.repository.mapper.DeviceComponentDetailMapper">
<delete id="delByComponentId">
delete from device_component_detail where device_component_id=#{componentId}
</delete>
<delete id="batchDelByComponentId">
delete from device_component_detail where device_component_id in
<foreach collection="componentIds" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</delete>
<select id="getDevicePartDetail" resultType="com.nflg.mobilebroken.common.pojo.vo.DeviceComponentDetailVO">
select a.* ,b.part_no,iFNULL(b.type_attr,'未设置') AS 'typeAttr' from device_component_detail a
join t_base_part b on a.model_part_id=b.id
where a.device_component_id=#{deviceComponentId}
</select>
<select id="getByModelNo" resultType="com.nflg.mobilebroken.common.pojo.vo.DeviceComponentDetailVO">
SELECT dct.*
FROM device_component dc
INNER JOIN device_component_detail dct ON dc.id=dct.device_component_id
WHERE dc.model_no=#{modelNo}
</select>
</mapper>