update:功能
This commit is contained in:
66
absolute/path/to/file
Normal file
66
absolute/path/to/file
Normal file
@@ -0,0 +1,66 @@
|
||||
<?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.ski.lichuan.mapper.TrailPositionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.ski.lichuan.model.dashboard.TrailPosition">
|
||||
<id column="id" jdbcType="INTEGER" property="id"/>
|
||||
<result column="trail_id" jdbcType="INTEGER" property="trailId"/>
|
||||
<result column="position" jdbcType="VARCHAR" property="position"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="snow_machine_id" jdbcType="INTEGER" property="snowMachineId"/>
|
||||
<result column="snow_machine_status" jdbcType="INTEGER" property="snowMachineStatus"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByTrailId" resultMap="BaseResultMap">
|
||||
SELECT * FROM trail_position WHERE trail_id = #{trailId}
|
||||
</select>
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
SELECT * FROM trail_position WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
SELECT * FROM trail_position
|
||||
</select>
|
||||
|
||||
<!-- 获取所有未绑定雪机的雪道位置信息 -->
|
||||
<select id="selectUnboundPositions" resultMap="BaseResultMap">
|
||||
SELECT * FROM trail_position WHERE snow_machine_id IS NULL
|
||||
</select>
|
||||
|
||||
<select id="selectBoundPositions" resultMap="BaseResultMap">
|
||||
SELECT * FROM trail_position WHERE snow_machine_id IS NOT NULL
|
||||
</select>
|
||||
|
||||
<insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
|
||||
INSERT INTO trail_position (trail_id, position, name)
|
||||
VALUES (#{trailId}, #{position}, #{name})
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE trail_position
|
||||
SET trail_id = #{trailId}, position = #{position}, name = #{name}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="clearSnowMachine">
|
||||
UPDATE trail_position
|
||||
SET snow_machine_status = 0, snow_machine_id = NULL
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="updateSnowMachine">
|
||||
UPDATE trail_position
|
||||
SET snow_machine_status = #{snowMachineStatus}, snow_machine_id = #{snowMachineId}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 根据雪道位置ID列表查询造雪机设备ID列表 -->
|
||||
<select id="selectDeviceIdsByTrailPositionIds" resultType="java.lang.Integer">
|
||||
SELECT snow_machine_id FROM trail_position WHERE id IN
|
||||
<foreach collection="list" item="id" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user