|
|
@@ -0,0 +1,357 @@
|
|
|
+<?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.zd.system.mapper.SysUrlConfigDao">
|
|
|
+
|
|
|
+ <resultMap type="com.zd.system.domain.SysUrlConfig" id="SysUrlConfigMap">
|
|
|
+ <result property="id" column="id" jdbcType="INTEGER"/>
|
|
|
+ <result property="fileIntranetUrl" column="file_intranet_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="fileExtranetUrl" column="file_extranet_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="cameraIntranetUrl" column="camera_intranet_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="cameraExtranetUrl" column="camera_extranet_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="cameraIntranetAgent" column="camera_intranet_agent" jdbcType="VARCHAR"/>
|
|
|
+ <result property="cameraExtranetAgent" column="camera_extranet_agent" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mqttIntranetUrl" column="mqtt_intranet_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mqttIntranetUser" column="mqtt_intranet_user" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mqttIntranetPassword" column="mqtt_intranet_password" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mqttExtranetUrl" column="mqtt_extranet_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mqttExtranetUser" column="mqtt_extranet_user" jdbcType="VARCHAR"/>
|
|
|
+ <result property="mqttExtranetPassword" column="mqtt_extranet_password" jdbcType="VARCHAR"/>
|
|
|
+ <result property="screenIntranetUrl" column="screen_intranet_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="screenExtranetUrl" column="screen_extranet_url" jdbcType="VARCHAR"/>
|
|
|
+ <result property="deptId" column="dept_id" jdbcType="INTEGER"/>
|
|
|
+ <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="userId" column="user_id" jdbcType="INTEGER"/>
|
|
|
+ <result property="createBy" column="create_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
|
+ <result property="updateBy" column="update_by" jdbcType="VARCHAR"/>
|
|
|
+ <result property="remark" column="remark" jdbcType="VARCHAR"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <!--查询单个-->
|
|
|
+ <select id="queryById" resultMap="SysUrlConfigMap">
|
|
|
+ select id,
|
|
|
+ file_intranet_url,
|
|
|
+ file_extranet_url,
|
|
|
+ camera_intranet_url,
|
|
|
+ camera_extranet_url,
|
|
|
+ camera_intranet_agent,
|
|
|
+ camera_extranet_agent,
|
|
|
+ mqtt_intranet_url,
|
|
|
+ mqtt_intranet_user,
|
|
|
+ mqtt_intranet_password,
|
|
|
+ mqtt_extranet_url,
|
|
|
+ mqtt_extranet_user,
|
|
|
+ mqtt_extranet_password,
|
|
|
+ screen_intranet_url,
|
|
|
+ screen_extranet_url,
|
|
|
+ dept_id,
|
|
|
+ create_time,
|
|
|
+ user_id,
|
|
|
+ create_by,
|
|
|
+ update_time,
|
|
|
+ update_by,
|
|
|
+ remark
|
|
|
+ from sys_url_config
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--查询指定行数据-->
|
|
|
+ <select id="queryAll" resultMap="SysUrlConfigMap">
|
|
|
+ select
|
|
|
+ id, file_intranet_url, file_extranet_url, camera_intranet_url, camera_extranet_url, camera_intranet_agent,
|
|
|
+ camera_extranet_agent, mqtt_intranet_url, mqtt_intranet_user, mqtt_intranet_password, mqtt_extranet_url,
|
|
|
+ mqtt_extranet_user, mqtt_extranet_password, screen_intranet_url, screen_extranet_url, dept_id, create_time,
|
|
|
+ user_id, create_by, update_time, update_by, remark
|
|
|
+ from sys_url_config
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="fileIntranetUrl != null and fileIntranetUrl != ''">
|
|
|
+ and file_intranet_url = #{fileIntranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="fileExtranetUrl != null and fileExtranetUrl != ''">
|
|
|
+ and file_extranet_url = #{fileExtranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="cameraIntranetUrl != null and cameraIntranetUrl != ''">
|
|
|
+ and camera_intranet_url = #{cameraIntranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="cameraExtranetUrl != null and cameraExtranetUrl != ''">
|
|
|
+ and camera_extranet_url = #{cameraExtranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="cameraIntranetAgent != null and cameraIntranetAgent != ''">
|
|
|
+ and camera_intranet_agent = #{cameraIntranetAgent}
|
|
|
+ </if>
|
|
|
+ <if test="cameraExtranetAgent != null and cameraExtranetAgent != ''">
|
|
|
+ and camera_extranet_agent = #{cameraExtranetAgent}
|
|
|
+ </if>
|
|
|
+ <if test="mqttIntranetUrl != null and mqttIntranetUrl != ''">
|
|
|
+ and mqtt_intranet_url = #{mqttIntranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="mqttIntranetUser != null and mqttIntranetUser != ''">
|
|
|
+ and mqtt_intranet_user = #{mqttIntranetUser}
|
|
|
+ </if>
|
|
|
+ <if test="mqttIntranetPassword != null and mqttIntranetPassword != ''">
|
|
|
+ and mqtt_intranet_password = #{mqttIntranetPassword}
|
|
|
+ </if>
|
|
|
+ <if test="mqttExtranetUrl != null and mqttExtranetUrl != ''">
|
|
|
+ and mqtt_extranet_url = #{mqttExtranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="mqttExtranetUser != null and mqttExtranetUser != ''">
|
|
|
+ and mqtt_extranet_user = #{mqttExtranetUser}
|
|
|
+ </if>
|
|
|
+ <if test="mqttExtranetPassword != null and mqttExtranetPassword != ''">
|
|
|
+ and mqtt_extranet_password = #{mqttExtranetPassword}
|
|
|
+ </if>
|
|
|
+ <if test="screenIntranetUrl != null and screenIntranetUrl != ''">
|
|
|
+ and screen_intranet_url = #{screenIntranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="screenExtranetUrl != null and screenExtranetUrl != ''">
|
|
|
+ and screen_extranet_url = #{screenExtranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null">
|
|
|
+ and dept_id = #{deptId}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ and create_by = #{createBy}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ and update_time = #{updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">
|
|
|
+ and update_by = #{updateBy}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
+ and remark = #{remark}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--统计总行数-->
|
|
|
+ <select id="count" resultType="java.lang.Long">
|
|
|
+ select count(1)
|
|
|
+ from sys_url_config
|
|
|
+ <where>
|
|
|
+ <if test="id != null">
|
|
|
+ and id = #{id}
|
|
|
+ </if>
|
|
|
+ <if test="fileIntranetUrl != null and fileIntranetUrl != ''">
|
|
|
+ and file_intranet_url = #{fileIntranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="fileExtranetUrl != null and fileExtranetUrl != ''">
|
|
|
+ and file_extranet_url = #{fileExtranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="cameraIntranetUrl != null and cameraIntranetUrl != ''">
|
|
|
+ and camera_intranet_url = #{cameraIntranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="cameraExtranetUrl != null and cameraExtranetUrl != ''">
|
|
|
+ and camera_extranet_url = #{cameraExtranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="cameraIntranetAgent != null and cameraIntranetAgent != ''">
|
|
|
+ and camera_intranet_agent = #{cameraIntranetAgent}
|
|
|
+ </if>
|
|
|
+ <if test="cameraExtranetAgent != null and cameraExtranetAgent != ''">
|
|
|
+ and camera_extranet_agent = #{cameraExtranetAgent}
|
|
|
+ </if>
|
|
|
+ <if test="mqttIntranetUrl != null and mqttIntranetUrl != ''">
|
|
|
+ and mqtt_intranet_url = #{mqttIntranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="mqttIntranetUser != null and mqttIntranetUser != ''">
|
|
|
+ and mqtt_intranet_user = #{mqttIntranetUser}
|
|
|
+ </if>
|
|
|
+ <if test="mqttIntranetPassword != null and mqttIntranetPassword != ''">
|
|
|
+ and mqtt_intranet_password = #{mqttIntranetPassword}
|
|
|
+ </if>
|
|
|
+ <if test="mqttExtranetUrl != null and mqttExtranetUrl != ''">
|
|
|
+ and mqtt_extranet_url = #{mqttExtranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="mqttExtranetUser != null and mqttExtranetUser != ''">
|
|
|
+ and mqtt_extranet_user = #{mqttExtranetUser}
|
|
|
+ </if>
|
|
|
+ <if test="mqttExtranetPassword != null and mqttExtranetPassword != ''">
|
|
|
+ and mqtt_extranet_password = #{mqttExtranetPassword}
|
|
|
+ </if>
|
|
|
+ <if test="screenIntranetUrl != null and screenIntranetUrl != ''">
|
|
|
+ and screen_intranet_url = #{screenIntranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="screenExtranetUrl != null and screenExtranetUrl != ''">
|
|
|
+ and screen_extranet_url = #{screenExtranetUrl}
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null">
|
|
|
+ and dept_id = #{deptId}
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ and create_time = #{createTime}
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ and user_id = #{userId}
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ and create_by = #{createBy}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ and update_time = #{updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">
|
|
|
+ and update_by = #{updateBy}
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
+ and remark = #{remark}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!--新增所有列-->
|
|
|
+ <insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into sys_url_config(file_intranet_url, file_extranet_url, camera_intranet_url, camera_extranet_url,
|
|
|
+ camera_intranet_agent, camera_extranet_agent, mqtt_intranet_url, mqtt_intranet_user,
|
|
|
+ mqtt_intranet_password, mqtt_extranet_url, mqtt_extranet_user,
|
|
|
+ mqtt_extranet_password, screen_intranet_url, screen_extranet_url, dept_id,
|
|
|
+ create_time, user_id, create_by, update_time, update_by, remark)
|
|
|
+ values (#{fileIntranetUrl}, #{fileExtranetUrl}, #{cameraIntranetUrl}, #{cameraExtranetUrl},
|
|
|
+ #{cameraIntranetAgent}, #{cameraExtranetAgent}, #{mqttIntranetUrl}, #{mqttIntranetUser},
|
|
|
+ #{mqttIntranetPassword}, #{mqttExtranetUrl}, #{mqttExtranetUser}, #{mqttExtranetPassword},
|
|
|
+ #{screenIntranetUrl}, #{screenExtranetUrl}, #{deptId}, #{createTime}, #{userId}, #{createBy},
|
|
|
+ #{updateTime}, #{updateBy}, #{remark})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into sys_url_config(file_intranet_url, file_extranet_url, camera_intranet_url, camera_extranet_url,
|
|
|
+ camera_intranet_agent, camera_extranet_agent, mqtt_intranet_url, mqtt_intranet_user, mqtt_intranet_password,
|
|
|
+ mqtt_extranet_url, mqtt_extranet_user, mqtt_extranet_password, screen_intranet_url, screen_extranet_url,
|
|
|
+ dept_id, create_time, user_id, create_by, update_time, update_by, remark)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.fileIntranetUrl}, #{entity.fileExtranetUrl}, #{entity.cameraIntranetUrl},
|
|
|
+ #{entity.cameraExtranetUrl}, #{entity.cameraIntranetAgent}, #{entity.cameraExtranetAgent},
|
|
|
+ #{entity.mqttIntranetUrl}, #{entity.mqttIntranetUser}, #{entity.mqttIntranetPassword},
|
|
|
+ #{entity.mqttExtranetUrl}, #{entity.mqttExtranetUser}, #{entity.mqttExtranetPassword},
|
|
|
+ #{entity.screenIntranetUrl}, #{entity.screenExtranetUrl}, #{entity.deptId}, #{entity.createTime},
|
|
|
+ #{entity.userId}, #{entity.createBy}, #{entity.updateTime}, #{entity.updateBy}, #{entity.remark})
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
|
|
|
+ insert into sys_url_config(file_intranet_url, file_extranet_url, camera_intranet_url, camera_extranet_url,
|
|
|
+ camera_intranet_agent, camera_extranet_agent, mqtt_intranet_url, mqtt_intranet_user, mqtt_intranet_password,
|
|
|
+ mqtt_extranet_url, mqtt_extranet_user, mqtt_extranet_password, screen_intranet_url, screen_extranet_url,
|
|
|
+ dept_id, create_time, user_id, create_by, update_time, update_by, remark)
|
|
|
+ values
|
|
|
+ <foreach collection="entities" item="entity" separator=",">
|
|
|
+ (#{entity.fileIntranetUrl}, #{entity.fileExtranetUrl}, #{entity.cameraIntranetUrl},
|
|
|
+ #{entity.cameraExtranetUrl}, #{entity.cameraIntranetAgent}, #{entity.cameraExtranetAgent},
|
|
|
+ #{entity.mqttIntranetUrl}, #{entity.mqttIntranetUser}, #{entity.mqttIntranetPassword},
|
|
|
+ #{entity.mqttExtranetUrl}, #{entity.mqttExtranetUser}, #{entity.mqttExtranetPassword},
|
|
|
+ #{entity.screenIntranetUrl}, #{entity.screenExtranetUrl}, #{entity.deptId}, #{entity.createTime},
|
|
|
+ #{entity.userId}, #{entity.createBy}, #{entity.updateTime}, #{entity.updateBy}, #{entity.remark})
|
|
|
+ </foreach>
|
|
|
+ on duplicate key update
|
|
|
+ file_intranet_url = values(file_intranet_url),
|
|
|
+ file_extranet_url = values(file_extranet_url),
|
|
|
+ camera_intranet_url = values(camera_intranet_url),
|
|
|
+ camera_extranet_url = values(camera_extranet_url),
|
|
|
+ camera_intranet_agent = values(camera_intranet_agent),
|
|
|
+ camera_extranet_agent = values(camera_extranet_agent),
|
|
|
+ mqtt_intranet_url = values(mqtt_intranet_url),
|
|
|
+ mqtt_intranet_user = values(mqtt_intranet_user),
|
|
|
+ mqtt_intranet_password = values(mqtt_intranet_password),
|
|
|
+ mqtt_extranet_url = values(mqtt_extranet_url),
|
|
|
+ mqtt_extranet_user = values(mqtt_extranet_user),
|
|
|
+ mqtt_extranet_password = values(mqtt_extranet_password),
|
|
|
+ screen_intranet_url = values(screen_intranet_url),
|
|
|
+ screen_extranet_url = values(screen_extranet_url),
|
|
|
+ dept_id = values(dept_id),
|
|
|
+ create_time = values(create_time),
|
|
|
+ user_id = values(user_id),
|
|
|
+ create_by = values(create_by),
|
|
|
+ update_time = values(update_time),
|
|
|
+ update_by = values(update_by),
|
|
|
+ remark = values(remark)
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!--通过主键修改数据-->
|
|
|
+ <update id="update">
|
|
|
+ update sys_url_config
|
|
|
+ <set>
|
|
|
+ <if test="fileIntranetUrl != null and fileIntranetUrl != ''">
|
|
|
+ file_intranet_url = #{fileIntranetUrl},
|
|
|
+ </if>
|
|
|
+ <if test="fileExtranetUrl != null and fileExtranetUrl != ''">
|
|
|
+ file_extranet_url = #{fileExtranetUrl},
|
|
|
+ </if>
|
|
|
+ <if test="cameraIntranetUrl != null and cameraIntranetUrl != ''">
|
|
|
+ camera_intranet_url = #{cameraIntranetUrl},
|
|
|
+ </if>
|
|
|
+ <if test="cameraExtranetUrl != null and cameraExtranetUrl != ''">
|
|
|
+ camera_extranet_url = #{cameraExtranetUrl},
|
|
|
+ </if>
|
|
|
+ <if test="cameraIntranetAgent != null and cameraIntranetAgent != ''">
|
|
|
+ camera_intranet_agent = #{cameraIntranetAgent},
|
|
|
+ </if>
|
|
|
+ <if test="cameraExtranetAgent != null and cameraExtranetAgent != ''">
|
|
|
+ camera_extranet_agent = #{cameraExtranetAgent},
|
|
|
+ </if>
|
|
|
+ <if test="mqttIntranetUrl != null and mqttIntranetUrl != ''">
|
|
|
+ mqtt_intranet_url = #{mqttIntranetUrl},
|
|
|
+ </if>
|
|
|
+ <if test="mqttIntranetUser != null and mqttIntranetUser != ''">
|
|
|
+ mqtt_intranet_user = #{mqttIntranetUser},
|
|
|
+ </if>
|
|
|
+ <if test="mqttIntranetPassword != null and mqttIntranetPassword != ''">
|
|
|
+ mqtt_intranet_password = #{mqttIntranetPassword},
|
|
|
+ </if>
|
|
|
+ <if test="mqttExtranetUrl != null and mqttExtranetUrl != ''">
|
|
|
+ mqtt_extranet_url = #{mqttExtranetUrl},
|
|
|
+ </if>
|
|
|
+ <if test="mqttExtranetUser != null and mqttExtranetUser != ''">
|
|
|
+ mqtt_extranet_user = #{mqttExtranetUser},
|
|
|
+ </if>
|
|
|
+ <if test="mqttExtranetPassword != null and mqttExtranetPassword != ''">
|
|
|
+ mqtt_extranet_password = #{mqttExtranetPassword},
|
|
|
+ </if>
|
|
|
+ <if test="screenIntranetUrl != null and screenIntranetUrl != ''">
|
|
|
+ screen_intranet_url = #{screenIntranetUrl},
|
|
|
+ </if>
|
|
|
+ <if test="screenExtranetUrl != null and screenExtranetUrl != ''">
|
|
|
+ screen_extranet_url = #{screenExtranetUrl},
|
|
|
+ </if>
|
|
|
+ <if test="deptId != null">
|
|
|
+ dept_id = #{deptId},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="userId != null">
|
|
|
+ user_id = #{userId},
|
|
|
+ </if>
|
|
|
+ <if test="createBy != null and createBy != ''">
|
|
|
+ create_by = #{createBy},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time = #{updateTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateBy != null and updateBy != ''">
|
|
|
+ update_by = #{updateBy},
|
|
|
+ </if>
|
|
|
+ <if test="remark != null and remark != ''">
|
|
|
+ remark = #{remark},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!--通过主键删除-->
|
|
|
+ <delete id="deleteById">
|
|
|
+ delete
|
|
|
+ from sys_url_config
|
|
|
+ where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|
|
|
+
|