<?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.yuanchu.mom.mapper.DeviceMapper">
|
<!--查询设备维护 左侧列表设备组展示-->
|
<select id="deviceTwoTree" resultType="java.util.Map">
|
SELECT distinct father,type
|
FROM mom_ocean.device d
|
WHERE d.state = 1
|
AND d.type = #{type}
|
<if test="search_class !=null and search_class != ''">
|
AND d.`name` like concat('%',#{search_class},'%')
|
</if>
|
</select>
|
<!--查询设备维护 右侧列表展示该设备组下的所有设备-->
|
<select id="selectTreeDevice" resultType="java.util.Map">
|
select device.id,
|
code,
|
device.name,
|
user.name userName,
|
DATE_FORMAT(end_measure, '%Y-%m-%d'),
|
device_status,
|
factory
|
from mom_ocean.device,mom_ocean.user
|
where device.state=1
|
and user.id=keeper
|
and type=#{type}
|
and father=#{father}
|
<if test="deviceStatus!=null and deviceStatus!=''">
|
and device_status=#{deviceStatus}
|
</if>
|
<if test="message!=null and message!=''">
|
and code like concat('%',#{message},'%')
|
or name like concat('%',#{message},'%')
|
</if>
|
</select>
|
<!--根据设备分组查询设备-->
|
<select id="getDeviceNameByGroup" resultType="java.util.Map">
|
select id, name
|
from mom_ocean.device
|
where state = 1
|
and father = #{deviceGroup}
|
and device_status in (1, 5)
|
</select>
|
<!--选择设备组-->
|
<select id="chooseDevGroup" resultType="java.util.Map">
|
select distinct father
|
from mom_ocean.device
|
where state = 1
|
and device_status in (1, 5)
|
</select>
|
|
<!--原材料检验-选择设备-->
|
<select id="chooseDevice" resultType="java.util.Map">
|
select id, name
|
from mom_ocean.device
|
where state = 1
|
and device_status in (1, 5)
|
</select>
|
<!--批量删除-->
|
<update id="delAllDevice">
|
update mom_ocean.device
|
set state=0
|
where id in (${ids})
|
</update>
|
</mapper>
|