43 lines
2.1 KiB
XML
Raw Normal View History

2025-06-11 17:46:57 +08:00
<?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="cc.iteachyou.cms.dao.UserMapper" >
<resultMap id="BaseResultMap" type="cc.iteachyou.cms.entity.User" >
<id column="id" property="id" jdbcType="VARCHAR" />
<result column="username" property="username" jdbcType="VARCHAR" />
<result column="password" property="password" jdbcType="VARCHAR" />
<result column="mobile" property="mobile" jdbcType="VARCHAR" />
<result column="realname" property="realname" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="page_style" property="pageStyle" jdbcType="VARCHAR" />
<result column="salt" property="salt" jdbcType="VARCHAR" />
<result column="last_login_ip" property="lastLoginIp" jdbcType="VARCHAR" />
<result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP" />
<result column="portrait" property="portrait" jdbcType="VARCHAR" />
<result column="create_by" property="createBy" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="update_by" property="updateBy" jdbcType="VARCHAR" />
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List" >
id, username, password, mobile, realname, status, page_style, salt, last_login_ip, last_login_time,
portrait, create_by, create_time, update_by, update_time
</sql>
<select id="getByUserName" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from system_user
where username = #{username,jdbcType=VARCHAR}
</select>
<select id="listByPage" parameterType="java.util.Map" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from system_user
where 1 = 1
<if test="username != null and username != ''">
and username like concat('%',#{username,jdbcType=VARCHAR},'%')
</if>
</select>
</mapper>