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

47 lines
2.1 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.DeviceMapper">
<select id="getByDeviceNo" resultType="com.nflg.mobilebroken.common.pojo.vo.DeviceInfoVO">
2025-02-11 22:42:46 +08:00
SELECT d.device_no AS 'deviceNo',d.model_no AS 'modelNo',dc.component AS 'component',d.device_type AS 'deviceType'
,d.device_type_sub AS 'deviceTypeSub',d.warranty_state AS 'warrantyState',d.shipment_date AS 'shipmentDate'
,d.start_warranty_date AS 'startWarrantyDate',d.warranty_month AS 'warrantyMonth'
2025-01-19 11:30:15 +08:00
FROM device d
LEFT JOIN device_component dc ON d.model_no=dc.model_no AND dc.`enable`=1
2025-01-26 22:27:16 +08:00
WHERE d.device_no=#{deviceNo}
2025-01-19 11:30:15 +08:00
</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 &gt;= #{query.warrantyStartDate} and start_warranty_date &lt;= #{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>