|
@@ -0,0 +1,172 @@
|
|
|
+<?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="beilv.system.mapper.SysMemberMapper">
|
|
|
+
|
|
|
+ <resultMap type="SysMember" id="SysMemberResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="username" column="username" />
|
|
|
+ <result property="password" column="password" />
|
|
|
+ <result property="realName" column="real_name" />
|
|
|
+ <result property="sex" column="sex" />
|
|
|
+ <result property="birthday" column="birthday" />
|
|
|
+ <result property="cardId" column="card_id" />
|
|
|
+ <result property="avatar" column="avatar" />
|
|
|
+ <result property="mobile" column="mobile" />
|
|
|
+ <result property="loginDate" column="login_date" />
|
|
|
+ <result property="loginIp" column="login_ip" />
|
|
|
+ <result property="registerIp" column="register_ip" />
|
|
|
+ <result property="addIp" column="add_ip" />
|
|
|
+ <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="lastIp" column="last_ip" />
|
|
|
+ <result property="integral" column="integral" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="userType" column="user_type" />
|
|
|
+ <result property="loginType" column="login_type" />
|
|
|
+ <result property="wxProfile" column="wx_profile" />
|
|
|
+ <result property="delFlag" column="del_flag" />
|
|
|
+ <result property="openId" column="open_id" />
|
|
|
+ <result property="routineOpenId" column="routine_open_id" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectSysMemberVo">
|
|
|
+ select id, username, password, real_name, sex, birthday, card_id, avatar, mobile, login_date, login_ip, register_ip, add_ip, create_by, create_time, update_by, update_time, last_ip, integral, status, user_type, login_type, wx_profile, del_flag, open_id, routine_open_id from sys_member
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectSysMemberList" parameterType="SysMember" resultMap="SysMemberResult">
|
|
|
+ <include refid="selectSysMemberVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
|
|
+ <if test="password != null and password != ''"> and password = #{password}</if>
|
|
|
+ <if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
|
|
|
+ <if test="sex != null "> and sex = #{sex}</if>
|
|
|
+ <if test="birthday != null "> and birthday = #{birthday}</if>
|
|
|
+ <if test="cardId != null and cardId != ''"> and card_id = #{cardId}</if>
|
|
|
+ <if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if>
|
|
|
+ <if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
|
|
|
+ <if test="loginDate != null "> and login_date = #{loginDate}</if>
|
|
|
+ <if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
|
|
+ <if test="registerIp != null and registerIp != ''"> and register_ip = #{registerIp}</if>
|
|
|
+ <if test="addIp != null and addIp != ''"> and add_ip = #{addIp}</if>
|
|
|
+ <if test="lastIp != null and lastIp != ''"> and last_ip = #{lastIp}</if>
|
|
|
+ <if test="integral != null "> and integral = #{integral}</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
+ <if test="userType != null and userType != ''"> and user_type = #{userType}</if>
|
|
|
+ <if test="loginType != null and loginType != ''"> and login_type = #{loginType}</if>
|
|
|
+ <if test="wxProfile != null and wxProfile != ''"> and wx_profile = #{wxProfile}</if>
|
|
|
+ <if test="openId != null and openId != ''"> and open_id = #{openId}</if>
|
|
|
+ <if test="routineOpenId != null and routineOpenId != ''"> and routine_open_id = #{routineOpenId}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectSysMemberById" parameterType="Long" resultMap="SysMemberResult">
|
|
|
+ <include refid="selectSysMemberVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertSysMember" parameterType="SysMember" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into sys_member
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="username != null">username,</if>
|
|
|
+ <if test="password != null">password,</if>
|
|
|
+ <if test="realName != null">real_name,</if>
|
|
|
+ <if test="sex != null">sex,</if>
|
|
|
+ <if test="birthday != null">birthday,</if>
|
|
|
+ <if test="cardId != null">card_id,</if>
|
|
|
+ <if test="avatar != null">avatar,</if>
|
|
|
+ <if test="mobile != null">mobile,</if>
|
|
|
+ <if test="loginDate != null">login_date,</if>
|
|
|
+ <if test="loginIp != null">login_ip,</if>
|
|
|
+ <if test="registerIp != null">register_ip,</if>
|
|
|
+ <if test="addIp != null">add_ip,</if>
|
|
|
+ <if test="createBy != null">create_by,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateBy != null">update_by,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="lastIp != null">last_ip,</if>
|
|
|
+ <if test="integral != null">integral,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="userType != null and userType != ''">user_type,</if>
|
|
|
+ <if test="loginType != null and loginType != ''">login_type,</if>
|
|
|
+ <if test="wxProfile != null">wx_profile,</if>
|
|
|
+ <if test="delFlag != null">del_flag,</if>
|
|
|
+ <if test="openId != null">open_id,</if>
|
|
|
+ <if test="routineOpenId != null">routine_open_id,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="username != null">#{username},</if>
|
|
|
+ <if test="password != null">#{password},</if>
|
|
|
+ <if test="realName != null">#{realName},</if>
|
|
|
+ <if test="sex != null">#{sex},</if>
|
|
|
+ <if test="birthday != null">#{birthday},</if>
|
|
|
+ <if test="cardId != null">#{cardId},</if>
|
|
|
+ <if test="avatar != null">#{avatar},</if>
|
|
|
+ <if test="mobile != null">#{mobile},</if>
|
|
|
+ <if test="loginDate != null">#{loginDate},</if>
|
|
|
+ <if test="loginIp != null">#{loginIp},</if>
|
|
|
+ <if test="registerIp != null">#{registerIp},</if>
|
|
|
+ <if test="addIp != null">#{addIp},</if>
|
|
|
+ <if test="createBy != null">#{createBy},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateBy != null">#{updateBy},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="lastIp != null">#{lastIp},</if>
|
|
|
+ <if test="integral != null">#{integral},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="userType != null and userType != ''">#{userType},</if>
|
|
|
+ <if test="loginType != null and loginType != ''">#{loginType},</if>
|
|
|
+ <if test="wxProfile != null">#{wxProfile},</if>
|
|
|
+ <if test="delFlag != null">#{delFlag},</if>
|
|
|
+ <if test="openId != null">#{openId},</if>
|
|
|
+ <if test="routineOpenId != null">#{routineOpenId},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateSysMember" parameterType="SysMember">
|
|
|
+ update sys_member
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="username != null">username = #{username},</if>
|
|
|
+ <if test="password != null">password = #{password},</if>
|
|
|
+ <if test="realName != null">real_name = #{realName},</if>
|
|
|
+ <if test="sex != null">sex = #{sex},</if>
|
|
|
+ <if test="birthday != null">birthday = #{birthday},</if>
|
|
|
+ <if test="cardId != null">card_id = #{cardId},</if>
|
|
|
+ <if test="avatar != null">avatar = #{avatar},</if>
|
|
|
+ <if test="mobile != null">mobile = #{mobile},</if>
|
|
|
+ <if test="loginDate != null">login_date = #{loginDate},</if>
|
|
|
+ <if test="loginIp != null">login_ip = #{loginIp},</if>
|
|
|
+ <if test="registerIp != null">register_ip = #{registerIp},</if>
|
|
|
+ <if test="addIp != null">add_ip = #{addIp},</if>
|
|
|
+ <if test="createBy != null">create_by = #{createBy},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="lastIp != null">last_ip = #{lastIp},</if>
|
|
|
+ <if test="integral != null">integral = #{integral},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="userType != null and userType != ''">user_type = #{userType},</if>
|
|
|
+ <if test="loginType != null and loginType != ''">login_type = #{loginType},</if>
|
|
|
+ <if test="wxProfile != null">wx_profile = #{wxProfile},</if>
|
|
|
+ <if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
|
+ <if test="openId != null">open_id = #{openId},</if>
|
|
|
+ <if test="routineOpenId != null">routine_open_id = #{routineOpenId},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteSysMemberById" parameterType="Long">
|
|
|
+ delete from sys_member where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteSysMemberByIds" parameterType="String">
|
|
|
+ delete from sys_member where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+
|
|
|
+</mapper>
|