Commit 12701b7e by duanhq

文件移至用户中心 by duanht 2019/1/23

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@16941 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent ffd0d397
Showing 58 changed files with 850 additions and 930 deletions
package com.glsx.manager.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.glsx.manager.pojo.menu.SysMenu;
import com.glsx.manager.pojo.menu.SysMenuExample;
public interface SysMenuMapper {
long countByExample(SysMenuExample example);
int deleteByExample(SysMenuExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysMenu record);
int insertSelective(SysMenu record);
List<SysMenu> selectByExample(SysMenuExample example);
SysMenu selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysMenu record, @Param("example") SysMenuExample example);
int updateByExample(@Param("record") SysMenu record, @Param("example") SysMenuExample example);
int updateByPrimaryKeySelective(SysMenu record);
int updateByPrimaryKey(SysMenu record);
List<SysMenu> findMenuByParams(Map map);
SysMenu findMenuByParentId(@Param("id")Integer id);
}
\ No newline at end of file
package com.glsx.manager.mapper;
import com.glsx.manager.pojo.user.SysMerchantServices;
import com.glsx.manager.pojo.user.SysMerchantServicesExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysMerchantServicesMapper {
long countByExample(SysMerchantServicesExample example);
int deleteByExample(SysMerchantServicesExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysMerchantServices record);
int insertSelective(SysMerchantServices record);
List<SysMerchantServices> selectByExample(SysMerchantServicesExample example);
SysMerchantServices selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysMerchantServices record, @Param("example") SysMerchantServicesExample example);
int updateByExample(@Param("record") SysMerchantServices record, @Param("example") SysMerchantServicesExample example);
int updateByPrimaryKeySelective(SysMerchantServices record);
int updateByPrimaryKey(SysMerchantServices record);
}
\ No newline at end of file
package com.glsx.manager.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.glsx.manager.pojo.menu.SysOrganization;
import com.glsx.manager.pojo.menu.SysOrganizationExample;
public interface SysOrganizationMapper {
long countByExample(SysOrganizationExample example);
int deleteByExample(SysOrganizationExample example);
int deleteByPrimaryKey(Integer id);
int insertSelective(SysOrganization record);
List<SysOrganization> selectByExample(SysOrganizationExample example);
SysOrganization selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysOrganization record, @Param("example") SysOrganizationExample example);
int updateByExample(@Param("record") SysOrganization record, @Param("example") SysOrganizationExample example);
int updateByPrimaryKeySelective(SysOrganization record);
int updateByPrimaryKey(SysOrganization record);
}
\ No newline at end of file
package com.glsx.manager.pojo.menu;
import java.util.Date;
import java.util.List;
public class SysMenu {
private Integer id;
private String name;
private Integer parentId;
private Integer sort;
private String rightDes;
private String requestAdd;
private Byte menuStatus;
private Byte menuType;
private String menuIcon;
private Byte isShow;
private Date createTime;
private Date updateTime;
private String remark;
private String updateBy;
private String createBy;
private Byte label;
private String menuGroup;
private String funcType;
private List<SysMenu> children;
public List<SysMenu> getChildren() {
return children;
}
public void setChildren(List<SysMenu> children) {
this.children = children;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public String getRightDes() {
return rightDes;
}
public void setRightDes(String rightDes) {
this.rightDes = rightDes == null ? null : rightDes.trim();
}
public String getRequestAdd() {
return requestAdd;
}
public void setRequestAdd(String requestAdd) {
this.requestAdd = requestAdd == null ? null : requestAdd.trim();
}
public Byte getMenuStatus() {
return menuStatus;
}
public void setMenuStatus(Byte menuStatus) {
this.menuStatus = menuStatus;
}
public Byte getMenuType() {
return menuType;
}
public void setMenuType(Byte menuType) {
this.menuType = menuType;
}
public String getMenuIcon() {
return menuIcon;
}
public void setMenuIcon(String menuIcon) {
this.menuIcon = menuIcon == null ? null : menuIcon.trim();
}
public Byte getIsShow() {
return isShow;
}
public void setIsShow(Byte isShow) {
this.isShow = isShow;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public Byte getLabel() {
return label;
}
public void setLabel(Byte label) {
this.label = label;
}
public String getMenuGroup() {
return menuGroup;
}
public void setMenuGroup(String menuGroup) {
this.menuGroup = menuGroup == null ? null : menuGroup.trim();
}
public String getFuncType() {
return funcType;
}
public void setFuncType(String funcType) {
this.funcType = funcType == null ? null : funcType.trim();
}
}
\ No newline at end of file
package com.glsx.manager.pojo.menu;
import java.util.Date;
public class SysOrganization {
private Integer id;
private Integer parentId;
private String name;
private Byte orgStatus;
private Byte orgType;
private Integer sort;
private Date createTime;
private Date updateTime;
private String remark;
private String updateBy;
private String createBy;
private Byte label;
private String orgGroup;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Byte getOrgStatus() {
return orgStatus;
}
public void setOrgStatus(Byte orgStatus) {
this.orgStatus = orgStatus;
}
public Byte getOrgType() {
return orgType;
}
public void setOrgType(Byte orgType) {
this.orgType = orgType;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public Byte getLabel() {
return label;
}
public void setLabel(Byte label) {
this.label = label;
}
public String getOrgGroup() {
return orgGroup;
}
public void setOrgGroup(String orgGroup) {
this.orgGroup = orgGroup == null ? null : orgGroup.trim();
}
}
\ 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.glsx.manager.mapper.SysOrganizationMapper">
<resultMap id="BaseResultMap" type="com.glsx.manager.pojo.menu.SysOrganization">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="parent_id" jdbcType="INTEGER" property="parentId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="org_status" jdbcType="TINYINT" property="orgStatus" />
<result column="org_type" jdbcType="TINYINT" property="orgType" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="label" jdbcType="TINYINT" property="label" />
<result column="org_group" jdbcType="VARCHAR" property="orgGroup" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, parent_id, name, org_status, org_type, sort, create_time, update_time, remark,
update_by, create_by, label, org_group
</sql>
<select id="selectByExample" parameterType="com.glsx.manager.pojo.menu.SysOrganizationExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List" />
from sys_organization
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_organization
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_organization
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.manager.pojo.menu.SysOrganization">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_organization (parent_id, name, org_status,
org_type, sort, create_time,
update_time, remark, update_by,
create_by, label, org_group
)
values (#{parentId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{orgStatus,jdbcType=TINYINT},
#{orgType,jdbcType=TINYINT}, #{sort,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{label,jdbcType=TINYINT}, #{orgGroup,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.manager.pojo.menu.SysOrganization">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_organization
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">
parent_id,
</if>
<if test="name != null">
name,
</if>
<if test="orgStatus != null">
org_status,
</if>
<if test="orgType != null">
org_type,
</if>
<if test="sort != null">
sort,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="remark != null">
remark,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="label != null">
label,
</if>
<if test="orgGroup != null">
org_group,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">
#{parentId,jdbcType=INTEGER},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="orgStatus != null">
#{orgStatus,jdbcType=TINYINT},
</if>
<if test="orgType != null">
#{orgType,jdbcType=TINYINT},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="label != null">
#{label,jdbcType=TINYINT},
</if>
<if test="orgGroup != null">
#{orgGroup,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.manager.pojo.menu.SysOrganization">
update sys_organization
<set>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="orgStatus != null">
org_status = #{orgStatus,jdbcType=TINYINT},
</if>
<if test="orgType != null">
org_type = #{orgType,jdbcType=TINYINT},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="label != null">
label = #{label,jdbcType=TINYINT},
</if>
<if test="orgGroup != null">
org_group = #{orgGroup,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.manager.pojo.menu.SysOrganization">
update sys_organization
set parent_id = #{parentId,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
org_status = #{orgStatus,jdbcType=TINYINT},
org_type = #{orgType,jdbcType=TINYINT},
sort = #{sort,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
label = #{label,jdbcType=TINYINT},
org_group = #{orgGroup,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="recursionOrgMap" type="com.glsx.manager.pojo.menu.SysOrganization" extends="BaseResultMap" >
<collection property="children" ofType="com.glsx.manager.pojo.menu.SysOrganization" column="{id=id,org_status=,org_status}"
select="findOrgByParams" />
</resultMap>
<select id="findOrgByParams" resultMap="recursionOrgMap" parameterType="java.util.Map" >
SELECT
<include refid="Base_Column_List" />
from sys_organization WHERE 1=1
<if test="id != null">
and parent_id = #{id}
</if>
<if test="orgStatus != null">
and org_status = #{orgStatus}
</if>
ORDER BY
`sort` ASC
</select>
<resultMap id="recursionOrgResultMap" type="com.glsx.manager.pojo.menu.SysOrganization" extends="BaseResultMap" >
<collection property="children" ofType="com.glsx.manager.pojo.menu.SysOrganization" column="{id=id,org_status=org_status}"
select="findOrgByParentId" />
</resultMap>
<select id="findOrgByParentId" resultMap="recursionOrgResultMap">
SELECT
<include refid="Base_Column_List" />
from sys_organization WHERE parent_id = #{id}
and org_status in (0,1)
ORDER BY
`sort` ASC
</select>
</mapper>
\ No newline at end of file
package com.glsx.manager.controller;
package com.glsx.usercenter.controller;
import java.util.Date;
import java.util.HashMap;
......@@ -7,6 +7,10 @@ import java.util.Map;
import javax.validation.groups.Default;
import com.glsx.usercenter.constants.ResultCodeEnum;
import com.glsx.usercenter.pojo.GroupA;
import com.glsx.usercenter.pojo.dictionary.DictionaryType;
import com.glsx.usercenter.service.DictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.validation.BindingResult;
......@@ -18,10 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.Page;
import com.glsx.manager.constants.ResultCodeEnum;
import com.glsx.manager.pojo.GroupA;
import com.glsx.manager.pojo.dictionary.DictionaryType;
import com.glsx.manager.service.DictionaryTypeService;
/**
*
......
package com.glsx.manager.controller;
package com.glsx.usercenter.controller;
import com.github.pagehelper.PageHelper;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.Page;
import com.glsx.common.utils.StringUtils;
import com.glsx.manager.constants.ResultCodeEnum;
import com.glsx.manager.pojo.role.SysRole;
import com.glsx.manager.pojo.vo.RoleQueryVo;
import com.glsx.manager.service.SysRoleService;
import com.glsx.usercenter.constants.ResultCodeEnum;
import com.glsx.usercenter.pojo.role.SysRole;
import com.glsx.usercenter.pojo.vo.RoleQueryVo;
import com.glsx.usercenter.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
......
package com.glsx.manager.controller;
package com.glsx.usercenter.controller;
import com.github.pagehelper.PageHelper;
import com.glsx.common.constants.ResultObject;
......@@ -6,22 +6,23 @@ import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.EncryptUtil;
import com.glsx.common.utils.Page;
import com.glsx.common.utils.StringUtils;
import com.glsx.manager.constants.Constants;
import com.glsx.manager.constants.ResultCodeEnum;
import com.glsx.manager.pojo.user.SysManager;
import com.glsx.manager.pojo.user.SysMechanic;
import com.glsx.manager.pojo.user.SysMerchant;
import com.glsx.manager.pojo.user.SysUser;
import com.glsx.manager.exception.GlobalExceptionHandler;
import com.glsx.manager.pojo.menu.SysOrganization;
import com.glsx.manager.pojo.user.*;
import com.glsx.manager.pojo.vo.UserQueryVo;
import com.glsx.manager.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
/**
* @author duanht
......@@ -154,6 +155,7 @@ public class UserController extends BaseController {
sysMerchant.setCreateTime(DateUtil.getCurrentDate());
//测试
sysMerchant.setCreateBy("1");
sysMerchant.setRolesId(new ArrayList<>(3));
}
//性别默认为未知
if (StringUtils.isEmpty(sysMerchant.getSex())) {
......@@ -180,11 +182,12 @@ public class UserController extends BaseController {
if (!sysUserService.findByUserName(sysMechanic.getUsername()).isEmpty()) {
return new ResultObject(ResultCodeEnum.FAIL.getCode(), "技工信息已存在");
}
sysMechanic.setUserStatus(3);
sysMechanic.setUserStatus(1);
sysMechanic.setPassword(EncryptUtil.PBEEncrypt(sysMechanic.getPassword()));
sysMechanic.setCreateTime(DateUtil.getCurrentDate());
//测试
sysMechanic.setCreateBy("1");
sysMechanic.setRolesId(new ArrayList<>(4));
}
//性别默认为未知
if (StringUtils.isEmpty(sysMechanic.getSex())) {
......@@ -207,7 +210,7 @@ public class UserController extends BaseController {
@ResponseBody
public ResultObject updatePassword(SysUser sysUser) {
sysUser.setPassword(EncryptUtil.PBEEncrypt(sysUser.getPassword()));
int result = sysUserService.updatePassword(sysUser);
int result = sysUserService.updateByPrimaryKeySelective(sysUser);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result);
}
......@@ -217,7 +220,7 @@ public class UserController extends BaseController {
* @return ResultObject
* @author duanht
* @Title: getUserById
* @Description: TODO 根据用户id获取用户信息
* @Description: TODO 根据用户id获取主体信息
*/
@RequestMapping(value = "/getUserById", method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
......@@ -241,4 +244,45 @@ public class UserController extends BaseController {
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result);
}
/**
* @param sysUser
* @return ResultObject
* @author duanht
* @Title: deleteUser
* @Description: TODO 技工审核
*/
@RequestMapping(value = "/checkSysMechanic", method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
@Transactional(rollbackFor = Exception.class)
public ResultObject checkSysMechanic(SysUser sysUser) {
int result = sysUserService.updateByPrimaryKeySelective(sysUser);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(), result);
}
/**
* @return ResultObject
* @author duanht
* @Title: getUserOrg
* @Description: TODO 获取当前用户下的数据权限
*/
@RequestMapping(value = "/getUserOrg", method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
@Transactional(rollbackFor = Exception.class)
public ResultObject getUserOrg() {
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(),sysUserService.getUserOrg(1));
}
/**
* @return ResultObject
* @author duanht
* @Title: bindingService
* @Description: TODO 绑定服务商
*/
@RequestMapping(value = "/bindingService", method = {RequestMethod.GET, RequestMethod.POST})
@ResponseBody
@Transactional(rollbackFor = Exception.class)
public ResultObject bindingService(SysResourceMatching sysResourceMatching , String serviceItem) {
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg(),sysUserService.bindingService(sysResourceMatching,serviceItem));
}
}
package com.glsx.manager.mapper;
package com.glsx.usercenter.mapper;
import java.util.List;
import com.glsx.manager.pojo.dictionary.DictionaryType;
import com.glsx.usercenter.pojo.dictionary.DictionaryType;
import java.util.List;
/**
*
......
package com.glsx.usercenter.mapper;
import com.glsx.usercenter.pojo.user.SysResourceMatching;
import com.glsx.usercenter.pojo.user.SysResourceMatchingExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysResourceMatchingMapper {
long countByExample(SysResourceMatchingExample example);
int deleteByExample(SysResourceMatchingExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysResourceMatching record);
int insertSelective(SysResourceMatching record);
List<SysResourceMatching> selectByExample(SysResourceMatchingExample example);
SysResourceMatching selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysResourceMatching record, @Param("example") SysResourceMatchingExample example);
int updateByExample(@Param("record") SysResourceMatching record, @Param("example") SysResourceMatchingExample example);
int updateByPrimaryKeySelective(SysResourceMatching record);
int updateByPrimaryKey(SysResourceMatching record);
}
\ No newline at end of file
package com.glsx.manager.mapper;
package com.glsx.usercenter.mapper;
import com.glsx.manager.pojo.menu.SysMenu;
import com.glsx.manager.pojo.role.SysRole;
import com.glsx.manager.pojo.role.SysRoleExample;
import com.glsx.manager.pojo.vo.RoleQueryVo;
import com.glsx.usercenter.pojo.menu.SysMenu;
import com.glsx.usercenter.pojo.role.SysRole;
import com.glsx.usercenter.pojo.role.SysRoleExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......
package com.glsx.manager.mapper;
package com.glsx.usercenter.mapper;
import com.glsx.manager.pojo.role.SysRoleMenu;
import com.glsx.manager.pojo.role.SysRoleMenuExample;
import java.util.List;
import com.glsx.usercenter.pojo.role.SysRoleMenu;
import com.glsx.usercenter.pojo.role.SysRoleMenuExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysRoleMenuMapper {
long countByExample(SysRoleMenuExample example);
......
package com.glsx.manager.mapper;
package com.glsx.usercenter.mapper;
import java.util.List;
import com.glsx.manager.pojo.user.*;
import com.glsx.manager.pojo.vo.UserQueryVo;
import com.glsx.usercenter.pojo.user.*;
import com.glsx.usercenter.pojo.vo.UserQueryVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysUserMapper {
long countByExample(SysUserExample example);
......
package com.glsx.manager.mapper;
package com.glsx.usercenter.mapper;
import com.glsx.manager.pojo.user.SysUserOrg;
import com.glsx.usercenter.pojo.user.SysUserOrg;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......
package com.glsx.manager.mapper;
import java.util.List;
import com.glsx.manager.pojo.user.SysUserRole;
package com.glsx.usercenter.mapper;
import com.glsx.usercenter.pojo.user.SysUserRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysUserRoleMapper {
int deleteByPrimaryKey(Long id);
......
package com.glsx.usercenter.mapper;
import com.glsx.usercenter.pojo.user.SysUserServices;
import com.glsx.usercenter.pojo.user.SysUserServicesExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysUserServicesMapper {
long countByExample(SysUserServicesExample example);
int deleteByExample(SysUserServicesExample example);
int deleteByPrimaryKey(Integer id);
int insert(SysUserServices record);
int insertSelective(SysUserServices record);
List<SysUserServices> selectByExample(SysUserServicesExample example);
SysUserServices selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") SysUserServices record, @Param("example") SysUserServicesExample example);
int updateByExample(@Param("record") SysUserServices record, @Param("example") SysUserServicesExample example);
int updateByPrimaryKeySelective(SysUserServices record);
int updateByPrimaryKey(SysUserServices record);
int deleteByUserId(@Param(value = "userId") int userId);
}
\ No newline at end of file
package com.glsx.manager.pojo.dictionary;
package com.glsx.usercenter.pojo.dictionary;
import com.glsx.usercenter.pojo.BaseModel;
import com.glsx.usercenter.pojo.GroupA;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
import com.glsx.manager.pojo.BaseModel;
import com.glsx.manager.pojo.GroupA;
/**
*
* @Title DictionaryType.java
......@@ -15,7 +17,7 @@ import com.glsx.manager.pojo.GroupA;
* @date 2019年1月3日 下午4:24:51
* @version 1.0.0
*/
public class DictionaryType extends BaseModel{
public class DictionaryType extends BaseModel {
/**
* 主键id
......
package com.glsx.manager.pojo.role;
package com.glsx.usercenter.pojo.role;
import com.glsx.usercenter.pojo.BaseModel;
import com.glsx.usercenter.pojo.menu.SysMenu;
import com.glsx.manager.pojo.BaseModel;
import com.glsx.manager.pojo.menu.SysMenu;
import java.util.ArrayList;
import java.util.List;
......
package com.glsx.manager.pojo.role;
package com.glsx.usercenter.pojo.role;
import java.util.ArrayList;
import java.util.Date;
......
package com.glsx.manager.pojo.role;
package com.glsx.usercenter.pojo.role;
public class SysRoleMenu {
private Integer id;
......
package com.glsx.manager.pojo.user;
package com.glsx.usercenter.pojo.user;
import java.util.Date;
......@@ -42,14 +42,14 @@ public class SysMechanic extends SysUser{
private Integer serviceType;
/**
*服务项
*身份证号
*/
private String dataValue;
private String IDCard;
/**
*服务项
*技工审核状态(1:待审核 2:审核不通过 3:审核通过)
*/
private String IDCard;
private Integer mechanicStatus;
public Integer getDistrict() {
return district;
......@@ -91,14 +91,6 @@ public class SysMechanic extends SysUser{
this.dispatchType = dispatchType;
}
public String getDataValue() {
return dataValue;
}
public void setDataValue(String dataValue) {
this.dataValue = dataValue;
}
public Integer getServiceType() {
return serviceType;
}
......@@ -114,4 +106,12 @@ public class SysMechanic extends SysUser{
public void setIDCard(String IDCard) {
this.IDCard = IDCard;
}
public Integer getMechanicStatus() {
return mechanicStatus;
}
public void setMechanicStatus(Integer mechanicStatus) {
this.mechanicStatus = mechanicStatus;
}
}
package com.glsx.manager.pojo.user;
package com.glsx.usercenter.pojo.user;
/**
* @author duanht
......@@ -32,9 +32,9 @@ public class SysMerchant extends SysUser{
private Integer serviceType;
/**
*服务项
*商户资源匹配状态(1:未绑定服务商;2:已绑定服务商未绑定技工;3:两者都绑定)
*/
private String dataValue;
private Integer merchantStatus;
public Integer getDistrict() {
return district;
......@@ -68,11 +68,11 @@ public class SysMerchant extends SysUser{
this.serviceType = serviceType;
}
public String getDataValue() {
return dataValue;
public Integer getMerchantStatus() {
return merchantStatus;
}
public void setDataValue(String dataValue) {
this.dataValue = dataValue;
public void setMerchantStatus(Integer merchantStatus) {
this.merchantStatus = merchantStatus;
}
}
package com.glsx.manager.pojo.user;
package com.glsx.usercenter.pojo.user;
public class SysMerchantServices {
public class SysResourceMatching {
private Integer id;
private Integer merchantId;
private Integer userId;
private Integer serviceId;
public Integer getId() {
......@@ -23,6 +25,14 @@ public class SysMerchantServices {
this.merchantId = merchantId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getServiceId() {
return serviceId;
}
......
package com.glsx.manager.pojo.user;
package com.glsx.usercenter.pojo.user;
import java.util.ArrayList;
import java.util.List;
public class SysMerchantServicesExample {
public class SysResourceMatchingExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysMerchantServicesExample() {
public SysResourceMatchingExample() {
oredCriteria = new ArrayList<Criteria>();
}
......@@ -224,6 +224,66 @@ public class SysMerchantServicesExample {
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Integer value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Integer value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Integer value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Integer value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Integer value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Integer value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Integer> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Integer> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Integer value1, Integer value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Integer value1, Integer value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andServiceIdIsNull() {
addCriterion("service_id is null");
return (Criteria) this;
......
package com.glsx.manager.pojo.user;
package com.glsx.usercenter.pojo.user;
import com.glsx.usercenter.pojo.BaseModel;
import com.glsx.manager.pojo.BaseModel;
import java.util.ArrayList;
import java.util.List;
......@@ -61,6 +63,11 @@ public class SysUser extends BaseModel {
*/
private String orgName;
/**
*服务项
*/
private String serviceItems;
private List<Integer> rolesId = new ArrayList<>();
private List<Integer> orgsId = new ArrayList<>();
......@@ -189,5 +196,12 @@ public class SysUser extends BaseModel {
this.orgName = orgName;
}
public String getServiceItems() {
return serviceItems;
}
public void setServiceItems(String serviceItems) {
this.serviceItems = serviceItems;
}
}
package com.glsx.manager.pojo.user;
package com.glsx.usercenter.pojo.user;
import java.util.ArrayList;
import java.util.Date;
......
package com.glsx.manager.pojo.user;
package com.glsx.usercenter.pojo.user;
import java.util.ArrayList;
import java.util.List;
......
package com.glsx.usercenter.pojo.user;
public class SysUserServices {
private Integer id;
private Integer userId;
private Integer serviceId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getServiceId() {
return serviceId;
}
public void setServiceId(Integer serviceId) {
this.serviceId = serviceId;
}
}
\ No newline at end of file
package com.glsx.manager.pojo.vo;
package com.glsx.usercenter.pojo.vo;
import java.io.Serializable;
import java.util.List;
......
package com.glsx.manager.pojo.vo;
package com.glsx.usercenter.pojo.vo;
import java.util.List;
......@@ -31,6 +31,11 @@ public class UserQueryVo extends BaseQueryVo {
private String shopName;
/**
* 门店联系人信息(包括手机号和用户名称)
*/
private String shopContactsInfo;
/**
* 所属总部
*/
private String orgName;
......@@ -51,10 +56,12 @@ public class UserQueryVo extends BaseQueryVo {
private String name;
/**
* 技工列表类型(0:技工管理列表;1:技工审核列表)
* 技工列表类型(0:技工管理列表;1:技工审核列表;2:商户管理列表;3:服务商资源管理列表;4:技工资源管理列表)
*/
private String listType;
public List<Integer> getIdList() {
return idList;
}
......@@ -135,4 +142,12 @@ public class UserQueryVo extends BaseQueryVo {
public void setListType(String listType) {
this.listType = listType;
}
public String getShopContactsInfo() {
return shopContactsInfo;
}
public void setShopContactsInfo(String shopContactsInfo) {
this.shopContactsInfo = shopContactsInfo;
}
}
package com.glsx.manager.service;
package com.glsx.usercenter.service;
import java.util.List;
import com.glsx.common.utils.Page;
import com.glsx.manager.pojo.dictionary.DictionaryType;
import com.glsx.usercenter.pojo.dictionary.DictionaryType;
/**
*
......
package com.glsx.manager.service;
package com.glsx.usercenter.service;
import com.glsx.manager.pojo.role.SysRole;
import com.glsx.manager.pojo.user.SysUser;
import com.glsx.manager.pojo.vo.RoleQueryVo;
import com.glsx.usercenter.pojo.role.SysRole;
import com.glsx.usercenter.pojo.vo.RoleQueryVo;
import javax.validation.Valid;
import java.util.List;
......
package com.glsx.manager.service;
package com.glsx.usercenter.service;
import com.glsx.manager.pojo.user.SysManager;
import com.glsx.manager.pojo.user.SysMechanic;
import com.glsx.manager.pojo.user.SysMerchant;
import com.glsx.manager.pojo.user.SysUser;
import com.glsx.manager.pojo.vo.UserQueryVo;
import com.glsx.usercenter.pojo.menu.SysOrganization;
import com.glsx.usercenter.pojo.user.*;
import com.glsx.usercenter.pojo.vo.UserQueryVo;
import java.util.List;
......@@ -99,14 +99,6 @@ public interface SysUserService {
*/
int saveSysMechanic(SysMechanic sysMechanic);
/**
* @param sysUser
* @return int
* @author duanht
* @Title: resetPassword
* @Description: TODO 修改用户密码
*/
int updatePassword(SysUser sysUser);
/**
* @param id
......@@ -117,6 +109,30 @@ public interface SysUserService {
*/
SysUser getUserById(Integer id);
/**
* @param sysUser
* @return SysUser
* @author duanht
* @Title: getUserById
* @Description: TODO
*/
int updateByPrimaryKeySelective(SysUser sysUser);
/**
* @param id
* @return SysUser
* @author duanht
* @Title: getUserById
* @Description: TODO 根据id查询数据权限
*/
List<SysOrganization> getUserOrg(int id);
/**
* @param sysResourceMatching,serviceItem
* @return SysUser
* @author duanht
* @Title: getUserById
* @Description: TODO 绑定服务商
*/
int bindingService(SysResourceMatching sysResourceMatching, String serviceItem);
}
package com.glsx.manager.service.impl;
package com.glsx.usercenter.service.impl;
import java.util.List;
import com.glsx.usercenter.mapper.DictionaryTypeMapper;
import com.glsx.usercenter.pojo.dictionary.DictionaryType;
import com.glsx.usercenter.service.DictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.page.PageMethod;
import com.glsx.common.utils.Page;
import com.glsx.manager.mapper.DictionaryTypeMapper;
import com.glsx.manager.pojo.dictionary.DictionaryType;
import com.glsx.manager.service.DictionaryTypeService;
/**
*
* @Title DictionaryTypeServiceImpl.java
......
package com.glsx.manager.service.impl;
package com.glsx.usercenter.service.impl;
import com.glsx.common.utils.DateUtil;
import com.glsx.common.utils.StringUtils;
import com.glsx.manager.mapper.SysRoleMapper;
import com.glsx.manager.mapper.SysRoleMenuMapper;
import com.glsx.manager.mapper.SysUserRoleMapper;
import com.glsx.manager.pojo.menu.SysMenu;
import com.glsx.manager.pojo.role.SysRole;
import com.glsx.manager.pojo.role.SysRoleExample;
import com.glsx.manager.pojo.role.SysRoleMenu;
import com.glsx.manager.pojo.user.*;
import com.glsx.manager.pojo.vo.RoleQueryVo;
import com.glsx.manager.service.SysRoleService;
import com.glsx.usercenter.mapper.SysRoleMapper;
import com.glsx.usercenter.mapper.SysRoleMenuMapper;
import com.glsx.usercenter.mapper.SysUserRoleMapper;
import com.glsx.usercenter.pojo.menu.SysMenu;
import com.glsx.usercenter.pojo.role.SysRole;
import com.glsx.usercenter.pojo.role.SysRoleExample;
import com.glsx.usercenter.pojo.role.SysRoleMenu;
import com.glsx.usercenter.pojo.vo.RoleQueryVo;
import com.glsx.usercenter.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......
package com.glsx.manager.service.impl;
import com.glsx.manager.mapper.SysMerchantServicesMapper;
import com.glsx.manager.mapper.SysUserMapper;
import com.glsx.manager.mapper.SysUserOrgMapper;
import com.glsx.manager.mapper.SysUserRoleMapper;
import com.glsx.manager.pojo.user.*;
import com.glsx.manager.pojo.vo.UserQueryVo;
import com.glsx.manager.service.SysUserService;
package com.glsx.usercenter.service.impl;
import com.glsx.usercenter.mapper.SysUserMapper;
import com.glsx.usercenter.mapper.SysUserOrgMapper;
import com.glsx.usercenter.mapper.SysUserRoleMapper;
import com.glsx.usercenter.mapper.SysUserServicesMapper;
import com.glsx.usercenter.pojo.menu.SysOrganization;
import com.glsx.usercenter.pojo.user.*;
import com.glsx.usercenter.pojo.vo.UserQueryVo;
import com.glsx.usercenter.service.SysUserService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -36,7 +39,7 @@ public class SysUserServiceImpl implements SysUserService {
private SysUserOrgMapper sysUserOrgMapper;
@Autowired
private SysMerchantServicesMapper sysMerchantServicesMapper;
private SysUserServicesMapper sysUserServicesMapper;
@Override
public List<SysUser> getAllUserList(UserQueryVo userQueryVo) {
......@@ -55,10 +58,23 @@ public class SysUserServiceImpl implements SysUserService {
@Override
public List<SysMerchant> getSysMerchantList(UserQueryVo userQueryVo) {
String shopContactsInfo = userQueryVo.getShopContactsInfo();
if(StringUtils.isNotEmpty(shopContactsInfo)){
//传入的为手机号
if( StringUtils.isNumeric(shopContactsInfo)){
userQueryVo.setPhoneNumber(shopContactsInfo);
}else{
userQueryVo.setName(shopContactsInfo);
}
}
List<SysMerchant> sysMerchantList = sysUserMapper.getSysMerchantList(userQueryVo);
//匹配集团
for (SysMerchant sysMerchant : sysMerchantList) {
//根据商户组织id查询出集团id
}
return sysMerchantList;
}
......@@ -109,6 +125,10 @@ public class SysUserServiceImpl implements SysUserService {
BeanUtils.copyProperties(sysManager, sysUser);
updateRole(userId, sysUser);
updateData(userId, sysUser);
//服务商需要配置服务项
if (sysUser.getUserType() == 1) {
updateServiceItem(userId, sysUser);
}
return 1;
}
......@@ -195,28 +215,14 @@ public class SysUserServiceImpl implements SysUserService {
//更新商户详细表
sysUserMapper.updateSysMerchant(sysMerchant);
}
// 更新服务项
updateServiceItem(userId, sysMerchant.getUserId(),sysMerchant.getDataValue());
// 更新角色和服务项
SysUser sysUser = new SysUser();
BeanUtils.copyProperties(sysMerchant, sysUser);
updateRole(userId, sysUser);
updateServiceItem(userId, sysUser);
return 1;
}
private void updateServiceItem(Integer userId, Integer user_id , String serviceItems) {
//如果是更新角色和数据需要先删除原有的连接数据
if (userId == null) {
//普通用户需要根据user_id删除数据而不是自身的主键id
sysUserOrgMapper.deleteByUserId(user_id);
}
for(String item : serviceItems.split(",")){
//根据服务项名称查询id
SysMerchantServices sysMerchantServices = new SysMerchantServices();
sysMerchantServices.setMerchantId(user_id);
// sysMerchantServices.setServiceId();
// sysMerchantServicesMapper.insert();
}
}
@Override
public int saveSysMechanic(SysMechanic sysMechanic) {
Integer userId = null;
......@@ -232,18 +238,51 @@ public class SysUserServiceImpl implements SysUserService {
//更新技工详细表
sysUserMapper.updateSysMechanic(sysMechanic);
}
// 更新服务项
updateServiceItem(userId, sysMechanic.getUserId(),sysMechanic.getDataValue());
// 更新角色和服务项
SysUser sysUser = new SysUser();
BeanUtils.copyProperties(sysMechanic, sysUser);
updateRole(userId, sysUser);
updateServiceItem(userId, sysUser);
return 1;
}
private void updateServiceItem(Integer userId, SysUser sysUser) {
//如果是更新角色和数据需要先删除原有的连接数据
if (userId == null) {
//普通用户需要根据user_id删除数据而不是自身的主键id
sysUserOrgMapper.deleteByUserId(sysUser.getUserId());
}
for (String item : sysUser.getServiceItems().split(",")) {
//根据服务项名称查询id
SysUserServices sysMerchantServices = new SysUserServices();
sysMerchantServices.setUserId(sysUser.getUserId());
// sysMerchantServices.setServiceId();
// sysMerchantServicesMapper.insert();
}
}
@Override
public int updatePassword(SysUser sysUser) {
public int updateByPrimaryKeySelective(SysUser sysUser) {
return sysUserMapper.updateByPrimaryKeySelective(sysUser);
}
@Override
public List<SysOrganization> getUserOrg(int id) {
return null;
}
@Override
public int bindingService(SysResourceMatching sysResourceMatching, String serviceItem) {
return 0;
}
@Override
public SysUser getUserById(Integer id) {
return sysUserMapper.selectByPrimaryKey(id);
}
}
<?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.glsx.usercenter.mapper.SysResourceMatchingMapper">
<resultMap id="BaseResultMap" type="com.glsx.manager.pojo.SysResourceMatching">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="merchant_id" jdbcType="INTEGER" property="merchantId" />
<result column="user_id" jdbcType="INTEGER" property="userId" />
<result column="service_id" jdbcType="INTEGER" property="serviceId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, merchant_id, user_id, service_id
</sql>
<select id="selectByExample" parameterType="com.glsx.manager.pojo.SysResourceMatchingExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
'false' as QUERYID,
<include refid="Base_Column_List" />
from sys_resource_matching
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from sys_resource_matching
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from sys_resource_matching
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.manager.pojo.SysResourceMatchingExample">
delete from sys_resource_matching
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.glsx.manager.pojo.SysResourceMatching">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_resource_matching (merchant_id, user_id, service_id
)
values (#{merchantId,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{serviceId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.manager.pojo.SysResourceMatching">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_resource_matching
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="merchantId != null">
merchant_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="serviceId != null">
service_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="merchantId != null">
#{merchantId,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="serviceId != null">
#{serviceId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.manager.pojo.SysResourceMatchingExample" resultType="java.lang.Long">
select count(*) from sys_resource_matching
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_resource_matching
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.merchantId != null">
merchant_id = #{record.merchantId,jdbcType=INTEGER},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=INTEGER},
</if>
<if test="record.serviceId != null">
service_id = #{record.serviceId,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_resource_matching
set id = #{record.id,jdbcType=INTEGER},
merchant_id = #{record.merchantId,jdbcType=INTEGER},
user_id = #{record.userId,jdbcType=INTEGER},
service_id = #{record.serviceId,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.manager.pojo.SysResourceMatching">
update sys_resource_matching
<set>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=INTEGER},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="serviceId != null">
service_id = #{serviceId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.manager.pojo.SysResourceMatching">
update sys_resource_matching
set merchant_id = #{merchantId,jdbcType=INTEGER},
user_id = #{userId,jdbcType=INTEGER},
service_id = #{serviceId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ 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.glsx.manager.mapper.SysRoleMapper">
<resultMap id="BaseResultMap" type="com.glsx.manager.pojo.role.SysRole">
<mapper namespace="com.glsx.usercenter.mapper.SysRoleMapper">
<resultMap id="BaseResultMap" type="com.glsx.usercenter.pojo.role.SysRole">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="permission_character" jdbcType="VARCHAR" property="permissionCharacter"/>
......@@ -77,7 +77,7 @@
id, name, permission_character, sort, role_remark, role_status, create_by,
create_time, update_by, update_time
</sql>
<select id="selectByExample" parameterType="com.glsx.manager.pojo.role.SysRoleExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
......@@ -102,13 +102,13 @@
DELETE FROM sys_role
WHERE id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.manager.pojo.role.SysRoleExample">
<delete id="deleteByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleExample">
delete from sys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.glsx.manager.pojo.role.SysRole">
<insert id="insert" parameterType="com.glsx.usercenter.pojo.role.SysRole">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
......@@ -121,7 +121,7 @@
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.manager.pojo.role.SysRole">
<insert id="insertSelective" parameterType="com.glsx.usercenter.pojo.role.SysRole">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
......@@ -185,7 +185,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.manager.pojo.role.SysRoleExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleExample" resultType="java.lang.Long">
select count(*) from sys_role
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
......@@ -245,7 +245,7 @@
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.manager.pojo.role.SysRole">
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.usercenter.pojo.role.SysRole">
update sys_role
<set>
<if test="name != null">
......@@ -278,7 +278,7 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.manager.pojo.role.SysRole">
<update id="updateByPrimaryKey" parameterType="com.glsx.usercenter.pojo.role.SysRole">
UPDATE sys_role
SET role_name = #{name,jdbcType=VARCHAR},
permission_character = #{permissionCharacter,jdbcType=VARCHAR},
......
<?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.glsx.manager.mapper.SysRoleMenuMapper">
<resultMap id="BaseResultMap" type="com.glsx.manager.pojo.role.SysRoleMenu">
<mapper namespace="com.glsx.usercenter.mapper.SysRoleMenuMapper">
<resultMap id="BaseResultMap" type="com.glsx.usercenter.pojo.role.SysRoleMenu">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="role_id" jdbcType="INTEGER" property="roleId" />
<result column="menu_id" jdbcType="INTEGER" property="menuId" />
......@@ -67,7 +67,7 @@
<sql id="Base_Column_List">
id, role_id, menu_id
</sql>
<select id="selectByExample" parameterType="com.glsx.manager.pojo.role.SysRoleMenuExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenuExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
......@@ -92,20 +92,20 @@
delete from sys_role_menu
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.manager.pojo.role.SysRoleMenuExample">
<delete id="deleteByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenuExample">
delete from sys_role_menu
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.glsx.manager.pojo.role.SysRoleMenu">
<insert id="insert" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into sys_role_menu (role_id, menu_id)
values (#{roleId,jdbcType=INTEGER}, #{menuId,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.glsx.manager.pojo.role.SysRoleMenu">
<insert id="insertSelective" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
......@@ -127,7 +127,7 @@
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.manager.pojo.role.SysRoleMenuExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenuExample" resultType="java.lang.Long">
select count(*) from sys_role_menu
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
......@@ -159,7 +159,7 @@
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.manager.pojo.role.SysRoleMenu">
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu">
update sys_role_menu
<set>
<if test="roleId != null">
......@@ -171,7 +171,7 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.manager.pojo.role.SysRoleMenu">
<update id="updateByPrimaryKey" parameterType="com.glsx.usercenter.pojo.role.SysRoleMenu">
update sys_role_menu
set role_id = #{roleId,jdbcType=INTEGER},
menu_id = #{menuId,jdbcType=INTEGER}
......
<?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.glsx.manager.mapper.SysUserMapper">
<resultMap id="BaseResultMap" type="com.glsx.manager.pojo.user.SysUser">
<mapper namespace="com.glsx.usercenter.mapper.SysUserMapper">
<resultMap id="BaseResultMap" type="com.glsx.usercenter.pojo.user.SysUser">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="username" jdbcType="VARCHAR" property="username"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
......@@ -81,7 +81,7 @@
id, username, name, org_id, phone_number, user_status, create_by, create_time, update_by,
update_time, password, sex, remark
</sql>
<select id="selectByExample" parameterType="com.glsx.manager.pojo.user.SysUserExample" resultMap="BaseResultMap">
<select id="selectByExample" parameterType="com.glsx.usercenter.pojo.user.SysUserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
......@@ -106,13 +106,13 @@
DELETE FROM sys_user
WHERE id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.manager.pojo.user.SysUserExample">
<delete id="deleteByExample" parameterType="com.glsx.usercenter.pojo.user.SysUserExample">
delete from sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.glsx.manager.pojo.user.SysUser">
<insert id="insert" parameterType="com.glsx.usercenter.pojo.user.SysUser">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
......@@ -127,7 +127,7 @@
#{password,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.glsx.manager.pojo.user.SysUser">
<insert id="insertSelective" parameterType="com.glsx.usercenter.pojo.user.SysUser">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
......@@ -216,7 +216,7 @@
</trim>
</insert>
<insert id="insertManager" parameterType="com.glsx.manager.pojo.user.SysManager">
<insert id="insertManager" parameterType="com.glsx.usercenter.pojo.user.SysManager">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
......@@ -246,7 +246,7 @@
</insert>
<insert id="insertSysMerchant" parameterType="com.glsx.manager.pojo.user.SysMerchant">
<insert id="insertSysMerchant" parameterType="com.glsx.usercenter.pojo.user.SysMerchant">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
......@@ -288,7 +288,7 @@
</insert>
<insert id="insertSysMechanic" parameterType="com.glsx.manager.pojo.user.SysMechanic">
<insert id="insertSysMechanic" parameterType="com.glsx.usercenter.pojo.user.SysMechanic">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
......@@ -348,7 +348,7 @@
</insert>
<select id="countByExample" parameterType="com.glsx.manager.pojo.user.SysUserExample" resultType="java.lang.Long">
<select id="countByExample" parameterType="com.glsx.usercenter.pojo.user.SysUserExample" resultType="java.lang.Long">
select count(*) from sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
......@@ -422,7 +422,7 @@
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.manager.pojo.user.SysUser">
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.usercenter.pojo.user.SysUser">
update sys_user
<set>
<if test="username != null">
......@@ -466,20 +466,20 @@
</update>
<update id="updateManager" parameterType="com.glsx.manager.pojo.user.SysManager">
update sys_manager
<set>
<if test="mail != null">
mail = #{mail,jdbcType=VARCHAR},
</if>
<if test="occupation != null">
occupation = #{occupation,jdbcType=VARCHAR},
</if>
</set>
<update id="updateManager" parameterType="com.glsx.usercenter.pojo.user.SysManager">
update sys_manager
<set>
<if test="mail != null">
mail = #{mail,jdbcType=VARCHAR},
</if>
<if test="occupation != null">
occupation = #{occupation,jdbcType=VARCHAR},
</if>
</set>
where user_id = #{id,jdbcType=INTEGER}
</update>
<update id="updateSysMerchant" parameterType="com.glsx.manager.pojo.user.SysMerchant">
<update id="updateSysMerchant" parameterType="com.glsx.usercenter.pojo.user.SysMerchant">
update sys_merchant
<set>
<if test="district != null">
......@@ -499,7 +499,7 @@
</update>
<update id="updateSysMechanic" parameterType="com.glsx.manager.pojo.user.SysMechanic">
<update id="updateSysMechanic" parameterType="com.glsx.usercenter.pojo.user.SysMechanic">
update sys_merchant
<set>
<if test="district != null">
......@@ -528,7 +528,7 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.manager.pojo.user.SysUser">
<update id="updateByPrimaryKey" parameterType="com.glsx.usercenter.pojo.user.SysUser">
UPDATE sys_user
SET username = #{username,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
......@@ -545,8 +545,8 @@
WHERE id = #{id,jdbcType=INTEGER}
</update>
<select id="getAllUserList" parameterType="com.glsx.manager.pojo.vo.UserQueryVo"
resultType="com.glsx.manager.pojo.user.SysManager">
<select id="getAllUserList" parameterType="com.glsx.usercenter.pojo.vo.UserQueryVo"
resultType="com.glsx.usercenter.pojo.user.SysManager">
SELECT
u.id,
username,
......@@ -591,8 +591,8 @@
ORDER BY u.id DESC
</select>
<select id="getSysMerchantList" parameterType="com.glsx.manager.pojo.vo.UserQueryVo"
resultType="com.glsx.manager.pojo.user.SysMerchant">
<select id="getSysMerchantList" parameterType="com.glsx.usercenter.pojo.vo.UserQueryVo"
resultType="com.glsx.usercenter.pojo.user.SysMerchant">
SELECT
u.id,
u.org_id orgId,
......@@ -603,7 +603,8 @@
phone_number phoneNumber,
sm.district district,
sm.address address,
sdd.data_value dataValue
sdd.data_value dataValue,
sm.merchant_status
FROM
sys_user_org uo
LEFT JOIN sys_user u ON uo.org_id = u.org_id
......@@ -633,20 +634,46 @@
and u.phone_number like #{phoneNumber,jdbcType=VARCHAR}
</if>
<choose>
<when test="userStatus != null">
and u.user_status = #{userStatus,jdbcType=TINYINT}
</when>
<otherwise>
and u.user_status &lt;&gt; 2
</otherwise>
</choose>
<if test="listType == 2">
<choose>
<when test="userStatus != null">
and u.user_status = #{userStatus,jdbcType=TINYINT}
</when>
<otherwise>
and u.user_status IN (0,1)
</otherwise>
</choose>
</if>
<if test="listType == 3">
<choose>
<when test="userStatus != null">
and u.user_status = #{userStatus,jdbcType=TINYINT}
</when>
<otherwise>
and u.user_status IN (1)
and sm.merchant_status IN (1,2,3)
</otherwise>
</choose>
</if>
<if test="listType == 4">
<choose>
<when test="userStatus != null">
and u.user_status = #{userStatus,jdbcType=TINYINT}
</when>
<otherwise>
and u.user_status IN (1)
and sm.merchant_status IN (2,3)
</otherwise>
</choose>
</if>
ORDER BY u.id DESC
</select>
<select id="getSysMechanicList" parameterType="com.glsx.manager.pojo.vo.UserQueryVo"
resultType="com.glsx.manager.pojo.user.SysMechanic">
<select id="getSysMechanicList" parameterType="com.glsx.usercenter.pojo.vo.UserQueryVo"
resultType="com.glsx.usercenter.pojo.user.SysMechanic">
SELECT
u.id,
u.org_id orgId,
......@@ -658,7 +685,8 @@
u.create_time createTime,
GROUP_CONCAT(sdd.data_value SEPARATOR '/') dataValue,
sm.service_type serviceType,
sm.IDCard
sm.IDCard,
sm.mechanic_status mechanicStatus
FROM
sys_user_org uo
LEFT JOIN sys_user u ON uo.org_id = u.org_id
......@@ -693,7 +721,7 @@
</choose>
</if>
<if test="listType == 2">
<if test="listType == 1">
<choose>
<when test="userStatus != null">
and u.user_status = #{userStatus,jdbcType=TINYINT}
......
<?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.glsx.manager.mapper.SysUserOrgMapper">
<resultMap id="BaseResultMap" type="com.glsx.manager.pojo.user.SysUserOrg">
<mapper namespace="com.glsx.usercenter.mapper.SysUserOrgMapper">
<resultMap id="BaseResultMap" type="com.glsx.usercenter.pojo.user.SysUserOrg">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="user_id" jdbcType="INTEGER" property="userId"/>
<result column="org_id" jdbcType="INTEGER" property="org_id"/>
......@@ -19,13 +19,13 @@
DELETE FROM sys_user_org
WHERE id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.manager.pojo.user.SysUserOrg">
<insert id="insert" parameterType="com.glsx.usercenter.pojo.user.SysUserOrg">
INSERT INTO sys_user_org (id, user_id, org_id
)
VALUES (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{orgId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.manager.pojo.user.SysUserOrg">
<insert id="insertSelective" parameterType="com.glsx.usercenter.pojo.user.SysUserOrg">
insert into sys_user_org
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -50,7 +50,7 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.manager.pojo.user.SysUserOrg">
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.usercenter.pojo.user.SysUserOrg">
update sys_user_org
<set>
<if test="userId != null">
......@@ -62,7 +62,7 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.manager.pojo.user.SysUserOrg">
<update id="updateByPrimaryKey" parameterType="com.glsx.usercenter.pojo.user.SysUserOrg">
UPDATE sys_user_org
SET user_id = #{userId,jdbcType=INTEGER},
org_id = #{orgId,jdbcType=INTEGER}
......@@ -79,7 +79,7 @@
WHERE user_id = #{userId,jdbcType=INTEGER}
</delete>
<select id="getOrgByUserId" parameterType="java.lang.Integer" resultType="com.glsx.manager.pojo.user.SysUserOrg">
<select id="getOrgByUserId" parameterType="java.lang.Integer" resultType="com.glsx.usercenter.pojo.user.SysUserOrg">
SELECT
so.id orgId,
so.name orgName
......
<?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.glsx.manager.mapper.SysUserRoleMapper">
<resultMap id="BaseResultMap" type="com.glsx.manager.pojo.user.SysUserRole">
<mapper namespace="com.glsx.usercenter.mapper.SysUserRoleMapper">
<resultMap id="BaseResultMap" type="com.glsx.usercenter.pojo.user.SysUserRole">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="user_id" jdbcType="INTEGER" property="userId"/>
<result column="role_id" jdbcType="INTEGER" property="roleId"/>
......@@ -19,13 +19,13 @@
DELETE FROM sys_user_role
WHERE id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.manager.pojo.user.SysUserRole">
<insert id="insert" parameterType="com.glsx.usercenter.pojo.user.SysUserRole">
INSERT INTO sys_user_role (id, user_id, role_id
)
VALUES (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{roleId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.manager.pojo.user.SysUserRole">
<insert id="insertSelective" parameterType="com.glsx.usercenter.pojo.user.SysUserRole">
insert into sys_user_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
......@@ -50,7 +50,7 @@
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.manager.pojo.user.SysUserRole">
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.usercenter.pojo.user.SysUserRole">
update sys_user_role
<set>
<if test="userId != null">
......@@ -62,7 +62,7 @@
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.manager.pojo.user.SysUserRole">
<update id="updateByPrimaryKey" parameterType="com.glsx.usercenter.pojo.user.SysUserRole">
UPDATE sys_user_role
SET user_id = #{userId,jdbcType=INTEGER},
role_id = #{roleId,jdbcType=INTEGER}
......@@ -79,7 +79,7 @@
WHERE user_id = #{userId,jdbcType=INTEGER}
</delete>
<select id="getRoleByUserId" parameterType="java.lang.Integer" resultType="com.glsx.manager.pojo.user.SysUserRole">
<select id="getRoleByUserId" parameterType="java.lang.Integer" resultType="com.glsx.usercenter.pojo.user.SysUserRole">
SELECT
sr.id roleId,
sr.name roleName
......
<?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.glsx.usercenter.mapper.SysUserServicesMapper">
<resultMap id="BaseResultMap" type="com.glsx.usercenter.pojo.user.SysUserServices">
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="user_id" jdbcType="INTEGER" property="userId"/>
<result column="service_id" jdbcType="INTEGER" property="service_id"/>
</resultMap>
<sql id="Base_Column_List">
id, user_id, service_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from sys_user_services
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
DELETE FROM sys_user_services
WHERE id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.glsx.usercenter.pojo.user.SysUserServices">
INSERT INTO sys_user_services (id, user_id, service_id
)
VALUES (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{serviceId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.glsx.usercenter.pojo.user.SysUserServices">
insert into sys_user_services
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="serviceId != null">
service_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="userId != null">
#{userId,jdbcType=INTEGER},
</if>
<if test="serviceId != null">
#{serviceId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.usercenter.pojo.user.SysUserServices">
update sys_user_services
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=INTEGER},
</if>
<if test="serviceId != null">
service_id = #{serviceId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.usercenter.pojo.user.SysUserServices">
UPDATE sys_user_services
SET user_id = #{userId,jdbcType=INTEGER},
service_id = #{serviceId,jdbcType=INTEGER}
WHERE id = #{id,jdbcType=INTEGER}
</update>
<delete id="deleteByUserId" parameterType="java.lang.Integer">
DELETE FROM sys_user_services
WHERE user_id = #{userId,jdbcType=INTEGER}
</delete>
<!--<select id="getOrgByUserId" parameterType="java.lang.Integer" resultTySysUserServicesices">-->
<!--SELECT-->
<!--so.id serviceId,-->
<!--so.name orgName-->
<!--FROM sys_user su LEFT JOIN sys_user_services suo ON su.id = suo.user_id-->
<!--LEFT JOIN sys_organization so ON suo.service_id = so.id-->
<!--WHERE su.id = #{id,jdbcType=TINYINT}-->
<!--</select>-->
</mapper>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!