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.DeviceMapper">
|
|
|
|
|
|
|
|
|
|
<select id="getByDeviceNo" resultType="com.nflg.mobilebroken.common.pojo.vo.DeviceInfoVO">
|
|
|
|
|
SELECT d.device_no AS 'deviceNo',d.model_no AS 'modelNo',dc.component AS 'component'
|
|
|
|
|
FROM device d
|
|
|
|
|
LEFT JOIN device_component dc ON d.model_no=dc.model_no AND dc.`enable`=1
|
|
|
|
|
WHERE d.`enable`=1
|
|
|
|
|
</select>
|
2025-01-25 23:30:44 +08:00
|
|
|
<sql id="whr">
|
|
|
|
|
<if test="query.deviceNo!=null and query.deviceNo!=''">
|
|
|
|
|
and device_no=#{query.deviceNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="query.customerName!=null and query.customerName!=''">
|
|
|
|
|
and customer_name=#{query.customerName}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="query.agentName!=null and query.agentName!=''">
|
|
|
|
|
and agent_name=#{query.agentName}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="query.modelNo!=null and query.modelNo!=''">
|
|
|
|
|
and model_no=#{query.modelNo}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="query.warrantyState!=null and query.warrantyState!=''">
|
|
|
|
|
and warranty_state=#{query.warrantyState}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="query.warrantyStartDate!=null and query.warrantyStartDate!=''">
|
|
|
|
|
and start_warranty_date >= #{query.warrantyStartDate} and start_warranty_date <= #{query.warrantyEndDate}
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="getList" resultType="com.nflg.mobilebroken.repository.entity.Device">
|
|
|
|
|
select * from device where data_valid_state=1
|
|
|
|
|
<include refid="whr"/>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<update id="batchDelByIds">
|
|
|
|
|
update device set data_valid_state=0 where id in
|
|
|
|
|
<foreach collection="ids" open="(" close=")" item="item" separator=",">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
2025-01-19 11:30:15 +08:00
|
|
|
</mapper>
|