api-设备新增设备类型字段,是入场还是出场。完善入场逻辑

This commit is contained in:
limqhz
2020-07-22 18:58:39 +08:00
parent 048ccc2d05
commit 6550f5d06b
8 changed files with 253 additions and 92 deletions

View File

@@ -8,6 +8,7 @@
<result column="stream" property="stream"/>
<result column="venue_id" property="venueId"/>
<result column="venue_type" property="venueType"/>
<result column="device_type" property="deviceType"/>
<result column="status" property="status"/>
<result column="created_id" property="createdId"/>
<result column="modified_id" property="modifiedId"/>
@@ -33,6 +34,7 @@
venue_id,
status,
venue_type,
device_type,
created_id,
modified_id,
created_time,
@@ -45,6 +47,9 @@
#{id, jdbcType=INTEGER},
#{name, jdbcType=VARCHAR},
#{stream, jdbcType=VARCHAR},
#{venue_id, jdbcType=INTEGER},
#{venue_type, jdbcType=INTEGER},
#{device_type, jdbcType=VARCHAR},
#{createdId, jdbcType=INTEGER},
#{modifiedId, jdbcType=INTEGER},
#{createdTime, jdbcType=TIMESTAMP},
@@ -83,6 +88,9 @@
<if test="venueType != null">
venue_type,
</if>
<if test="deviceType != null">
device_type,
</if>
<if test="status != null">
status,
</if>
@@ -118,6 +126,9 @@
<if test="venueType != null">
#{venueType},
</if>
<if test="venueType != null">
#{deviceType},
</if>
<if test="status != null">
#{status},
</if>
@@ -179,6 +190,12 @@
<if test="venueId != null">
venue_id = #{venueId},
</if>
<if test="venueType != null">
venue_type = #{venueType},
</if>
<if test="deviceType != null">
device_type = #{deviceType},
</if>
<if test="createdId != null">
created_id = #{createdId},
</if>
@@ -235,11 +252,26 @@
<update id="online">
UPDATE sv_device set status = 2,modified_time = now()
WHERE name = #{deviceName} and venue_id=#{venueId}
<if test="venueType != null">
and venue_type = #{venueType},
</if>
</update>
<select id="checkDevice" resultType="java.lang.Integer">
SELECT count(1) FROM sv_device
WHERE 1=1 AND name = #{deviceName} and venue_id=#{venueId} and deleted = 0
<if test="venueType != null">
and venue_type = #{venueType},
</if>
</select>
<select id="findByDevice" resultType="com.sv.entity.Device">
SELECT
<include refid="Field"></include> FROM sv_device
WHERE 1=1 AND name = #{deviceName} and venue_id=#{venueId} and deleted = 0
<if test="venueType != null">
and venue_type = #{venueType},
</if>
</select>
</mapper>