Commit 239e3693 by naan1993

更新user表名

parent 18d4fa1c
package com.stylefeng.guns.common.persistence.dao;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.stylefeng.guns.common.persistence.model.Test;
/**
* <p>
* Mapper 接口
* </p>
*
* @author stylefeng
* @since 2017-12-09
*/
public interface TestMapper extends BaseMapper<Test> {
}
\ No newline at end of file
<?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.stylefeng.guns.common.persistence.dao.TestMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.stylefeng.guns.common.persistence.model.Test">
<id column="id" property="id" />
<result column="value" property="value" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, value
</sql>
</mapper>
package com.stylefeng.guns.common.persistence.model;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author stylefeng
* @since 2017-12-09
*/
@TableName("test")
public class Test extends Model<Test> {
private static final long serialVersionUID = 1L;
private Integer id;
private String value;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
protected Serializable pkVal() {
return this.id;
}
@Override
public String toString() {
return "Test{" +
"id=" + id +
", value=" + value +
"}";
}
}
......@@ -2,6 +2,7 @@ package com.stylefeng.guns.common.persistence.model;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import java.io.Serializable;
......@@ -15,6 +16,7 @@ import java.util.Date;
* @author stylefeng
* @since 2017-07-11
*/
@TableName("sys_user")
public class User extends Model<User> {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@
<select id="selectUsers" resultType="map">
select
<include refid="Base_Column_List" />
from user
from sys_user
where status != 3
<if test="name != null and name != ''">
and (phone like CONCAT('%',#{name},'%')
......@@ -35,24 +35,24 @@
</select>
<update id="setStatus">
update user set status = #{status} where id =
update sys_user set status = #{status} where id =
#{userId}
</update>
<update id="changePwd">
update user set password = #{pwd} where id =
update sys_user set password = #{pwd} where id =
#{userId}
</update>
<update id="setRoles">
update user set roleid = #{roleIds} where id =
update sys_user set roleid = #{roleIds} where id =
#{userId}
</update>
<select id="getByAccount" resultType="user">
select
<include refid="Base_Column_List_With_Pwd" />
from user where account = #{account} and status != 3
from sys_user where account = #{account} and status != 3
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment