mobilebroken/nflg-mobilebroken-repository/src/main/resources/mapper/DeviceComponentMapper.xml

33 lines
1.2 KiB
XML
Raw Normal View History

2025-01-19 11:30:15 +08:00
<?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.DeviceComponentMapper">
<select id="selectListByPage" resultType="com.nflg.mobilebroken.common.pojo.vo.DeviceComponentVO">
select * from device_component
<where>
<if test="query.modelNo!=null and query.modelNo!=''">
and model_no like concat('%',#{query.modelNo} ,'%')
</if>
<if test="query.component!=null and query.component!=''">
and component like concat('%',#{query.component} ,'%')
</if>
</where>
<if test="query.componentSort==null">
ORDER BY id DESC
2025-01-20 10:48:03 +08:00
</if>
<if test="query.componentSort==true">
ORDER BY LENGTH(component) DESC,id DESC
</if>
<if test="query.componentSort==false">
ORDER BY LENGTH(component),id DESC
2025-01-20 10:48:03 +08:00
</if>
</select>
2025-03-01 23:12:33 +08:00
<select id="getExportData" resultType="com.nflg.mobilebroken.common.pojo.dto.DevComponentExcel">
select a.model_no,b.model_part_name,b.create_by,b.create_time
from device_component a
join device_component_detail b on a.id=b.device_component_id
2025-03-02 22:02:52 +08:00
join t_base_part c on b.model_part_id=c.id
2025-03-01 23:12:33 +08:00
</select>
2025-01-19 11:30:15 +08:00
</mapper>