package com.fzm.mall.server.front.user.mapper;

import com.fzm.mall.server.front.user.model.*;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 用户信息表 Mapper 接口
 * </p>
 *
 * @author fzm
 * @since 2021-01-27
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from dict_cn_province")
    List<Province> getProvinceList();

    @Select("select * from dict_cn_city where province_code = #{code}")
    List<City> getCityList(@Param("code") Long code);

    @Select("select * from dict_cn_county where city_code = #{code}")
    List<County> getCounty(@Param("code") Long code);

    @Select("select * from dict_cn_street where county_code = #{code}")
    List<Street> getStreet(@Param("code")Long code);

    @Update("update user set pay_password = #{payPassword} where uid = #{uid}")
    void setPayPassword(@Param("uid") String uid, @Param("payPassword") String sha256String);
}
