Commit 4abb01da by Suvalue

丰城后台

parent 31ce77ca
...@@ -22,4 +22,6 @@ public interface SysUserMapper { ...@@ -22,4 +22,6 @@ public interface SysUserMapper {
List<SysUserList> selectUserList(); List<SysUserList> selectUserList();
SysUserList selectUserById(@Param("id") Integer id); SysUserList selectUserById(@Param("id") Integer id);
Integer selectId();
} }
\ No newline at end of file
...@@ -34,7 +34,7 @@ public class UserServiceImpl implements UserService { ...@@ -34,7 +34,7 @@ public class UserServiceImpl implements UserService {
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
public boolean addUser(Long userId, AddUserReq user) { public boolean addUser(Long userId, AddUserReq user) {
if (user != null) { if (user != null) {
//添加用户信息 //添加用户信息
...@@ -48,6 +48,7 @@ public class UserServiceImpl implements UserService { ...@@ -48,6 +48,7 @@ public class UserServiceImpl implements UserService {
sysUser.setCreateDate(new Date()); sysUser.setCreateDate(new Date());
sysUser.setCreateUserid(userId); sysUser.setCreateUserid(userId);
sysUser.setState((short) StateType.ON.getValue()); sysUser.setState((short) StateType.ON.getValue());
sysUser.setId(sysUserMapper.selectId());
sysUserMapper.insert(sysUser); sysUserMapper.insert(sysUser);
//添加角色信息 //添加角色信息
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
where "ID" = #{id,jdbcType=INTEGER} where "ID" = #{id,jdbcType=INTEGER}
</delete> </delete>
<insert id="insert" parameterType="com.hs.admin.model.SysUser"> <insert id="insert" parameterType="com.hs.admin.model.SysUser">
<!-- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">--> <!-- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">-->
<!-- SELECT SEQ_SYS_USER_ID.nextval--> <!-- SELECT SEQ_SYS_USER_ID.nextval-->
<!-- </selectKey>--> <!-- </selectKey>-->
insert into sys_user ("ID",CREATE_DATE, CREATE_USERID, "STATE", insert into sys_user ("ID",CREATE_DATE, CREATE_USERID, "STATE",
...@@ -139,4 +139,8 @@ ...@@ -139,4 +139,8 @@
(s.PARENT_ID = 0 and r.ROLE_CODE = 1)) (s.PARENT_ID = 0 and r.ROLE_CODE = 1))
where u.id = #{id} where u.id = #{id}
</select> </select>
<select id="selectId" resultType="java.lang.Integer">
SELECT SEQ_SYS_USER_ID.nextval
from dual
</select>
</mapper> </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