235 lines
8.9 KiB
XML
235 lines
8.9 KiB
XML
<?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.sercurityControl.proteam.mapper.TEquipmentMapper">
|
|
|
|
<resultMap type="com.sercurityControl.proteam.domain.TEquipment" id="TEquipmentMap">
|
|
<result column="id" property="id"/>
|
|
<result column="equip_code" property="equipCode"/>
|
|
<result column="equip_id" property="equipId"/>
|
|
<result column="equip_type" property="equipType"/>
|
|
<result column="equip_name" property="equipName"/>
|
|
<result column="equip_short_name" property="equipShortName"/>
|
|
<result column="node_code" property="nodeCode"/>
|
|
<result column="status" property="status"/>
|
|
<result column="decoder_tag" property="decoderTag"/>
|
|
<result column="longitude" property="longitude"/>
|
|
<result column="latitude" property="latitude"/>
|
|
<result column="sys_info_code" property="sysInfoCode"/>
|
|
<result column="create_time" property="createTime"/>
|
|
<result column="update_time" property="updateTime"/>
|
|
<result column="score" property="score"/>
|
|
<result column="file_url" property="fileUrl"/>
|
|
<result column="file_id" property="fileId"/>
|
|
<result column="catch_time" property="catchTime"/>
|
|
</resultMap>
|
|
|
|
<sql id="SelectBaseMap">
|
|
SELECT id,
|
|
equip_code,
|
|
equip_id,
|
|
equip_type,
|
|
equip_name,
|
|
equip_short_name,
|
|
node_code,
|
|
status,
|
|
decoder_tag,
|
|
longitude,
|
|
latitude,
|
|
sys_info_code,
|
|
create_time,
|
|
update_time,
|
|
score,
|
|
file_url,
|
|
file_id
|
|
FROM t_equipment
|
|
</sql>
|
|
|
|
<!--分页查询-->
|
|
<select id="queryByPage" resultMap="TEquipmentMap">
|
|
<include refid="SelectBaseMap"/>
|
|
WHERE 1 = 1
|
|
<if test="equipCode != null and equipCode != ''">
|
|
AND equip_code = #{equipCode}
|
|
</if>
|
|
<if test="equipId != null and equipId != ''">
|
|
AND equip_id = #{equipId}
|
|
</if>
|
|
<if test="equipType != null and equipType != ''">
|
|
AND equip_type = #{equipType}
|
|
</if>
|
|
<if test="equipName != null and equipName != ''">
|
|
AND equip_name = #{equipName}
|
|
</if>
|
|
<if test="equipShortName != null and equipShortName != ''">
|
|
AND equip_short_name = #{equipShortName}
|
|
</if>
|
|
<if test="nodeCode != null and nodeCode != ''">
|
|
AND node_code = #{nodeCode}
|
|
</if>
|
|
<if test="status != null">
|
|
AND status = #{status}
|
|
</if>
|
|
<if test="decoderTag != null and decoderTag != ''">
|
|
AND decoder_tag = #{decoderTag}
|
|
</if>
|
|
<if test="longitude != null and longitude != ''">
|
|
AND longitude = #{longitude}
|
|
</if>
|
|
<if test="latitude != null and latitude != ''">
|
|
AND latitude = #{latitude}
|
|
</if>
|
|
<if test="sysInfoCode != null and sysInfoCode != ''">
|
|
AND sys_info_code = #{sysInfoCode}
|
|
</if>
|
|
<if test="createTime != null">
|
|
AND create_time = #{createTime}
|
|
</if>
|
|
<if test="updateTime != null">
|
|
AND update_time = #{updateTime}
|
|
</if>
|
|
<if test="score != null">
|
|
AND score = #{score}
|
|
</if>
|
|
</select>
|
|
|
|
|
|
<!--新增所有列-->
|
|
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
INSERT INTO t_equipment(
|
|
<if test="equipCode != null and equipCode != ''">equip_code,</if>
|
|
<if test="equipId != null and equipId != ''">equip_id,</if>
|
|
<if test="equipType != null and equipType != ''">equip_type,</if>
|
|
<if test="equipName != null and equipName != ''">equip_name,</if>
|
|
<if test="equipShortName != null and equipShortName != ''">equip_short_name,</if>
|
|
<if test="nodeCode != null and nodeCode != ''">node_code,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="decoderTag != null and decoderTag != ''">decoder_tag,</if>
|
|
<if test="longitude != null and longitude != ''">longitude,</if>
|
|
<if test="latitude != null and latitude != ''">latitude,</if>
|
|
<if test="sysInfoCode != null and sysInfoCode != ''">sys_info_code,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="score != null">score,</if>
|
|
create_time
|
|
)VALUES(
|
|
<if test="equipCode != null and equipCode != ''">#{equipCode},</if>
|
|
<if test="equipId != null and equipId != ''">#{equipId},</if>
|
|
<if test="equipType != null and equipType != ''">#{equipType},</if>
|
|
<if test="equipName != null and equipName != ''">#{equipName},</if>
|
|
<if test="equipShortName != null and equipShortName != ''">#{equipShortName},</if>
|
|
<if test="nodeCode != null and nodeCode != ''">#{nodeCode},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="decoderTag != null and decoderTag != ''">#{decoderTag},</if>
|
|
<if test="longitude != null and longitude != ''">#{longitude},</if>
|
|
<if test="latitude != null and latitude != ''">#{latitude},</if>
|
|
<if test="sysInfoCode != null and sysInfoCode != ''">#{sysInfoCode},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="score != null">#{score},</if>
|
|
sysdate())
|
|
</insert>
|
|
|
|
|
|
<insert id="insertBatch">
|
|
INSERT INTO t_equipment(equip_code,
|
|
equip_id,
|
|
equip_type,
|
|
equip_name,
|
|
equip_short_name,
|
|
node_code,
|
|
status,
|
|
decoder_tag,
|
|
longitude,
|
|
latitude,
|
|
sys_info_code,
|
|
create_time,
|
|
update_time,
|
|
score)VALUES
|
|
<foreach collection="list" item="TEquipment" separator=",">
|
|
(
|
|
#{TEquipment.equipCode},#{TEquipment.equipId},#{TEquipment.equipType},#{TEquipment.equipName},#{TEquipment.equipShortName},
|
|
#{TEquipment.nodeCode},#{TEquipment.status},#{TEquipment.decoderTag},#{TEquipment.longitude},#{TEquipment.latitude},#{TEquipment.sysInfoCode},
|
|
#{TEquipment.createTime},#{TEquipment.updateTime},#{TEquipment.score}
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
|
|
<!--通过主键修改数据-->
|
|
<update id="update">
|
|
UPDATE t_equipment
|
|
<set>
|
|
<if test="equipCode != null and equipCode != ''">
|
|
equip_code = #{equipCode},
|
|
</if>
|
|
<if test="equipId != null and equipId != ''">
|
|
equip_id = #{equipId},
|
|
</if>
|
|
<if test="equipType != null and equipType != ''">
|
|
equip_type = #{equipType},
|
|
</if>
|
|
<if test="equipName != null and equipName != ''">
|
|
equip_name = #{equipName},
|
|
</if>
|
|
<if test="equipShortName != null and equipShortName != ''">
|
|
equip_short_name = #{equipShortName},
|
|
</if>
|
|
<if test="nodeCode != null and nodeCode != ''">
|
|
node_code = #{nodeCode},
|
|
</if>
|
|
<if test="status != null">
|
|
status = #{status},
|
|
</if>
|
|
<if test="decoderTag != null and decoderTag != ''">
|
|
decoder_tag = #{decoderTag},
|
|
</if>
|
|
<if test="longitude != null and longitude != ''">
|
|
longitude = #{longitude},
|
|
</if>
|
|
<if test="latitude != null and latitude != ''">
|
|
latitude = #{latitude},
|
|
</if>
|
|
<if test="sysInfoCode != null and sysInfoCode != ''">
|
|
sys_info_code = #{sysInfoCode},
|
|
</if>
|
|
<if test="createTime != null">
|
|
create_time = #{createTime},
|
|
</if>
|
|
<if test="updateTime != null">
|
|
update_time = #{updateTime},
|
|
</if>
|
|
<if test="score != null">
|
|
score = #{score},
|
|
</if>
|
|
<if test="fileUrl != null and fileUrl != ''">
|
|
file_url = #{fileUrl},
|
|
</if>
|
|
<if test="fileId != null and fileId != ''">
|
|
file_id = #{fileId},
|
|
</if>
|
|
<if test="catchTime != null and catchTime != ''">
|
|
catch_time = #{catchTime},
|
|
</if>
|
|
</set>
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
|
|
<select id="getEquipmentIdList" resultType="java.lang.String">
|
|
SELECT equip_id
|
|
FROM t_equipment
|
|
</select>
|
|
|
|
<delete id="deleteByIds">
|
|
DELETE
|
|
FROM t_equipment
|
|
WHERE equip_id IN (#{equipIds})
|
|
</delete>
|
|
|
|
<select id="getAllEquipmentList" resultMap="TEquipmentMap">
|
|
<include refid="SelectBaseMap"/>
|
|
where status = 1
|
|
</select>
|
|
</mapper>
|
|
|