|
@@ -1,25 +1,19 @@
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<?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" >
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
-<mapper namespace="com.css.simulation.resource.model.mapper.ConfigMapper" >
|
|
|
|
|
|
+<mapper namespace="com.css.simulation.resource.model.mapper.ConfigMapper">
|
|
|
|
|
|
- <resultMap id="ConfigVOMap" type="api.common.pojo.vo.model.ConfigVO">
|
|
|
|
- <id column="ID" property="id" jdbcType="VARCHAR" />
|
|
|
|
- </resultMap>
|
|
|
|
-
|
|
|
|
- <resultMap id="ConfigSensorVOMap" type="api.common.pojo.vo.model.ConfigSensorVO">
|
|
|
|
- <id column="ID" property="id" jdbcType="VARCHAR" />
|
|
|
|
- </resultMap>
|
|
|
|
-
|
|
|
|
- <select id="getConfigPageList" parameterType="api.common.pojo.param.model.ConfigPageParam" resultMap="ConfigVOMap">
|
|
|
|
|
|
+ <select id="getConfigPageList" parameterType="api.common.pojo.param.model.ConfigPageParam"
|
|
|
|
+ resultType="api.common.pojo.vo.model.ConfigVO">
|
|
select
|
|
select
|
|
- c.id,
|
|
|
|
- c.config_code,
|
|
|
|
- c.config_name,
|
|
|
|
- c.description as configDescription,
|
|
|
|
- v.id as vehicleId,
|
|
|
|
- v.vehicle_name,
|
|
|
|
- v.description as vehicleDescription,
|
|
|
|
- c.share
|
|
|
|
|
|
+ c.id,
|
|
|
|
+ c.config_code,
|
|
|
|
+ c.config_name,
|
|
|
|
+ c.description as configDescription,
|
|
|
|
+ v.id as vehicleId,
|
|
|
|
+ v.vehicle_name,
|
|
|
|
+ v.description as vehicleDescription,
|
|
|
|
+ c.share,
|
|
|
|
+ c.is_unavailable
|
|
from model_config c
|
|
from model_config c
|
|
LEFT JOIN model_vehicle v on c.vehicle_id = v.id
|
|
LEFT JOIN model_vehicle v on c.vehicle_id = v.id
|
|
WHERE c.is_deleted = '0'
|
|
WHERE c.is_deleted = '0'
|
|
@@ -47,69 +41,107 @@
|
|
order by c.create_time desc
|
|
order by c.create_time desc
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="getConfigInfo" parameterType="api.common.pojo.vo.model.ConfigVO" resultMap="ConfigVOMap">
|
|
|
|
- SELECT
|
|
|
|
- c.id,
|
|
|
|
- c.config_code,
|
|
|
|
- c.config_name,
|
|
|
|
- c.description as configDescription,
|
|
|
|
- c.vehicle_id,
|
|
|
|
- c.share,
|
|
|
|
- c.vehicle_array,
|
|
|
|
- v.vehicle_name,
|
|
|
|
- v.description as vehicleDescription,
|
|
|
|
- v.vehicle_front_view,
|
|
|
|
- v.vehicle_top_view
|
|
|
|
|
|
+ <select id="getConfigInfo" parameterType="api.common.pojo.vo.model.ConfigVO"
|
|
|
|
+ resultType="api.common.pojo.vo.model.ConfigVO">
|
|
|
|
+ SELECT c.id,
|
|
|
|
+ c.config_code,
|
|
|
|
+ c.config_name,
|
|
|
|
+ c.description as configDescription,
|
|
|
|
+ c.vehicle_id,
|
|
|
|
+ c.share,
|
|
|
|
+ c.is_unavailable,
|
|
|
|
+ c.vehicle_array,
|
|
|
|
+ v.vehicle_name,
|
|
|
|
+ v.description as vehicleDescription,
|
|
|
|
+ v.vehicle_front_view,
|
|
|
|
+ v.vehicle_top_view
|
|
FROM model_config c
|
|
FROM model_config c
|
|
- LEFT JOIN model_vehicle v ON v.id = c.vehicle_id
|
|
|
|
|
|
+ LEFT JOIN model_vehicle v ON v.id = c.vehicle_id
|
|
WHERE c.is_deleted = '0'
|
|
WHERE c.is_deleted = '0'
|
|
- and c.id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
|
+ and c.id = #{id,jdbcType=VARCHAR}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="getConfigSensors" parameterType="api.common.pojo.vo.model.ConfigVO" resultMap="ConfigSensorVOMap">
|
|
|
|
- SELECT
|
|
|
|
- r.id,r.config_id,r.sensor_id,
|
|
|
|
- s.sensor_name, s.description as sensorDescription,
|
|
|
|
- r.sensor_type,
|
|
|
|
- r.sensor_x, r.sensor_y, r.sensor_z, r.sensor_h, r.sensor_p, r.sensor_r, r.sensor_port
|
|
|
|
|
|
+ <select id="getConfigSensors" parameterType="api.common.pojo.vo.model.ConfigVO" resultType="api.common.pojo.vo.model.ConfigSensorVO">
|
|
|
|
+ SELECT r.id,
|
|
|
|
+ r.config_id,
|
|
|
|
+ r.sensor_id,
|
|
|
|
+ s.sensor_name,
|
|
|
|
+ s.description as sensorDescription,
|
|
|
|
+ r.sensor_type,
|
|
|
|
+ r.sensor_x,
|
|
|
|
+ r.sensor_y,
|
|
|
|
+ r.sensor_z,
|
|
|
|
+ r.sensor_h,
|
|
|
|
+ r.sensor_p,
|
|
|
|
+ r.sensor_r,
|
|
|
|
+ r.sensor_port
|
|
FROM relation_config_sensor r
|
|
FROM relation_config_sensor r
|
|
- INNER JOIN model_sensor_camera s ON r.sensor_id = s.id
|
|
|
|
- WHERE r.is_deleted = '0' and r.config_id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
|
+ INNER JOIN model_sensor_camera s ON r.sensor_id = s.id
|
|
|
|
+ WHERE r.is_deleted = '0'
|
|
|
|
+ and r.config_id = #{id,jdbcType=VARCHAR}
|
|
UNION
|
|
UNION
|
|
- SELECT
|
|
|
|
- r.id,r.config_id,r.sensor_id,
|
|
|
|
- s.sensor_name, s.description as sensorDescription,
|
|
|
|
- r.sensor_type,
|
|
|
|
- r.sensor_x, r.sensor_y, r.sensor_z, r.sensor_h, r.sensor_p, r.sensor_r, r.sensor_port
|
|
|
|
|
|
+ SELECT r.id,
|
|
|
|
+ r.config_id,
|
|
|
|
+ r.sensor_id,
|
|
|
|
+ s.sensor_name,
|
|
|
|
+ s.description as sensorDescription,
|
|
|
|
+ r.sensor_type,
|
|
|
|
+ r.sensor_x,
|
|
|
|
+ r.sensor_y,
|
|
|
|
+ r.sensor_z,
|
|
|
|
+ r.sensor_h,
|
|
|
|
+ r.sensor_p,
|
|
|
|
+ r.sensor_r,
|
|
|
|
+ r.sensor_port
|
|
FROM relation_config_sensor r
|
|
FROM relation_config_sensor r
|
|
- INNER JOIN model_sensor_ogt s ON r.sensor_id = s.id
|
|
|
|
- WHERE r.is_deleted = '0' and r.config_id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
|
+ INNER JOIN model_sensor_ogt s ON r.sensor_id = s.id
|
|
|
|
+ WHERE r.is_deleted = '0'
|
|
|
|
+ and r.config_id = #{id,jdbcType=VARCHAR}
|
|
UNION
|
|
UNION
|
|
- SELECT
|
|
|
|
- r.id,r.config_id,r.sensor_id,
|
|
|
|
- s.sensor_name, s.description as sensorDescription,
|
|
|
|
- r.sensor_type,
|
|
|
|
- r.sensor_x, r.sensor_y, r.sensor_z, r.sensor_h, r.sensor_p, r.sensor_r, r.sensor_port
|
|
|
|
|
|
+ SELECT r.id,
|
|
|
|
+ r.config_id,
|
|
|
|
+ r.sensor_id,
|
|
|
|
+ s.sensor_name,
|
|
|
|
+ s.description as sensorDescription,
|
|
|
|
+ r.sensor_type,
|
|
|
|
+ r.sensor_x,
|
|
|
|
+ r.sensor_y,
|
|
|
|
+ r.sensor_z,
|
|
|
|
+ r.sensor_h,
|
|
|
|
+ r.sensor_p,
|
|
|
|
+ r.sensor_r,
|
|
|
|
+ r.sensor_port
|
|
FROM relation_config_sensor r
|
|
FROM relation_config_sensor r
|
|
- INNER JOIN model_sensor_lidar s ON r.sensor_id = s.id
|
|
|
|
- WHERE r.is_deleted = '0' and r.config_id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
|
+ INNER JOIN model_sensor_lidar s ON r.sensor_id = s.id
|
|
|
|
+ WHERE r.is_deleted = '0'
|
|
|
|
+ and r.config_id = #{id,jdbcType=VARCHAR}
|
|
UNION
|
|
UNION
|
|
- SELECT
|
|
|
|
- r.id,r.config_id,r.sensor_id,
|
|
|
|
- s.sensor_name, s.description as sensorDescription,
|
|
|
|
- r.sensor_type,
|
|
|
|
- r.sensor_x, r.sensor_y, r.sensor_z, r.sensor_h, r.sensor_p, r.sensor_r, r.sensor_port
|
|
|
|
|
|
+ SELECT r.id,
|
|
|
|
+ r.config_id,
|
|
|
|
+ r.sensor_id,
|
|
|
|
+ s.sensor_name,
|
|
|
|
+ s.description as sensorDescription,
|
|
|
|
+ r.sensor_type,
|
|
|
|
+ r.sensor_x,
|
|
|
|
+ r.sensor_y,
|
|
|
|
+ r.sensor_z,
|
|
|
|
+ r.sensor_h,
|
|
|
|
+ r.sensor_p,
|
|
|
|
+ r.sensor_r,
|
|
|
|
+ r.sensor_port
|
|
FROM relation_config_sensor r
|
|
FROM relation_config_sensor r
|
|
- INNER JOIN model_sensor_gps s ON r.sensor_id = s.id
|
|
|
|
- WHERE r.is_deleted = '0' and r.config_id = #{id,jdbcType=VARCHAR}
|
|
|
|
|
|
+ INNER JOIN model_sensor_gps s ON r.sensor_id = s.id
|
|
|
|
+ WHERE r.is_deleted = '0'
|
|
|
|
+ and r.config_id = #{id,jdbcType=VARCHAR}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="checkConfigName" parameterType="api.common.pojo.po.model.ConfigPO" resultMap="ConfigVOMap">
|
|
|
|
|
|
+ <select id="checkConfigName" parameterType="api.common.pojo.po.model.ConfigPO"
|
|
|
|
+ resultType="api.common.pojo.vo.model.ConfigVO">
|
|
select id,
|
|
select id,
|
|
- description as configDescription
|
|
|
|
|
|
+ description as configDescription
|
|
from model_config
|
|
from model_config
|
|
where is_deleted = '0'
|
|
where is_deleted = '0'
|
|
- and config_name = #{configName,jdbcType=VARCHAR}
|
|
|
|
|
|
+ and config_name = #{configName,jdbcType=VARCHAR}
|
|
<if test="share != null and share != ''">
|
|
<if test="share != null and share != ''">
|
|
and share = #{share,jdbcType=VARCHAR}
|
|
and share = #{share,jdbcType=VARCHAR}
|
|
</if>
|
|
</if>
|
|
@@ -120,73 +152,69 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<insert id="insertConfig" parameterType="api.common.pojo.po.model.ConfigPO">
|
|
<insert id="insertConfig" parameterType="api.common.pojo.po.model.ConfigPO">
|
|
- insert into model_config(
|
|
|
|
- id,
|
|
|
|
- config_code,
|
|
|
|
- config_name,
|
|
|
|
- description,
|
|
|
|
- vehicle_id,
|
|
|
|
- share,
|
|
|
|
- create_time,
|
|
|
|
- modify_time,
|
|
|
|
- create_user_id,
|
|
|
|
- modify_user_id,
|
|
|
|
- is_deleted,
|
|
|
|
- vehicle_array
|
|
|
|
- )
|
|
|
|
- values(
|
|
|
|
- #{id,jdbcType=VARCHAR},
|
|
|
|
- #{configCode,jdbcType=VARCHAR},
|
|
|
|
- #{configName,jdbcType=VARCHAR},
|
|
|
|
- #{description,jdbcType=VARCHAR},
|
|
|
|
- #{vehicleId,jdbcType=VARCHAR},
|
|
|
|
- #{share,jdbcType=VARCHAR},
|
|
|
|
- #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
- #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
|
- #{createUserId,jdbcType=VARCHAR},
|
|
|
|
- #{modifyUserId,jdbcType=VARCHAR},
|
|
|
|
- #{isDeleted,jdbcType=VARCHAR},
|
|
|
|
- #{vehicleArray,jdbcType=VARCHAR}
|
|
|
|
- )
|
|
|
|
|
|
+ insert into model_config(id,
|
|
|
|
+ config_code,
|
|
|
|
+ config_name,
|
|
|
|
+ description,
|
|
|
|
+ vehicle_id,
|
|
|
|
+ share,
|
|
|
|
+ create_time,
|
|
|
|
+ modify_time,
|
|
|
|
+ create_user_id,
|
|
|
|
+ modify_user_id,
|
|
|
|
+ is_deleted,
|
|
|
|
+ vehicle_array)
|
|
|
|
+ values (#{id,jdbcType=VARCHAR},
|
|
|
|
+ #{configCode,jdbcType=VARCHAR},
|
|
|
|
+ #{configName,jdbcType=VARCHAR},
|
|
|
|
+ #{description,jdbcType=VARCHAR},
|
|
|
|
+ #{vehicleId,jdbcType=VARCHAR},
|
|
|
|
+ #{share,jdbcType=VARCHAR},
|
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
+ #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
|
+ #{createUserId,jdbcType=VARCHAR},
|
|
|
|
+ #{modifyUserId,jdbcType=VARCHAR},
|
|
|
|
+ #{isDeleted,jdbcType=VARCHAR},
|
|
|
|
+ #{vehicleArray,jdbcType=VARCHAR})
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<update id="updateConfig" parameterType="api.common.pojo.po.model.ConfigPO">
|
|
<update id="updateConfig" parameterType="api.common.pojo.po.model.ConfigPO">
|
|
- update model_config set
|
|
|
|
- config_name = #{configName,jdbcType=VARCHAR},
|
|
|
|
- description = #{description,jdbcType=VARCHAR},
|
|
|
|
- vehicle_id = #{vehicleId,jdbcType=VARCHAR},
|
|
|
|
- vehicle_array = #{vehicleArray,jdbcType=VARCHAR},
|
|
|
|
- modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
|
|
|
+ update model_config
|
|
|
|
+ set config_name = #{configName,jdbcType=VARCHAR},
|
|
|
|
+ description = #{description,jdbcType=VARCHAR},
|
|
|
|
+ vehicle_id = #{vehicleId,jdbcType=VARCHAR},
|
|
|
|
+ vehicle_array = #{vehicleArray,jdbcType=VARCHAR},
|
|
|
|
+ modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
|
|
modify_user_id = #{modifyUserId,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<update id="delConfigSensors" parameterType="api.common.pojo.po.model.ConfigPO">
|
|
<update id="delConfigSensors" parameterType="api.common.pojo.po.model.ConfigPO">
|
|
- update relation_config_sensor set
|
|
|
|
- modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
|
|
|
+ update relation_config_sensor
|
|
|
|
+ set modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
|
|
modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
|
|
- is_deleted = '1'
|
|
|
|
|
|
+ is_deleted = '1'
|
|
where config_id = #{id,jdbcType=VARCHAR}
|
|
where config_id = #{id,jdbcType=VARCHAR}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<insert id="insertConfigSensors">
|
|
<insert id="insertConfigSensors">
|
|
insert into relation_config_sensor(
|
|
insert into relation_config_sensor(
|
|
- id,
|
|
|
|
- config_id,
|
|
|
|
- sensor_id,
|
|
|
|
- sensor_type,
|
|
|
|
- sensor_x,
|
|
|
|
- sensor_y,
|
|
|
|
- sensor_z,
|
|
|
|
- sensor_h,
|
|
|
|
- sensor_p,
|
|
|
|
- sensor_r,
|
|
|
|
- sensor_port,
|
|
|
|
- create_time,
|
|
|
|
- modify_time,
|
|
|
|
- create_user_id,
|
|
|
|
- modify_user_id,
|
|
|
|
- is_deleted
|
|
|
|
|
|
+ id,
|
|
|
|
+ config_id,
|
|
|
|
+ sensor_id,
|
|
|
|
+ sensor_type,
|
|
|
|
+ sensor_x,
|
|
|
|
+ sensor_y,
|
|
|
|
+ sensor_z,
|
|
|
|
+ sensor_h,
|
|
|
|
+ sensor_p,
|
|
|
|
+ sensor_r,
|
|
|
|
+ sensor_port,
|
|
|
|
+ create_time,
|
|
|
|
+ modify_time,
|
|
|
|
+ create_user_id,
|
|
|
|
+ modify_user_id,
|
|
|
|
+ is_deleted
|
|
) values
|
|
) values
|
|
<foreach collection="list" item="item" separator=",">
|
|
<foreach collection="list" item="item" separator=",">
|
|
(
|
|
(
|
|
@@ -211,14 +239,18 @@
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
<update id="delConfigById" parameterType="api.common.pojo.po.model.ConfigPO">
|
|
<update id="delConfigById" parameterType="api.common.pojo.po.model.ConfigPO">
|
|
- update model_config set
|
|
|
|
- modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
|
- modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
|
|
|
|
- is_deleted = #{isDeleted,jdbcType=VARCHAR}
|
|
|
|
|
|
+ update model_config
|
|
|
|
+ set modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
|
|
+ modify_user_id = #{modifyUserId,jdbcType=VARCHAR},
|
|
|
|
+ is_deleted = #{isDeleted,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
</update>
|
|
</update>
|
|
|
|
|
|
<select id="getConfigTotal" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
<select id="getConfigTotal" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
- select COUNT(1) from model_config where is_deleted = '0' and share = '0' and create_user_id = #{createUserId,jdbcType=VARCHAR}
|
|
|
|
|
|
+ select COUNT(1)
|
|
|
|
+ from model_config
|
|
|
|
+ where is_deleted = '0'
|
|
|
|
+ and share = '0'
|
|
|
|
+ and create_user_id = #{createUserId,jdbcType=VARCHAR}
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|