|
@@ -0,0 +1,208 @@
|
|
|
+<?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.ruoyi.system.mapper.LzydUserMapper">
|
|
|
+
|
|
|
+ <resultMap type="LzydUser" id="LzydUserResult">
|
|
|
+ <result property="id" column="id" />
|
|
|
+ <result property="userId" column="user_id" />
|
|
|
+ <result property="role" column="role" />
|
|
|
+ <result property="username" column="username" />
|
|
|
+ <result property="address" column="address" />
|
|
|
+ <result property="area" column="area" />
|
|
|
+ <result property="password" column="password" />
|
|
|
+ <result property="mobilePhone" column="mobile_phone" />
|
|
|
+ <result property="userAvatar" column="user_avatar" />
|
|
|
+ <result property="qrCode" column="qr_code" />
|
|
|
+ <result property="userGrade" column="user_grade" />
|
|
|
+ <result property="realName" column="real_name" />
|
|
|
+ <result property="loginTime" column="login_time" />
|
|
|
+ <result property="registerTime" column="register_time" />
|
|
|
+ <result property="likeNum" column="like_num" />
|
|
|
+ <result property="fansNum" column="fans_num" />
|
|
|
+ <result property="attenNum" column="atten_num" />
|
|
|
+ <result property="totalDistance" column="total_distance" />
|
|
|
+ <result property="timesMarathon" column="times_marathon" />
|
|
|
+ <result property="timesQualifier" column="times_qualifier" />
|
|
|
+ <result property="createTime" column="create_time" />
|
|
|
+ <result property="updateTime" column="update_time" />
|
|
|
+ <result property="isDelete" column="is_delete" />
|
|
|
+ <result property="status" column="status" />
|
|
|
+ <result property="weight" column="weight" />
|
|
|
+ <result property="height" column="height" />
|
|
|
+ <result property="userPoint" column="user_point" />
|
|
|
+ <result property="userMoney" column="user_money" />
|
|
|
+ <result property="loginType" column="login_type" />
|
|
|
+ <result property="gender" column="gender" />
|
|
|
+ <result property="birthday" column="birthday" />
|
|
|
+ <result property="appId" column="app_id" />
|
|
|
+ <result property="qualifyingPoints" column="qualifying_points" />
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <sql id="selectLzydUserVo">
|
|
|
+ select id, user_id, role, username, address, area, password, mobile_phone, user_avatar, qr_code, user_grade, real_name, login_time, register_time, like_num, fans_num, atten_num, total_distance, times_marathon, times_qualifier, create_time, update_time, is_delete, status, weight, height, user_point, user_money, login_type, gender, birthday, app_id, qualifying_points from lzyd_user
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="selectLzydUserList" parameterType="LzydUser" resultMap="LzydUserResult">
|
|
|
+ <include refid="selectLzydUserVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="userId != null and userId != ''"> and user_id = #{userId}</if>
|
|
|
+ <if test="role != null "> and role = #{role}</if>
|
|
|
+ <if test="username != null and username != ''"> and username like concat('%', #{username}, '%')</if>
|
|
|
+ <if test="address != null and address != ''"> and address = #{address}</if>
|
|
|
+ <if test="area != null and area != ''"> and area = #{area}</if>
|
|
|
+ <if test="password != null and password != ''"> and password = #{password}</if>
|
|
|
+ <if test="mobilePhone != null and mobilePhone != ''"> and mobile_phone = #{mobilePhone}</if>
|
|
|
+ <if test="userAvatar != null and userAvatar != ''"> and user_avatar = #{userAvatar}</if>
|
|
|
+ <if test="qrCode != null and qrCode != ''"> and qr_code = #{qrCode}</if>
|
|
|
+ <if test="userGrade != null and userGrade != ''"> and user_grade = #{userGrade}</if>
|
|
|
+ <if test="realName != null and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
|
|
|
+ <if test="loginTime != null "> and login_time = #{loginTime}</if>
|
|
|
+ <if test="registerTime != null "> and register_time = #{registerTime}</if>
|
|
|
+ <if test="likeNum != null "> and like_num = #{likeNum}</if>
|
|
|
+ <if test="fansNum != null "> and fans_num = #{fansNum}</if>
|
|
|
+ <if test="attenNum != null "> and atten_num = #{attenNum}</if>
|
|
|
+ <if test="totalDistance != null "> and total_distance = #{totalDistance}</if>
|
|
|
+ <if test="timesMarathon != null "> and times_marathon = #{timesMarathon}</if>
|
|
|
+ <if test="timesQualifier != null "> and times_qualifier = #{timesQualifier}</if>
|
|
|
+ <if test="isDelete != null "> and is_delete = #{isDelete}</if>
|
|
|
+ <if test="status != null "> and status = #{status}</if>
|
|
|
+ <if test="weight != null "> and weight = #{weight}</if>
|
|
|
+ <if test="height != null "> and height = #{height}</if>
|
|
|
+ <if test="userPoint != null "> and user_point = #{userPoint}</if>
|
|
|
+ <if test="userMoney != null "> and user_money = #{userMoney}</if>
|
|
|
+ <if test="gender != null "> and gender = #{gender}</if>
|
|
|
+ <if test="birthday != null and birthday != ''"> and birthday = #{birthday}</if>
|
|
|
+ <if test="appId != null and appId != ''"> and app_id = #{appId}</if>
|
|
|
+ <if test="qualifyingPoints != null "> and qualifying_points = #{qualifyingPoints}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectLzydUserById" parameterType="Long" resultMap="LzydUserResult">
|
|
|
+ <include refid="selectLzydUserVo"/>
|
|
|
+ where id = #{id}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <insert id="insertLzydUser" parameterType="LzydUser" useGeneratedKeys="true" keyProperty="id">
|
|
|
+ insert into lzyd_user
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null and userId != ''">user_id,</if>
|
|
|
+ <if test="role != null">role,</if>
|
|
|
+ <if test="username != null and username != ''">username,</if>
|
|
|
+ <if test="address != null and address != ''">address,</if>
|
|
|
+ <if test="area != null and area != ''">area,</if>
|
|
|
+ <if test="password != null and password != ''">password,</if>
|
|
|
+ <if test="mobilePhone != null and mobilePhone != ''">mobile_phone,</if>
|
|
|
+ <if test="userAvatar != null and userAvatar != ''">user_avatar,</if>
|
|
|
+ <if test="qrCode != null and qrCode != ''">qr_code,</if>
|
|
|
+ <if test="userGrade != null and userGrade != ''">user_grade,</if>
|
|
|
+ <if test="realName != null and realName != ''">real_name,</if>
|
|
|
+ <if test="loginTime != null">login_time,</if>
|
|
|
+ <if test="registerTime != null">register_time,</if>
|
|
|
+ <if test="likeNum != null">like_num,</if>
|
|
|
+ <if test="fansNum != null">fans_num,</if>
|
|
|
+ <if test="attenNum != null">atten_num,</if>
|
|
|
+ <if test="totalDistance != null">total_distance,</if>
|
|
|
+ <if test="timesMarathon != null">times_marathon,</if>
|
|
|
+ <if test="timesQualifier != null">times_qualifier,</if>
|
|
|
+ <if test="createTime != null">create_time,</if>
|
|
|
+ <if test="updateTime != null">update_time,</if>
|
|
|
+ <if test="isDelete != null">is_delete,</if>
|
|
|
+ <if test="status != null">status,</if>
|
|
|
+ <if test="weight != null">weight,</if>
|
|
|
+ <if test="height != null">height,</if>
|
|
|
+ <if test="userPoint != null">user_point,</if>
|
|
|
+ <if test="userMoney != null">user_money,</if>
|
|
|
+ <if test="loginType != null">login_type,</if>
|
|
|
+ <if test="gender != null">gender,</if>
|
|
|
+ <if test="birthday != null and birthday != ''">birthday,</if>
|
|
|
+ <if test="appId != null and appId != ''">app_id,</if>
|
|
|
+ <if test="qualifyingPoints != null">qualifying_points,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="userId != null and userId != ''">#{userId},</if>
|
|
|
+ <if test="role != null">#{role},</if>
|
|
|
+ <if test="username != null and username != ''">#{username},</if>
|
|
|
+ <if test="address != null and address != ''">#{address},</if>
|
|
|
+ <if test="area != null and area != ''">#{area},</if>
|
|
|
+ <if test="password != null and password != ''">#{password},</if>
|
|
|
+ <if test="mobilePhone != null and mobilePhone != ''">#{mobilePhone},</if>
|
|
|
+ <if test="userAvatar != null and userAvatar != ''">#{userAvatar},</if>
|
|
|
+ <if test="qrCode != null and qrCode != ''">#{qrCode},</if>
|
|
|
+ <if test="userGrade != null and userGrade != ''">#{userGrade},</if>
|
|
|
+ <if test="realName != null and realName != ''">#{realName},</if>
|
|
|
+ <if test="loginTime != null">#{loginTime},</if>
|
|
|
+ <if test="registerTime != null">#{registerTime},</if>
|
|
|
+ <if test="likeNum != null">#{likeNum},</if>
|
|
|
+ <if test="fansNum != null">#{fansNum},</if>
|
|
|
+ <if test="attenNum != null">#{attenNum},</if>
|
|
|
+ <if test="totalDistance != null">#{totalDistance},</if>
|
|
|
+ <if test="timesMarathon != null">#{timesMarathon},</if>
|
|
|
+ <if test="timesQualifier != null">#{timesQualifier},</if>
|
|
|
+ <if test="createTime != null">#{createTime},</if>
|
|
|
+ <if test="updateTime != null">#{updateTime},</if>
|
|
|
+ <if test="isDelete != null">#{isDelete},</if>
|
|
|
+ <if test="status != null">#{status},</if>
|
|
|
+ <if test="weight != null">#{weight},</if>
|
|
|
+ <if test="height != null">#{height},</if>
|
|
|
+ <if test="userPoint != null">#{userPoint},</if>
|
|
|
+ <if test="userMoney != null">#{userMoney},</if>
|
|
|
+ <if test="loginType != null">#{loginType},</if>
|
|
|
+ <if test="gender != null">#{gender},</if>
|
|
|
+ <if test="birthday != null and birthday != ''">#{birthday},</if>
|
|
|
+ <if test="appId != null and appId != ''">#{appId},</if>
|
|
|
+ <if test="qualifyingPoints != null">#{qualifyingPoints},</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateLzydUser" parameterType="LzydUser">
|
|
|
+ update lzyd_user
|
|
|
+ <trim prefix="SET" suffixOverrides=",">
|
|
|
+ <if test="userId != null and userId != ''">user_id = #{userId},</if>
|
|
|
+ <if test="role != null">role = #{role},</if>
|
|
|
+ <if test="username != null and username != ''">username = #{username},</if>
|
|
|
+ <if test="address != null and address != ''">address = #{address},</if>
|
|
|
+ <if test="area != null and area != ''">area = #{area},</if>
|
|
|
+ <if test="password != null and password != ''">password = #{password},</if>
|
|
|
+ <if test="mobilePhone != null and mobilePhone != ''">mobile_phone = #{mobilePhone},</if>
|
|
|
+ <if test="userAvatar != null and userAvatar != ''">user_avatar = #{userAvatar},</if>
|
|
|
+ <if test="qrCode != null and qrCode != ''">qr_code = #{qrCode},</if>
|
|
|
+ <if test="userGrade != null and userGrade != ''">user_grade = #{userGrade},</if>
|
|
|
+ <if test="realName != null and realName != ''">real_name = #{realName},</if>
|
|
|
+ <if test="loginTime != null">login_time = #{loginTime},</if>
|
|
|
+ <if test="registerTime != null">register_time = #{registerTime},</if>
|
|
|
+ <if test="likeNum != null">like_num = #{likeNum},</if>
|
|
|
+ <if test="fansNum != null">fans_num = #{fansNum},</if>
|
|
|
+ <if test="attenNum != null">atten_num = #{attenNum},</if>
|
|
|
+ <if test="totalDistance != null">total_distance = #{totalDistance},</if>
|
|
|
+ <if test="timesMarathon != null">times_marathon = #{timesMarathon},</if>
|
|
|
+ <if test="timesQualifier != null">times_qualifier = #{timesQualifier},</if>
|
|
|
+ <if test="createTime != null">create_time = #{createTime},</if>
|
|
|
+ <if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
+ <if test="isDelete != null">is_delete = #{isDelete},</if>
|
|
|
+ <if test="status != null">status = #{status},</if>
|
|
|
+ <if test="weight != null">weight = #{weight},</if>
|
|
|
+ <if test="height != null">height = #{height},</if>
|
|
|
+ <if test="userPoint != null">user_point = #{userPoint},</if>
|
|
|
+ <if test="userMoney != null">user_money = #{userMoney},</if>
|
|
|
+ <if test="loginType != null">login_type = #{loginType},</if>
|
|
|
+ <if test="gender != null">gender = #{gender},</if>
|
|
|
+ <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
|
|
|
+ <if test="appId != null and appId != ''">app_id = #{appId},</if>
|
|
|
+ <if test="qualifyingPoints != null">qualifying_points = #{qualifyingPoints},</if>
|
|
|
+ </trim>
|
|
|
+ where id = #{id}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteLzydUserById" parameterType="Long">
|
|
|
+ delete from lzyd_user where id = #{id}
|
|
|
+ </delete>
|
|
|
+
|
|
|
+ <delete id="deleteLzydUserByIds" parameterType="String">
|
|
|
+ delete from lzyd_user where id in
|
|
|
+ <foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </delete>
|
|
|
+</mapper>
|