Bonus-Cloud-Material-Mall/bonus-modules/bonus-material-mall/src/main/resources/mapper/material/devchange/DevChangeMapper.xml

37 lines
1.7 KiB
XML
Raw Normal View History

2025-09-14 15:56:37 +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.bonus.material.devchange.mapper.DevChangeMapper">
<select id="getMaxFeature" resultType="java.lang.Integer">
select count(1) num
from ma_dev_info_properties
GROUP BY ma_id
ORDER BY num desc
limit 1
</select>
<select id="selectDevInfoList" resultType="com.bonus.material.devchange.domain.DevChangeVo">
select dev.ma_id devId,dev.device_name devName,dev.code devCode,dev.json_data,DATE(dev.production_date ) productDate ,dev.buy_price buyPrice ,dev.brand ,
mdq.next_check_time nextDate,mt.typeId, mt.unit_name unit,mt.maintenance_alarm_day ,
mt.lease_price,mt.proType,mt.level,mt.mainGx,mt.childGx,mt.devCategory ,mt.devSubcategory ,mt.devName,
mt.devModel ,bci.company_name compName,bci.operate_address orgName,IFNULL(pro.pro_name,'-') proName,
dev.on_project proId
FROM ma_dev_info dev
left join bm_company_info bci on bci.company_id=dev.own_id
left join ma_type_view mt on mt.typeId=dev.type_id
LEFT JOIN ma_dev_qc mdq on dev.ma_id=mdq.ma_id
left join jj_sing_project pro on pro.pro_code=dev.on_project
where is_active=1
<if test="devName!=null and devName!=''">
and dev.device_name like concat('%',#{devName},'%')
</if>
<if test="typeId!=null and typeId!=''">
and mt.typeId=#{typeId}
</if>
<if test="status!=null and status!=''">
AND dev.change_status=#{status}
</if>
</select>
</mapper>