123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- <?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.zcxk.smartcity.data.access.dao.DeviceDataPushConfigMapper">
- <resultMap id="BaseResultMap" type="com.zcxk.smartcity.data.access.entity.DeviceDataPushConfig">
- <!--@mbg.generated-->
- <id column="id" property="id" />
- <result column="receiver_name" property="receiverName" />
- <result column="push_method" property="pushMethod" />
- <result column="push_customers" property="pushCustomers" />
- <result column="push_communitys" property="pushCommunitys" />
- <result column="push_buildings" property="pushBuildings" />
- <result column="push_url" property="pushUrl" />
- <result column="push_server" property="pushServer" />
- <result column="push_port" property="pushPort" />
- <result column="status" property="status" />
- <result column="create_by" property="createBy" />
- <result column="update_by" property="updateBy" />
- <result column="date_create" property="dateCreate" />
- <result column="date_update" property="dateUpdate" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--@mbg.generated-->
- id, receiver_name, push_method, push_customers, push_communitys, push_buildings,
- push_url, push_server, push_port, `status`, create_by, update_by, date_create, date_update,is_parsed
- </sql>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.zcxk.smartcity.data.access.entity.DeviceDataPushConfig" useGeneratedKeys="true">
- <!--@mbg.generated-->
- insert into sc_device_data_push_config
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="receiverName != null">
- receiver_name,
- </if>
- <if test="pushMethod != null">
- push_method,
- </if>
- <if test="pushCustomers != null">
- push_customers,
- </if>
- <if test="pushCommunitys != null">
- push_communitys,
- </if>
- <if test="pushBuildings != null">
- push_buildings,
- </if>
- <if test="pushUrl != null">
- push_url,
- </if>
- <if test="pushServer != null">
- push_server,
- </if>
- <if test="pushPort != null">
- push_port,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="createBy != null">
- create_by,
- </if>
- <if test="updateBy != null">
- update_by,
- </if>
- <if test="dateCreate != null">
- date_create,
- </if>
- <if test="dateUpdate != null">
- date_update,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="receiverName != null">
- #{receiverName},
- </if>
- <if test="pushMethod != null">
- #{pushMethod},
- </if>
- <if test="pushCustomers != null">
- #{pushCustomers},
- </if>
- <if test="pushCommunitys != null">
- #{pushCommunitys},
- </if>
- <if test="pushBuildings != null">
- #{pushBuildings},
- </if>
- <if test="pushUrl != null">
- #{pushUrl},
- </if>
- <if test="pushServer != null">
- #{pushServer},
- </if>
- <if test="pushPort != null">
- #{pushPort},
- </if>
- <if test="status != null">
- #{status},
- </if>
- <if test="createBy != null">
- #{createBy},
- </if>
- <if test="updateBy != null">
- #{updateBy},
- </if>
- <if test="dateCreate != null">
- #{dateCreate},
- </if>
- <if test="dateUpdate != null">
- #{dateUpdate},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.zcxk.smartcity.data.access.entity.DeviceDataPushConfig">
- <!--@mbg.generated-->
- update sc_device_data_push_config
- <set>
- <if test="receiverName != null">
- receiver_name = #{receiverName},
- </if>
- <if test="pushMethod != null">
- push_method = #{pushMethod},
- </if>
- <if test="pushCustomers != null">
- push_customers = #{pushCustomers},
- </if>
- <if test="pushCommunitys != null">
- push_communitys = #{pushCommunitys},
- </if>
- <if test="pushBuildings != null">
- push_buildings = #{pushBuildings},
- </if>
- <if test="pushUrl != null">
- push_url = #{pushUrl},
- </if>
- <if test="pushServer != null">
- push_server = #{pushServer},
- </if>
- <if test="pushPort != null">
- push_port = #{pushPort},
- </if>
- <if test="status != null">
- `status` = #{status},
- </if>
- <if test="createBy != null">
- create_by = #{createBy},
- </if>
- <if test="updateBy != null">
- update_by = #{updateBy},
- </if>
- <if test="dateCreate != null">
- date_create = #{dateCreate},
- </if>
- <if test="dateUpdate != null">
- date_update = #{dateUpdate},
- </if>
- </set>
- where id = #{id}
- </update>
- <select id="findPushConfig" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from sc_device_data_push_config
- <where>
- status = 1
- and is_batch = 0
- and (
- <trim prefixOverrides="OR">
- <if test="customerId != null and customerId != 0 " >
- or FIND_IN_SET( #{customerId}, push_customers )
- </if>
- <if test="communityId != null and communityId != 0 ">
- or FIND_IN_SET( #{communityId}, push_communitys )
- </if>
- <if test="buildingId != null and buildingId != 0 ">
- or FIND_IN_SET( #{buildingId}, push_buildings )
- </if>
- </trim>
- )
- </where>
- limit 1
- </select>
- </mapper>
|