作者 shenhailong

用户绑定公司id 角色类型 汉字改为数字代替

... ... @@ -27,9 +27,11 @@ public class RoleController {
@RequestParam(value = "pageSize",required = false,defaultValue = "10")
int pageSize,
@RequestParam(value = "roleName",required = false)
String roleName){
String roleName,
@RequestParam(value = "type", required = false)
String type){
return roleService.findAll(pageNum,pageSize, roleName);
return roleService.findAll(pageNum,pageSize, roleName, type);
}
@LogAnnotation(moduleName = "岗位/角色管理",operate = "岗位/角色添加")
... ...
... ... @@ -18,7 +18,8 @@ public interface ROLEMapper {
List<ROLE> selectByParentId(Integer roleId);
List<ROLE> findAll(@Param("roleName") String roleName);
List<ROLE> findAll(@Param("roleName") String roleName,
@Param("type") String type);
int updateByPrimaryKeySelective(ROLE record);
... ...
... ... @@ -5,7 +5,7 @@ import com.tianbo.warehouse.model.ROLE;
import com.tianbo.warehouse.model.RolePermission;
public interface RoleService {
PageInfo<ROLE> findAll(int pageNum, int pageSize, String roleName);
PageInfo<ROLE> findAll(int pageNum, int pageSize, String roleName, String type);
int insertSelective(ROLE record);
... ...
... ... @@ -33,9 +33,9 @@ public class RoleServiceImp implements RoleService{
PermissionService permissionService;
@Override
public PageInfo<ROLE> findAll(int pageNum, int pageSize, String roleName){
public PageInfo<ROLE> findAll(int pageNum, int pageSize, String roleName, String type){
Page<ROLE> page = PageHelper.startPage(pageNum,pageSize);
List<ROLE> list = roleMapper.findAll(roleName);
List<ROLE> list = roleMapper.findAll(roleName, type);
PageInfo<ROLE> result = new PageInfo<ROLE>(list);
return result;
... ...
... ... @@ -179,6 +179,9 @@
<if test="roleName != '' and roleName !=null">
and role_name = #{roleName, jdbcType=VARCHAR}
</if>
<if test="type != '' and type !=null">
and type = #{type, jdbcType=VARCHAR}
</if>
</select>
<select id="findRolesByUserId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
SELECT
... ...
... ... @@ -126,6 +126,9 @@
<if test="age != null" >
age,
</if>
<if test="companyId != null" >
company_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="userId != null" >
... ... @@ -170,6 +173,9 @@
<if test="age != null" >
#{age,jdbcType=INTEGER},
</if>
<if test="companyId != null" >
#{companyId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.USERS" >
... ... @@ -211,6 +217,9 @@
<if test="age != null" >
age = #{age,jdbcType=INTEGER},
</if>
<if test="companyId != null" >
company_id = #{companyId,jdbcType=INTEGER},
</if>
</set>
where user_id = #{userId,jdbcType=INTEGER}
</update>
... ...