123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <?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.travel.mapper.LoginMapper">
- <!-- 根据用户手机号查询 -->
- <select id="getUser" resultType="User">
- select * from sys_users where phone = #{phone}
- </select>
- <!-- 新增用户 -->
- <insert id="insetUser" parameterType="User">
- INSERT INTO sys_users (code,name,sex,age,pass,phone,jdrq,headpir,remake,wxid,wxtoken,flag,captcha)
- VALUES(#{code},#{name},#{sex},#{age},#{pass},#{phone},GETDATE(),#{headpir},#{remake},#{wxid},#{wxtoken},0,#{captcha})
- </insert>
- <!-- 校验手机号是否已注册 -->
- <select id="checkTele" resultType="int">
- select count(*) as count from sys_users where phone=#{phone}
- </select>
- <!-- 根据手机号删除用户 -->
- <delete id="delUser">
- delete from sys_users where phone=#{phone}
- </delete>
- <!-- 修改验证码 -->
- <update id="updateCaptcha">
- update sys_users set captcha=#{captcha} where phone=#{phone}
- </update>
- <!-- 根据code修改验证码 -->
- <update id="updateCaptchaCode">
- update sys_users set captcha=#{captcha} where code=#{code}
- </update>
- <!-- 校验验证码 -->
- <select id="checkCaptcha" resultType="int">
- select count(*) from sys_users where phone=#{phone} and captcha=#{captcha}
- </select>
- <!-- 校验验证码 -->
- <select id="checkCaptchaCode" resultType="int">
- select count(*) from sys_users where code=#{code} and captcha=#{captcha}
- </select>
- <!-- 手机号登录验证是否第一次登录 -->
- <select id="checkUser" resultType="User">
- select * from sys_users where phone=#{phone} and captcha=#{captcha}
- </select>
- <!-- 修改信息 -->
- <update id="updateUser" parameterType="User">
- update sys_users
- <set>
- <trim suffixOverrides=",">
- <if test="name != null and name != ''">
- name=#{name},
- </if>
- <if test="sex != null and sex != ''">
- sex=#{sex},
- </if>
- <if test="age != null and age != ''">
- age=#{age},
- </if>
- <if test="pass != null and pass != ''">
- pass=#{pass},
- </if>
- <if test="headpir != null and headpir != ''">
- headpir=#{headpir},
- </if>
- <if test="remake != null and remake != ''">
- remake=#{remake},
- </if>
- <if test="city != null and city != ''">
- city=#{city},
- </if>
- <if test="email != null and email != ''">
- email=#{email},
- </if>
- <if test="birthday != null and birthday != ''">
- birthday=#{birthday},
- </if>
- </trim>
- </set>
- where code = #{code}
- </update>
- <!-- 查询个人用户编号 -->
- <select id="getCode" resultType="User">
- select code from sys_users where phone=#{phone} and captcha=#{captcha}
- </select>
- <!-- 查询最大的id作为编号拼接 -->
- <select id="getMaxId" resultType="int">
- select id from sys_users where phone=#{phone}
- </select>
- <!-- 删除用户-->
- <delete id="deleteUser" parameterType="String">
- delete from sys_users where phone=#{phone}
- </delete>
- <!-- 查询无效用户 -->
- <select id="getInvalidUser" resultType="User">
- select id,phone from sys_users where jdrq < GETDATE() and headpir is null
- </select>
- <!-- 添加一键登录用户 -->
- <update id="updateKeyToLog" parameterType="User">
- update sys_users set code=#{code},name=#{name},headpir=#{headpir} where id=#{id}
- </update>
- <!-- 查询用户信息 -->
- <select id="getUserPassLogin" parameterType="User" resultType="User">
- select * from sys_users where code=#{code} and pass =#{pass}
- </select>
- <!-- 查询密码是否正确 -->
- <select id="getUserPassLoginCount" parameterType="User" resultType="int">
- select count(*) from sys_users where code=#{code} and pass =#{pass}
- </select>
- <!-- 修改个人信息后回调 -->
- <select id="getUserVal" resultType="User">
- select * from sys_users where code=#{code}
- </select>
- <!-- 修改手机号提交 -->
- <update id="updatePhoneForm" parameterType="User">
- update sys_users set phone=#{phone} where code = #{code}
- </update>
- </mapper>
|