|
@@ -0,0 +1,122 @@
|
|
|
+<?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.miaxis.app.user.mapper.UserInfoMapper">
|
|
|
+
|
|
|
+ <resultMap type="UserInfo" id="UserInfoResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="name" column="name" />
|
|
|
+ <result property="sex" column="sex" />
|
|
|
+ <result property="sfzmlx" column="sfzmlx" />
|
|
|
+ <result property="sfzmhm" column="sfzmhm" />
|
|
|
+ <result property="crdate" column="crdate" />
|
|
|
+ <result property="birthday" column="birthday" />
|
|
|
+ <result property="mobile" column="mobile" />
|
|
|
+ <result property="password" column="password" />
|
|
|
+ <result property="wechar" column="wechar" />
|
|
|
+ <result property="openid" column="openid" />
|
|
|
+ <result property="inscode" column="inscode" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="pxcx" column="pxcx" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectUserInfoVo">
|
|
|
+ select id, name, sex, sfzmlx, sfzmhm, crdate, birthday, mobile, password, wechar, openid, inscode, create_time, update_time, pxcx from user_info
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectUserInfoList" parameterType="UserInfo" resultMap="UserInfoResult">
|
|
|
+ <include refid="selectUserInfoVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="sex != null "> and sex = #{sex}</if>
|
|
|
+ <if test="sfzmlx != null "> and sfzmlx = #{sfzmlx}</if>
|
|
|
+ <if test="sfzmhm != null and sfzmhm != ''"> and sfzmhm = #{sfzmhm}</if>
|
|
|
+ <if test="crdate != null "> and crdate = #{crdate}</if>
|
|
|
+ <if test="birthday != null "> and birthday = #{birthday}</if>
|
|
|
+ <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
|
|
|
+ <if test="password != null and password != ''"> and password = #{password}</if>
|
|
|
+ <if test="wechar != null and wechar != ''"> and wechar = #{wechar}</if>
|
|
|
+ <if test="openid != null and openid != ''"> and openid = #{openid}</if>
|
|
|
+ <if test="inscode != null and inscode != ''"> and inscode = #{inscode}</if>
|
|
|
+ <if test="pxcx != null and pxcx != ''"> and pxcx = #{pxcx}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectUserInfoById" parameterType="Long" resultMap="UserInfoResult">
|
|
|
+ <include refid="selectUserInfoVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertUserInfo" parameterType="UserInfo">
|
|
|
+ insert into user_info
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">id,</if>
|
|
|
+ <if test="name != null">name,</if>
|
|
|
+ <if test="sex != null">sex,</if>
|
|
|
+ <if test="sfzmlx != null">sfzmlx,</if>
|
|
|
+ <if test="sfzmhm != null">sfzmhm,</if>
|
|
|
+ <if test="crdate != null">crdate,</if>
|
|
|
+ <if test="birthday != null">birthday,</if>
|
|
|
+ <if test="mobile != null">mobile,</if>
|
|
|
+ <if test="password != null">password,</if>
|
|
|
+ <if test="wechar != null">wechar,</if>
|
|
|
+ <if test="openid != null">openid,</if>
|
|
|
+ <if test="inscode != null">inscode,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="pxcx != null">pxcx,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="id != null">#{id},</if>
|
|
|
+ <if test="name != null">#{name},</if>
|
|
|
+ <if test="sex != null">#{sex},</if>
|
|
|
+ <if test="sfzmlx != null">#{sfzmlx},</if>
|
|
|
+ <if test="sfzmhm != null">#{sfzmhm},</if>
|
|
|
+ <if test="crdate != null">#{crdate},</if>
|
|
|
+ <if test="birthday != null">#{birthday},</if>
|
|
|
+ <if test="mobile != null">#{mobile},</if>
|
|
|
+ <if test="password != null">#{password},</if>
|
|
|
+ <if test="wechar != null">#{wechar},</if>
|
|
|
+ <if test="openid != null">#{openid},</if>
|
|
|
+ <if test="inscode != null">#{inscode},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="pxcx != null">#{pxcx},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateUserInfo" parameterType="UserInfo">
|
|
|
+ update user_info
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="name != null">name = #{name},</if>
|
|
|
+ <if test="sex != null">sex = #{sex},</if>
|
|
|
+ <if test="sfzmlx != null">sfzmlx = #{sfzmlx},</if>
|
|
|
+ <if test="sfzmhm != null">sfzmhm = #{sfzmhm},</if>
|
|
|
+ <if test="crdate != null">crdate = #{crdate},</if>
|
|
|
+ <if test="birthday != null">birthday = #{birthday},</if>
|
|
|
+ <if test="mobile != null">mobile = #{mobile},</if>
|
|
|
+ <if test="password != null">password = #{password},</if>
|
|
|
+ <if test="wechar != null">wechar = #{wechar},</if>
|
|
|
+ <if test="openid != null">openid = #{openid},</if>
|
|
|
+ <if test="inscode != null">inscode = #{inscode},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="pxcx != null">pxcx = #{pxcx},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteUserInfoById" parameterType="Long">
|
|
|
+ delete from user_info where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteUserInfoByIds" parameterType="String">
|
|
|
+ delete from user_info where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|