| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?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.ufo.project.config.mapper.ConfigStationChannelMapper">
- <resultMap type="ConfigStationChannel" id="ConfigStationChannelResult">
- <result property="id" column="id" />
- <result property="stationId" column="station_id" />
- <result property="stationName" column="station_name" />
- <result property="channelName" column="channel_name" />
- <result property="protocol" column="protocol" />
- <result property="host" column="host" />
- <result property="port" column="port" />
- <result property="collectInterval" column="collect_interval" />
- <result property="dataType" column="data_type" />
- <result property="status" column="status" />
- <result property="lastSyncTime" column="last_sync_time" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="remark" column="remark" />
- </resultMap>
- <sql id="selectConfigStationChannelVo">
- select t.id, t.station_id, s.station_name, t.channel_name, t.protocol, t.host, t.port, t.collect_interval, t.data_type, t.status, t.last_sync_time, t.create_by, t.create_time, t.update_by, t.update_time, t.remark from config_station_channel t left join config_station s on s.id = t.station_id
- </sql>
- <select id="selectConfigStationChannelList" parameterType="ConfigStationChannel" resultMap="ConfigStationChannelResult">
- <include refid="selectConfigStationChannelVo"/>
- <where>
- <if test="stationId != null"> and t.station_id = #{stationId}</if>
- <if test="channelName != null and channelName != ''"> and t.channel_name like concat('%', #{channelName}, '%')</if>
- <if test="protocol != null"> and t.protocol = #{protocol}</if>
- <if test="host != null and host != ''"> and t.host like concat('%', #{host}, '%')</if>
- <if test="port != null"> and t.port = #{port}</if>
- <if test="dataType != null and dataType != ''"> and t.data_type like concat('%', #{dataType}, '%')</if>
- <if test="status != null"> and t.status = #{status}</if>
- </where>
- order by t.id desc
- </select>
- <select id="selectConfigStationChannelById" parameterType="Long" resultMap="ConfigStationChannelResult">
- <include refid="selectConfigStationChannelVo"/>
- where t.id = #{id}
- </select>
- <insert id="insertConfigStationChannel" parameterType="ConfigStationChannel" useGeneratedKeys="true" keyProperty="id">
- insert into config_station_channel (station_id, channel_name, protocol, host, port, collect_interval, data_type, status, last_sync_time, create_by, create_time, update_by, update_time, remark)
- values (#{stationId}, #{channelName}, #{protocol}, #{host}, #{port}, #{collectInterval}, #{dataType}, #{status}, #{lastSyncTime}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{remark})
- </insert>
- <update id="updateConfigStationChannel" parameterType="ConfigStationChannel">
- update config_station_channel
- <trim prefix="SET" suffixOverrides=",">
- <if test="stationId != null">station_id = #{stationId},</if>
- <if test="channelName != null">channel_name = #{channelName},</if>
- <if test="protocol != null">protocol = #{protocol},</if>
- <if test="host != null">host = #{host},</if>
- <if test="port != null">port = #{port},</if>
- <if test="collectInterval != null">collect_interval = #{collectInterval},</if>
- <if test="dataType != null">data_type = #{dataType},</if>
- <if test="status != null">status = #{status},</if>
- <if test="lastSyncTime != null">last_sync_time = #{lastSyncTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="remark != null">remark = #{remark},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteConfigStationChannelById" parameterType="Long">
- delete from config_station_channel where id = #{id}
- </delete>
- <delete id="deleteConfigStationChannelByIds" parameterType="Long">
- delete from config_station_channel where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|