gz_gqj/src/main/resources/mappers/app/PartApplyAppMapper.xml

37 lines
1.7 KiB
XML
Raw Normal View History

2024-11-12 16:38:35 +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.gzgqj.business.app.mapper.PartApplyAppMapper" >
<select id="getDevList" resultType="com.bonus.gzgqj.business.app.entity.MachinesVo">
select mm.id ,mt2.NAME name ,mt3.`NAME` type ,mt.name model ,mm.DEVICE_CODE deviceCode
from mm_machines mm
left join mm_type mt on mt.id=mm.TYPE and mt.`LEVEL`=4 and mt.IS_ACTIVE=1
left join mm_type mt2 on mt.PARENT_ID=mt2.id
left join mm_type mt3 on mt2.PARENT_ID=mt3.id
where mm.BATCH_STATUS=7
<where >
<if test="name!=null and name!=''">
and mt2.NAME like concat('%',#{name},'%')
</if>
<if test="type!=null and type!=''">
and mt3.NAME like concat('%',#{type},'%')
</if>
<if test="model!=null and model!=''">
and mt.NAME like concat('%',#{model},'%')
</if>
</where>
</select>
<select id="getWfRecordList" resultType="java.lang.String">
select wir.sup_id ,wat.AGREEMENT_ID,
wir.id ,pro.`NAME` proName ,pro.Id proId
from wf_info_record wir
LEFT JOIN wf_return_material_details rmd on wir.SUP_ID=rmd.id
LEFT JOIN wf_agreement_task wat on rmd.TASK_ID=wat.TASK_ID
LEFT JOIN wf_lease_agreement wla on wat.AGREEMENT_ID=wla.id
left join bm_project pro on pro.id=wla.PROJECT
where TYPE=4 AND wir.MA_ID=#{id}
ORDER BY wir.TIME DESC
limit 1
</select>
</mapper>