|
|
|
@ -164,6 +164,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
b.floor AS floor |
|
|
|
b.floor AS floor |
|
|
|
</sql> |
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <select id="selectEquBaseList" parameterType="equBaseQueryDto" resultType="com.alops.system.domain.vo.queryEquBaseVO">--> |
|
|
|
|
|
|
|
<!-- SELECT--> |
|
|
|
|
|
|
|
<!-- <include refid="selectEquBaseVo2"/>--> |
|
|
|
|
|
|
|
<!-- FROM equ_base b--> |
|
|
|
|
|
|
|
<!-- LEFT JOIN equ_manu m ON b.manufacture = m.id--> |
|
|
|
|
|
|
|
<!-- LEFT JOIN equ_supplier s ON b.supplier_id = s.id--> |
|
|
|
|
|
|
|
<!-- LEFT JOIN equ_type t ON b.equ_type = t.id--> |
|
|
|
|
|
|
|
<!-- LEFT JOIN sys_user su ON b.create_by = su.user_id--> |
|
|
|
|
|
|
|
<!-- LEFT JOIN (--> |
|
|
|
|
|
|
|
<!-- -- 子查询:每台设备取最新的健康度--> |
|
|
|
|
|
|
|
<!-- SELECT eg.equ_id, eg.health--> |
|
|
|
|
|
|
|
<!-- FROM equ_gather eg--> |
|
|
|
|
|
|
|
<!-- INNER JOIN (--> |
|
|
|
|
|
|
|
<!-- SELECT equ_id, MAX(gather_time) AS max_time--> |
|
|
|
|
|
|
|
<!-- FROM equ_gather--> |
|
|
|
|
|
|
|
<!-- GROUP BY equ_id--> |
|
|
|
|
|
|
|
<!-- ) tmp ON eg.equ_id = tmp.equ_id AND eg.gather_time = tmp.max_time--> |
|
|
|
|
|
|
|
<!-- ) g ON b.id = g.equ_id--> |
|
|
|
|
|
|
|
<!-- <where>--> |
|
|
|
|
|
|
|
<!-- <if test="minTime != null">--> |
|
|
|
|
|
|
|
<!-- AND b.create_date >= #{minTime}--> |
|
|
|
|
|
|
|
<!-- </if>--> |
|
|
|
|
|
|
|
<!-- <if test="maxTime != null">--> |
|
|
|
|
|
|
|
<!-- AND b.create_date <= #{maxTime}--> |
|
|
|
|
|
|
|
<!-- </if>--> |
|
|
|
|
|
|
|
<!-- </where>--> |
|
|
|
|
|
|
|
<!-- ORDER BY b.create_date DESC--> |
|
|
|
|
|
|
|
<!-- </select>--> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEquBaseList" parameterType="equBaseQueryDto" resultType="com.alops.system.domain.vo.queryEquBaseVO"> |
|
|
|
<select id="selectEquBaseList" parameterType="equBaseQueryDto" resultType="com.alops.system.domain.vo.queryEquBaseVO"> |
|
|
|
SELECT |
|
|
|
SELECT |
|
|
|
<include refid="selectEquBaseVo2"/> |
|
|
|
<include refid="selectEquBaseVo2"/> |
|
|
|
@ -182,6 +211,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
GROUP BY equ_id |
|
|
|
GROUP BY equ_id |
|
|
|
) tmp ON eg.equ_id = tmp.equ_id AND eg.gather_time = tmp.max_time |
|
|
|
) tmp ON eg.equ_id = tmp.equ_id AND eg.gather_time = tmp.max_time |
|
|
|
) g ON b.id = g.equ_id |
|
|
|
) g ON b.id = g.equ_id |
|
|
|
|
|
|
|
|
|
|
|
<where> |
|
|
|
<where> |
|
|
|
<if test="minTime != null"> |
|
|
|
<if test="minTime != null"> |
|
|
|
AND b.create_date >= #{minTime} |
|
|
|
AND b.create_date >= #{minTime} |
|
|
|
@ -189,10 +219,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="maxTime != null"> |
|
|
|
<if test="maxTime != null"> |
|
|
|
AND b.create_date <= #{maxTime} |
|
|
|
AND b.create_date <= #{maxTime} |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 模糊查询:设备名称 --> |
|
|
|
|
|
|
|
<if test="name != null and name != ''"> |
|
|
|
|
|
|
|
AND b.name LIKE CONCAT('%', #{name}, '%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 模糊查询:安装位置 --> |
|
|
|
|
|
|
|
<if test="location != null and location != ''"> |
|
|
|
|
|
|
|
AND b.location LIKE CONCAT('%', #{location}, '%') |
|
|
|
|
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 精确查询:状态 --> |
|
|
|
|
|
|
|
<if test="status != null and status != ''"> |
|
|
|
|
|
|
|
AND b.status = #{status} |
|
|
|
|
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</where> |
|
|
|
|
|
|
|
|
|
|
|
ORDER BY b.create_date DESC |
|
|
|
ORDER BY b.create_date DESC |
|
|
|
</select> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectEquMonitorListPaged" resultType="MonitorListDto"> |
|
|
|
<select id="selectEquMonitorListPaged" resultType="MonitorListDto"> |
|
|
|
SELECT |
|
|
|
SELECT |
|
|
|
c.id, |
|
|
|
c.id, |
|
|
|
@ -508,6 +555,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="equImage != null">equ_image = #{equImage},</if> |
|
|
|
<if test="equImage != null">equ_image = #{equImage},</if> |
|
|
|
<if test="equNumber != null">equ_number = #{equNumber},</if> |
|
|
|
<if test="equNumber != null">equ_number = #{equNumber},</if> |
|
|
|
<if test="floor != null">floor = #{floor},</if> |
|
|
|
<if test="floor != null">floor = #{floor},</if> |
|
|
|
|
|
|
|
create_date = create_date |
|
|
|
</trim> |
|
|
|
</trim> |
|
|
|
where id = #{id} |
|
|
|
where id = #{id} |
|
|
|
</update> |
|
|
|
</update> |
|
|
|
|