<?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.biz.mapper.ArUserMapper">

    <resultMap type="com.ruoyi.biz.domain.ArUser" id="ArUserResult">
        <result property="id" column="id"/>
        <result property="name" column="name"/>
        <result property="image" column="image"/>
        <result property="openId" column="openId"/>
        <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="delFlag" column="del_flag"/>
    </resultMap>
    <select id="findUser" parameterType="String" resultType="map">
        select id as userId,name,phone,image,open_id as openid from ar_user where open_id=#{openId}
    </select>
    <update id="updateUser" parameterType="map">
        update ar_user set name=#{name},image=#{image} where id=#{userId}
    </update>
    <insert id="addUser" parameterType="map">
        insert into ar_user (name,image,phone,open_id,create_by,create_time,del_flag) values (#{name},#{image},#{phone},#{openId},1,now(),0)
    </insert>
</mapper>
