|
@@ -6,8 +6,8 @@
|
|
|
<!-- 增 -->
|
|
|
<insert id="add">
|
|
|
insert into
|
|
|
- sp_admin(name, avatar,nickname,detp_id, phone, role_id, create_by_aid, create_time)
|
|
|
- values (#{name}, #{avatar},#{nickname},#{deptId}, #{phone}, #{roleId}, #{createByAid}, now())
|
|
|
+ sp_admin(name, avatar,nickname,dept_id, dept_name, phone, role_id, create_by_aid, create_time)
|
|
|
+ values (#{name}, #{avatar},#{nickname},#{deptId}, #{deptName}, #{phone}, #{roleId}, #{createByAid}, now())
|
|
|
</insert>
|
|
|
|
|
|
|
|
@@ -38,6 +38,7 @@
|
|
|
<result property="id" column="id" />
|
|
|
<result property="name" column="name" />
|
|
|
<result property="deptId" column="dept_id" />
|
|
|
+ <result property="deptName" column="dept_name" />
|
|
|
<result property="avatar" column="avatar" />
|
|
|
<result property="password" column="password" />
|
|
|
<!-- <result property="pw" column="pw" /> -->
|
|
@@ -55,7 +56,7 @@
|
|
|
<!-- 查询sql -->
|
|
|
<sql id="select_sql">
|
|
|
select *,
|
|
|
- (select name from sp_role where id = sp_admin.role_id) as role_name,(select name from tb_dept where id=sp_admin.dept_id) as deptName
|
|
|
+ (select name from sp_role where id = sp_admin.role_id) as role_name
|
|
|
from sp_admin
|
|
|
</sql>
|
|
|
|
|
@@ -84,7 +85,7 @@
|
|
|
<include refid="select_sql"></include>
|
|
|
where 1=1
|
|
|
<if test=' this.has("id") '>and id = #{id} </if>
|
|
|
- <if test=' this.has("deptId") '>and dept_id = #{deptId} </if>
|
|
|
+ <if test=' this.has("deptId") '>and dept_id in (${deptId}) </if>
|
|
|
<if test=' this.has("name") '>and name like concat('%', #{name}, '%') </if>
|
|
|
<if test=' this.has("roleId") '>and role_id = #{roleId} </if>
|
|
|
order by
|