| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?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.tuoren.forward.mapper.UserConfigMapper">
- <resultMap id="BaseResultMap" type="com.tuoren.forward.entity.UserConfig">
- <id column="id" jdbcType="VARCHAR" property="id"/>
- <result column="wifi" jdbcType="VARCHAR" property="wifi"/>
- <result column="address" jdbcType="VARCHAR" property="address"/>
- <result column="device_secret" jdbcType="VARCHAR" property="deviceSecret"/>
- <result column="createtime" jdbcType="TIMESTAMP" property="createtime"/>
- <result column="modifytime" jdbcType="TIMESTAMP" property="modifytime"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, wifi, address,device_secret, createtime, modifytime
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from user_config
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete
- from user_config
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.tuoren.forward.entity.UserConfig">
- insert into user_config (id, wifi, address, device_secret, createtime, modifytime)
- values (#{id,jdbcType=VARCHAR},
- #{wifi,jdbcType=VARCHAR},
- #{address,jdbcType=VARCHAR},
- #{deviceSecret,jdbcType=VARCHAR},
- #{createtime,jdbcType=TIMESTAMP},
- #{modifytime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.tuoren.forward.entity.UserConfig">
- insert into user_config
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="wifi != null">
- wifi,
- </if>
- <if test="address != null">
- address,
- </if>
- <if test="deviceSecret != null">
- device_secret,
- </if>
- <if test="createtime != null">
- createtime,
- </if>
- <if test="modifytime != null">
- modifytime,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="wifi != null">
- #{wifi,jdbcType=VARCHAR},
- </if>
- <if test="address != null">
- #{address,jdbcType=VARCHAR},
- </if>
- <if test="deviceSecret != null">
- #{deviceSecret,jdbcType=VARCHAR},
- </if>
- <if test="createtime != null">
- #{createtime,jdbcType=TIMESTAMP},
- </if>
- <if test="modifytime != null">
- #{modifytime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.tuoren.forward.entity.UserConfig">
- update user_config
- <set>
- <if test="wifi != null">
- wifi = #{wifi,jdbcType=VARCHAR},
- </if>
- <if test="address != null">
- address = #{address,jdbcType=VARCHAR},
- </if>
- <if test="deviceSecret != null">
- device_secret = #{deviceSecret,jdbcType=VARCHAR},
- </if>
- <if test="createtime != null">
- createtime = #{createtime,jdbcType=TIMESTAMP},
- </if>
- <if test="modifytime != null">
- modifytime = #{modifytime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.tuoren.forward.entity.UserConfig">
- update user_config
- set wifi = #{wifi,jdbcType=VARCHAR},
- address = #{address,jdbcType=VARCHAR},
- device_secret = #{deviceSecret,jdbcType=VARCHAR},
- createtime = #{createtime,jdbcType=TIMESTAMP},
- modifytime = #{modifytime,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <select id="selectOneOr" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List"/>
- from user_config
- where wifi = #{wifi,jdbcType=VARCHAR} limit 1
- </select>
- </mapper>
|