<?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.supplier.mapper.PersonalMapper">
    <!-- 查询个人信息 -->
    <select id="getPresonalMessage" parameterType="String" resultType="Supplier">
        select * from sys_supplier where code = #{code}
    </select>
    <!-- 修改手机号 -->
    <update id="updatePhone" parameterType="Supplier">
        update sys_supplier
        <set>
            <trim suffixOverrides=",">
                <if test="phone != null and phone != ''">
                    phone = #{phone}
                </if>
                <if test="name != null and name != ''">
                    name = #{name}
                </if>
            </trim>
        </set>
        where code = #{code}
    </update>
    <!-- 手机号登录验证是否第一次登录 -->
    <select id="checkUser" resultType="Supplier">
        select id,code,nature_supplier as natureSupplier,contact,phone,language,certificate_type as certificateType,certificate,headpir,jdrq,flag,captcha,invoice,name
        from sys_supplier
        where phone=#{phone} and captcha=#{captcha}
    </select>
</mapper>