|
|
@@ -3,14 +3,14 @@
|
|
|
<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="user_id" jdbcType="VARCHAR" property="userId" />
|
|
|
- <result column="wifi_name" jdbcType="VARCHAR" property="wifiName" />
|
|
|
- <result column="wifi_password" jdbcType="VARCHAR" property="wifiPassword" />
|
|
|
+ <result column="wifi" jdbcType="VARCHAR" property="wifi" />
|
|
|
+ <result column="local_address" jdbcType="VARCHAR" property="localAddress" />
|
|
|
+ <result column="local_port" jdbcType="INTEGER" property="localPort" />
|
|
|
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
|
|
|
- <result column="modifytime" jdbcType="VARCHAR" property="modifytime" />
|
|
|
+ <result column="modifytime" jdbcType="TIMESTAMP" property="modifytime" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
- id, user_id, wifi_name, wifi_password, createtime, modifytime
|
|
|
+ id, wifi, local_address, local_port, createtime, modifytime
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -23,11 +23,11 @@
|
|
|
where id = #{id,jdbcType=VARCHAR}
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.tuoren.forward.entity.UserConfig">
|
|
|
- insert into user_config (id, user_id, wifi_name,
|
|
|
- wifi_password, createtime, modifytime
|
|
|
+ insert into user_config (id, wifi, local_address,
|
|
|
+ local_port, createtime, modifytime
|
|
|
)
|
|
|
- values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{wifiName,jdbcType=VARCHAR},
|
|
|
- #{wifiPassword,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{modifytime,jdbcType=VARCHAR}
|
|
|
+ values (#{id,jdbcType=VARCHAR}, #{wifi,jdbcType=VARCHAR}, #{localAddress,jdbcType=VARCHAR},
|
|
|
+ #{localPort,jdbcType=INTEGER}, #{createtime,jdbcType=TIMESTAMP}, #{modifytime,jdbcType=TIMESTAMP}
|
|
|
)
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.tuoren.forward.entity.UserConfig">
|
|
|
@@ -36,14 +36,14 @@
|
|
|
<if test="id != null">
|
|
|
id,
|
|
|
</if>
|
|
|
- <if test="userId != null">
|
|
|
- user_id,
|
|
|
+ <if test="wifi != null">
|
|
|
+ wifi,
|
|
|
</if>
|
|
|
- <if test="wifiName != null">
|
|
|
- wifi_name,
|
|
|
+ <if test="localAddress != null">
|
|
|
+ local_address,
|
|
|
</if>
|
|
|
- <if test="wifiPassword != null">
|
|
|
- wifi_password,
|
|
|
+ <if test="localPort != null">
|
|
|
+ local_port,
|
|
|
</if>
|
|
|
<if test="createtime != null">
|
|
|
createtime,
|
|
|
@@ -56,51 +56,58 @@
|
|
|
<if test="id != null">
|
|
|
#{id,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="userId != null">
|
|
|
- #{userId,jdbcType=VARCHAR},
|
|
|
+ <if test="wifi != null">
|
|
|
+ #{wifi,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="wifiName != null">
|
|
|
- #{wifiName,jdbcType=VARCHAR},
|
|
|
+ <if test="localAddress != null">
|
|
|
+ #{localAddress,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="wifiPassword != null">
|
|
|
- #{wifiPassword,jdbcType=VARCHAR},
|
|
|
+ <if test="localPort != null">
|
|
|
+ #{localPort,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="createtime != null">
|
|
|
#{createtime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
<if test="modifytime != null">
|
|
|
- #{modifytime,jdbcType=VARCHAR},
|
|
|
+ #{modifytime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.tuoren.forward.entity.UserConfig">
|
|
|
update user_config
|
|
|
<set>
|
|
|
- <if test="userId != null">
|
|
|
- user_id = #{userId,jdbcType=VARCHAR},
|
|
|
+ <if test="wifi != null">
|
|
|
+ wifi = #{wifi,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="wifiName != null">
|
|
|
- wifi_name = #{wifiName,jdbcType=VARCHAR},
|
|
|
+ <if test="localAddress != null">
|
|
|
+ local_address = #{localAddress,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="wifiPassword != null">
|
|
|
- wifi_password = #{wifiPassword,jdbcType=VARCHAR},
|
|
|
+ <if test="localPort != null">
|
|
|
+ local_port = #{localPort,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
<if test="createtime != null">
|
|
|
createtime = #{createtime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
<if test="modifytime != null">
|
|
|
- modifytime = #{modifytime,jdbcType=VARCHAR},
|
|
|
+ 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 user_id = #{userId,jdbcType=VARCHAR},
|
|
|
- wifi_name = #{wifiName,jdbcType=VARCHAR},
|
|
|
- wifi_password = #{wifiPassword,jdbcType=VARCHAR},
|
|
|
+ set wifi = #{wifi,jdbcType=VARCHAR},
|
|
|
+ local_address = #{localAddress,jdbcType=VARCHAR},
|
|
|
+ local_port = #{localPort,jdbcType=INTEGER},
|
|
|
createtime = #{createtime,jdbcType=TIMESTAMP},
|
|
|
- modifytime = #{modifytime,jdbcType=VARCHAR}
|
|
|
+ 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} or local_address = #{localAddress,jdbcType=VARCHAR} or local_port = #{localPort,jdbcType=INTEGER}, limit 1
|
|
|
+ </select>
|
|
|
</mapper>
|