<?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.ruoyi.fuzhou.mapper.EquipmentMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.ruoyi.fuzhou.domain.DpEquipment">
|
<id column="ID" property="id" />
|
<result column="BE_ID" property="beId" />
|
<result column="EQU_NAME" property="equName" />
|
<result column="PROTOCOL" property="protocol" />
|
<result column="EQU_SE_TYPE" property="equSeType" />
|
<result column="PERIOD_TIME" property="periodTime" />
|
<result column="INTERVAL_TIME" property="intervalTime" />
|
<result column="WH_ID" property="whId" />
|
<result column="X" property="x" />
|
<result column="Y" property="y" />
|
<result column="Z" property="z" />
|
<result column="FIELD_NAME" property="fieldName" />
|
<result column="EQUIPMENT_TYPE_ID" property="equipmentTypeId" />
|
</resultMap>
|
|
|
<delete id="deleteBy">
|
delete from DP_EQUIPMENT where wh_id in (select wh_id from DP_BERTH where be_id = #{beId})
|
</delete>
|
<select id="getTotal" resultType="java.lang.Long">
|
select count(1) from DP_EQUIPMENT a
|
left join DM_BERTH c on c.pkId = a.BE_ID
|
left join dm_harbor b on c.HARBOR_ID = b.pkId
|
<where>
|
<if test="beId != null and beId != ''">
|
and a.BE_ID = #{beId}
|
</if>
|
<if test="whId != null and whId != ''">
|
and b.pkId = #{whId}
|
</if>
|
<if test="equName != null and equName != ''">
|
and a.EQU_NAME like concat('%',#{equName},'%')
|
</if>
|
</where>
|
</select>
|
|
<select id="getListByBeId" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
|
select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
|
d.ID as equipmentTypeId,d.TYPE_NAME as equtype,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
|
b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
|
left join DM_BERTH c on c.pkId = a.BE_ID
|
left join dm_harbor b on c.HARBOR_ID = b.pkId
|
left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
|
<where>
|
<if test="beId != null and beId != ''">
|
and a.BE_ID = #{beId}
|
</if>
|
</where>
|
</select>
|
|
<select id="getListByWhId" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
|
select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
|
d.ID as equipmentTypeId,d.TYPE_NAME as equtype,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
|
b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
|
left join DM_BERTH c on c.pkId = a.BE_ID
|
left join dm_harbor b on c.HARBOR_ID = b.pkId
|
left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
|
<where>
|
<if test="whId != null and whId != ''">
|
and b.pkId = #{whId}
|
</if>
|
</where>
|
</select>
|
|
<select id="getPageList" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
|
select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
|
d.ID as equipmentTypeId,d.TYPE_NAME as typeName,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
|
b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
|
left join DM_BERTH c on c.pkId = a.BE_ID
|
left join dm_harbor b on c.HARBOR_ID = b.pkId
|
left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
|
<where>
|
<if test="beId != null and beId != ''">
|
and a.BE_ID = #{beId}
|
</if>
|
<if test="whId != null and whId != ''">
|
and b.pkId = #{whId}
|
</if>
|
<if test="equipmentTypeId != null and equipmentTypeId != ''">
|
and d.ID = #{equipmentTypeId}
|
</if>
|
<if test="equName != null and equName != ''">
|
and a.EQU_NAME like concat('%',#{equName},'%')
|
</if>
|
</where>
|
order by a.ID DESC limit #{pageSize} offset #{offset}
|
</select>
|
|
<select id="queryById" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
|
select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
|
d.ID as equipmentTypeId,d.TYPE_NAME as equtype,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
|
b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
|
left join DM_BERTH c on c.pkId = a.BE_ID
|
left join dm_harbor b on c.HARBOR_ID = b.pkId
|
left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
|
where a.ID = #{id}
|
</select>
|
|
<select id="getListByBeIdTypeId" resultType="com.ruoyi.fuzhou.domain.vo.DpEquipmentVO">
|
select a.*,b.HARBOR_NAME as whName ,b.pkId as whId,c.NAME as beName,c.pkId as beId,
|
d.ID as equipmentTypeId,d.TYPE_NAME as equtype,d.DESCRIPTION as description,d.FILE_PATH as filepath,d.ICON as icon,
|
b.HARBOR_NAME as whName, c.NAME as beName from DP_EQUIPMENT a
|
left join DM_BERTH c on c.pkId = a.BE_ID
|
left join dm_harbor b on c.HARBOR_ID = b.pkId
|
left join DP_EQUIPMENT_TYPE d on d.ID = a.EQUIPMENT_TYPE_ID
|
<where>
|
<if test="beId != null and beId != ''">
|
and a.BE_ID = #{beId}
|
</if>
|
<!-- <if test="typeId != null and typeId != ''">-->
|
<!-- and a.EQUIPMENT_TYPE_ID = #{typeId}-->
|
<!-- </if>-->
|
<if test="typeIds !=null and typeIds.size() > 0">
|
and a.EQUIPMENT_TYPE_ID in
|
<foreach item="typeId" collection="typeIds" open="(" separator="," close=")">
|
#{typeId}
|
</foreach>
|
</if>
|
</where>
|
</select>
|
|
</mapper>
|