<?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.njcn.mapper.user.UserMapper">

    <update id="updateLockState">
        update pqs_user set state = #{state},login_error_times = 0 where user_index = #{userIndex}
    </update>

    <update id="updateByPrimaryKeyBySql" parameterType="user">
        update pqs_user
        <set>
            <if test="userIndex != null">user_Index=#{userIndex},</if>
            <if test="name != null">name=#{name},</if>
            <if test="loginName != null">loginName=#{loginName},</if>
            <if test="password != null">password=#{password},</if>
            <if test="phone != null">phone=#{phone},</if>
            <if test="email != null">email=#{email},</if>
            <if test="registerTime != null">registerTime=#{registerTime},</if>
            <if test="psdvalidity != null">psdvalidity=#{psdvalidity},</if>
            <if test="loginTime != null">loginTime=#{loginTime},</if>
            <if test="state != null">state=#{state},</if>
            <if test="mark != null">mark=#{mark},</if>
            <if test="limitIpStart != null">limit_IpStart=#{limitIpStart},</if>
            <if test="limitIpEnd != null">limit_IpEnd=#{limitIpEnd},</if>
            <if test="limitTime != null">limit_Time=#{limitTime},</if>
            <if test="loginErrorTimes != null">LOGIN_ERROR_TIMES=#{loginErrorTimes},</if>
            <if test="casualUser != null">casual_User=#{casualUser},</if>
            <if test="firstErrorTime != null">firstError_Time=#{firstErrorTime},</if>
            <if test="lockTime != null">lock_Time=#{lockTime}</if>
        </set>
        where user_Index=#{userIndex}

    </update>

</mapper>