You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.2 KiB

package top.beansprout.health.mapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import top.beansprout.health.model.entity.TUser;
/**
* <p> Title: TUserMapper </p>
* <p> Description: 用户数据操作</p>
*
* @Auther: cyy
* @Date: 2020年4月23日 下午9:24:05
* @Version: 1.0.0
*/
public interface TUserMapper {
@Select("SELECT * FROM t_user WHERE user_name = #{userName}")
TUser selectByUserName(@Param("userName") String userName);
@Select("SELECT * FROM t_user WHERE id = #{userId}")
TUser selectById(@Param("userId") int id);
@Insert("INSERT INTO t_user (creator, create_time, updater, update_time, nick_name, user_name, password, head_url) "
+ "VALUE (0, NOW(), 0, NOW(), #{userName}, #{userName}, #{password}, #{headUrl})")
int insertByOne(TUser tUser);
@Update("UPDATE t_user SET updater = #{id}, update_time = NOW(), password = #{password} WHERE id = #{id}")
int updateByOne(TUser tUser);
@Update("UPDATE t_user SET updater = #{id}, update_time = NOW(), nick_name = #{nickName}, email = #{email}, head_url = #{headUrl} WHERE id = #{id}")
int updateByUserInfoOne(TUser tUser);
}