Browse Source

修改配置

mssql
LYM 3 years ago
parent
commit
ed172f9ab7
  1. 18
      pom.xml
  2. 4
      src/main/java/com/qs/serve/modules/sys/entity/SysUser.java
  3. 4
      src/main/java/com/qs/serve/modules/sys/mapper/SysMenuMapper.java
  4. 10
      src/main/resources/application-dev.yml
  5. 3
      src/main/resources/application.yml
  6. 28
      src/main/resources/mapper/sys/SysDeptMapper.xml
  7. 70
      src/main/resources/mapper/sys/SysOperationLogMapper.xml
  8. 180
      src/main/resources/mapper/sys/SysUserMapper.xml

18
pom.xml

@ -131,18 +131,18 @@
<version>${mybatis-plus.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.microsoft.sqlserver</groupId>-->
<!-- <artifactId>mssql-jdbc</artifactId>-->
<!-- <version>6.4.0.jre8</version>-->
<!-- <groupId>mysql</groupId>-->
<!-- <artifactId>mysql-connector-java</artifactId>-->
<!-- <version>8.0.15</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>8.4.1.jre8</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>

4
src/main/java/com/qs/serve/modules/sys/entity/SysUser.java

@ -127,8 +127,8 @@ public class SysUser implements Serializable {
private String nation;
/** 民族 */
@Length(max = 20,message = "民族长度不能超过20字")
private String national;
// @Length(max = 20,message = "民族长度不能超过20字")
// private String national;
/** 籍贯 */
@Length(max = 45,message = "籍贯长度不能超过45字")

4
src/main/java/com/qs/serve/modules/sys/mapper/SysMenuMapper.java

@ -21,7 +21,7 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
*/
@Select("select distinct srm.menu_id from sys_user_role sur " +
" LEFT JOIN sys_role_menu srm ON sur.role_id = srm.role_id WHERE sur.user_id = #{userId}" +
" and srm.menu_id is not null and sur.del_flag = b'0' and srm.del_flag = b'0'")
" and srm.menu_id is not null and sur.del_flag = b'0' and srm.del_flag = '0'")
List<String> searchUserMenuIds(@Param("userId") String userId);
/**
@ -35,7 +35,7 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
* 查询所有菜单ID
* @return
*/
@Select("select id from sys_menu where del_flag = b'0'")
@Select("select id from sys_menu where del_flag = '0'")
List<String> searchMenuIds();
}

10
src/main/resources/application-dev.yml

@ -6,12 +6,12 @@ server:
#SpringBoot相关
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
#driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:mysql://192.168.0.9:3333/qs-base-questionnaire?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
#driver-class-name: com.mysql.cj.jdbc.Driver
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://192.168.0.8:1433;DatabaseName=JSL_QMS
#url: jdbc:mysql://192.168.0.9:3333/qs-base-questionnaire?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username: root
password: 123456
username: sa
password: 123456Aa
redis:
database: 4
host: 127.0.0.1

3
src/main/resources/application.yml

@ -63,7 +63,8 @@ logging:
# PageHelper分页插件
pagehelper:
reasonable: false
autoRuntimeDialect: true
helper-dialect: sqlserver
# autoRuntimeDialect: true
supportMethodsArguments: true
params: count=countSql

28
src/main/resources/mapper/sys/SysDeptMapper.xml

@ -19,31 +19,31 @@
</resultMap>
<sql id="sysDeptSql">
sys_dept.`id`,
sys_dept.`name`,
sys_dept.`code`,
sys_dept.`parent_id`,
sys_dept.`mgr_user_id`,
sys_dept.`level_path`,
sys_dept.`create_time`,
sys_dept.`create_by`,
sys_dept.`update_time`,
sys_dept.`update_by`
sys_dept.id,
sys_dept.name,
sys_dept.code,
sys_dept.parent_id,
sys_dept.mgr_user_id,
sys_dept.level_path,
sys_dept.create_time,
sys_dept.create_by,
sys_dept.update_time,
sys_dept.update_by
</sql>
<select id="listDept" resultType="com.qs.serve.modules.sys.entity.SysDept" resultMap="sysDeptMap">
SELECT
<include refid="sysDeptSql"/>,
sur.`name` as mgr_user_name
FROM sys_dept `sys_dept`
sur.name as mgr_user_name
FROM sys_dept sys_dept
LEFT JOIN sys_user sur
ON sys_dept.`mgr_user_id` = sur.id
ON sys_dept.mgr_user_id = sur.id
<where>
<if test="id != null and id != ''"> and id = #{id}</if>
<if test="code != null and code != ''"> and code = #{code}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
and `sys_dept`.`del_flag` = b'0'
and sys_dept.del_flag = '0'
</where>
</select>

70
src/main/resources/mapper/sys/SysOperationLogMapper.xml

@ -31,52 +31,52 @@
</resultMap>
<sql id="sysOperationLogSql">
`sys_operation_log`.`id`,
`sys_operation_log`.`title`,
`sys_operation_log`.`biz_type`,
`sys_operation_log`.`inter_type`,
`sys_operation_log`.`code_method`,
`sys_operation_log`.`req_method`,
`sys_operation_log`.`req_url`,
`sys_operation_log`.`req_param`,
`sys_operation_log`.`req_ip`,
`sys_operation_log`.`user_type`,
`sys_operation_log`.`user_id`,
`sys_operation_log`.`err_msg`,
`sys_operation_log`.`json_result`,
`sys_operation_log`.`elapsed_time`,
`sys_operation_log`.`user_agent`,
`sys_operation_log`.`create_time`,
`sys_operation_log`.`create_by`,
`sys_operation_log`.`update_time`,
`sys_operation_log`.`update_by`
sys_operation_log.id,
sys_operation_log.title,
sys_operation_log.biz_type,
sys_operation_log.inter_type,
sys_operation_log.code_method,
sys_operation_log.req_method,
sys_operation_log.req_url,
sys_operation_log.req_param,
sys_operation_log.req_ip,
sys_operation_log.user_type,
sys_operation_log.user_id,
sys_operation_log.err_msg,
sys_operation_log.json_result,
sys_operation_log.elapsed_time,
sys_operation_log.user_agent,
sys_operation_log.create_time,
sys_operation_log.create_by,
sys_operation_log.update_time,
sys_operation_log.update_by
</sql>
<insert id="saveLog" parameterType="com.qs.serve.modules.sys.entity.SysOperationLog">
INSERT INTO `sys_operation_log`
(`title`, `biz_type`, `inter_type`, `code_method`, `req_method`, `req_url`, `req_param`, `req_ip`, `user_type`, `user_id`,
`err_msg`, `json_result`, `elapsed_time`, `user_agent`, `create_time`, `create_by`, `tenant_id`,creator_name)
INSERT INTO sys_operation_log
(title, biz_type, inter_type, code_method, req_method, req_url, req_param, req_ip, user_type, user_id,
err_msg, json_result, elapsed_time, user_agent, create_time, create_by, tenant_id,creator_name)
VALUES
( #{title}, #{bizType}, #{interType}, #{codeMethod}, #{reqMethod}, #{reqUrl}, #{reqParam}, #{reqIp}, #{userType}, #{userId},
#{errMsg}, #{jsonResult}, #{elapsedTime}, #{userAgent}, now(), #{userId}, #{tenantId},#{creatorName});
#{errMsg}, #{jsonResult}, #{elapsedTime}, #{userAgent}, getdate(), #{userId}, #{tenantId},#{creatorName});
</insert>
<select id="selectSysOperationLogList" parameterType="com.qs.serve.modules.sys.entity.SysOperationLog" resultMap="sysOperationLogMap">
SELECT
<include refid="sysOperationLogSql"/>
FROM `sys_operation_log`
FROM sys_operation_log
<where>
and `sys_operation_log`.`del_flag` = b'0'
<if test="title != null and title != ''"> and `title` = #{title}</if>
<if test="bizType != null and bizType != ''"> and `biz_type` = #{bizType}</if>
<if test="interType != null and interType != ''"> and `inter_type` = #{interType}</if>
<if test="reqMethod != null and reqMethod != ''"> and `req_method` = #{reqMethod}</if>
<if test="userType != null and userType != ''"> and `user_type` = #{userType}</if>
<if test="userId != null and userId != ''"> and `user_id` = #{userId}</if>
<if test="jsonResult != null and jsonResult != ''"> and `json_result` = #{jsonResult}</if>
<if test="elapsedTime != null"> and `elapsed_time` = #{elapsedTime}</if>
<if test="createBy != null and createBy != ''"> and `create_by` = #{createBy}</if>
<if test="updateBy != null and updateBy != ''"> and `update_by` = #{updateBy}</if>
and sys_operation_log.del_flag = b'0'
<if test="title != null and title != ''"> and title = #{title}</if>
<if test="bizType != null and bizType != ''"> and biz_type = #{bizType}</if>
<if test="interType != null and interType != ''"> and inter_type = #{interType}</if>
<if test="reqMethod != null and reqMethod != ''"> and req_method = #{reqMethod}</if>
<if test="userType != null and userType != ''"> and user_type = #{userType}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="jsonResult != null and jsonResult != ''"> and json_result = #{jsonResult}</if>
<if test="elapsedTime != null"> and elapsed_time = #{elapsedTime}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="updateBy != null and updateBy != ''"> and update_by = #{updateBy}</if>
</where>
</select>

180
src/main/resources/mapper/sys/SysUserMapper.xml

@ -28,7 +28,7 @@
<result property="localType" column="local_type"/>
<result property="houseType" column="house_type"/>
<result property="nation" column="nation"/>
<result property="national" column="national"/>
<!-- <result property="national" column="national"/>-->
<result property="nativePlace" column="native_place"/>
<result property="nativeAddress" column="native_address"/>
<result property="currAddress" column="curr_address"/>
@ -50,101 +50,101 @@
</resultMap>
<sql id="sysUserSql">
sys_user.`id`,
sys_user.`mobile`,
sys_user.`account`,
sys_user.`name`,
sys_user.`code`,
sys_user.`password`,
sys_user.`icon`,
sys_user.`dept_id`,
sys_user.`position_id`,
sys_user.`super_flag`,
sys_user.`login_enable`,
sys_user.`serving_state`,
sys_user.`identity_no`,
sys_user.`enter_date`,
sys_user.`formal_date`,
sys_user.`formal_status`,
sys_user.`remark`,
sys_user.`emer_name`,
sys_user.`emer_relate`,
sys_user.`emer_mobile`,
sys_user.`emer_worksapce`,
sys_user.`emer_address`,
sys_user.`local_type`,
sys_user.`house_type`,
sys_user.`nation`,
sys_user.`national`,
sys_user.`native_place`,
sys_user.`native_address`,
sys_user.`curr_address`,
sys_user.`politics_status`,
sys_user.`married_flag`,
sys_user.`gender`,
sys_user.`birthday`,
sys_user.`edu_school`,
sys_user.`edu_level`,
sys_user.`edu_profession`,
sys_user.`app_client`,
sys_user.`app_token`,
sys_user.`create_time`,
sys_user.`create_by`,
sys_user.`update_time`,
sys_user.`update_by`,
sys_user.`del_flag`,
sys_user.`tenant_id` </sql>
sys_user.id,
sys_user.mobile,
sys_user.account,
sys_user.name,
sys_user.code,
sys_user.password,
sys_user.icon,
sys_user.dept_id,
sys_user.position_id,
sys_user.super_flag,
sys_user.login_enable,
sys_user.serving_state,
sys_user.identity_no,
sys_user.enter_date,
sys_user.formal_date,
sys_user.formal_status,
sys_user.remark,
sys_user.emer_name,
sys_user.emer_relate,
sys_user.emer_mobile,
sys_user.emer_worksapce,
sys_user.emer_address,
sys_user.local_type,
sys_user.house_type,
sys_user.nation,
<!-- sys_user.national,-->
sys_user.native_place,
sys_user.native_address,
sys_user.curr_address,
sys_user.politics_status,
sys_user.married_flag,
sys_user.gender,
sys_user.birthday,
sys_user.edu_school,
sys_user.edu_level,
sys_user.edu_profession,
sys_user.app_client,
sys_user.app_token,
sys_user.create_time,
sys_user.create_by,
sys_user.update_time,
sys_user.update_by,
sys_user.del_flag,
sys_user.tenant_id </sql>
<select id="listUser" parameterType="com.qs.serve.modules.sys.entity.SysUser" resultMap="sysUserMap">
SELECT <include refid="sysUserSql"/> FROM `sys_user` `sys_user`
SELECT <include refid="sysUserSql"/> FROM sys_user sys_user
<if test="query.roleIds!=null and query.roleIds.size > 0">
left join sys_user_role sys_user_role ON sys_user_role.user_id = sys_user.id
</if>
<where>
<if test="query.id != null and query.id != ''"> and `sys_user`.`id` = #{query.id}</if>
<if test="query.mobile != null and query.mobile != ''"> and `sys_user`.`mobile` = #{query.mobile}</if>
<if test="query.account != null and query.account != ''"> and `sys_user`.`account` = #{query.account}</if>
<if test="query.name != null and query.name != ''"> and `sys_user`.`name` = #{query.name}</if>
<if test="query.code != null and query.code != ''"> and `sys_user`.`code` = #{query.code}</if>
<if test="query.password != null and query.password != ''"> and `sys_user`.`password` = #{query.password}</if>
<if test="query.icon != null and query.icon != ''"> and `sys_user`.`icon` = #{query.icon}</if>
<if test="query.deptId != null and query.deptId != ''"> and `sys_user`.`dept_id` = #{query.deptId}</if>
<if test="query.positionId != null and query.positionId != ''"> and `sys_user`.`position_id` = #{query.positionId}</if>
<if test="query.superFlag != null"> and `sys_user`.`super_flag` = #{query.superFlag}</if>
<if test="query.loginEnable != null"> and `sys_user`.`login_enable` = #{query.loginEnable}</if>
<if test="query.servingState != null"> and `sys_user`.`serving_state` = #{query.servingState}</if>
<if test="query.identityNo != null and query.identityNo != ''"> and `sys_user`.`identity_no` = #{query.identityNo}</if>
<if test="query.enterDate != null"> and `sys_user`.`enter_date` = #{query.enterDate}</if>
<if test="query.formalDate != null"> and `sys_user`.`formal_date` = #{query.formalDate}</if>
<if test="query.formalStatus != null"> and `sys_user`.`formal_status` = #{query.formalStatus}</if>
<if test="query.remark != null and query.remark != ''"> and `sys_user`.`remark` = #{query.remark}</if>
<if test="query.emerName != null and query.emerName != ''"> and `sys_user`.`emer_name` = #{query.emerName}</if>
<if test="query.emerRelate != null and query.emerRelate != ''"> and `sys_user`.`emer_relate` = #{query.emerRelate}</if>
<if test="query.emerWorksapce != null and query.emerWorksapce != ''"> and `sys_user`.`emer_worksapce` = #{query.emerWorksapce}</if>
<if test="query.emerAddress != null and query.emerAddress != ''"> and `sys_user`.`emer_address` = #{query.emerAddress}</if>
<if test="query.localType != null"> and `sys_user`.`local_type` = #{query.localType}</if>
<if test="query.houseType != null"> and `sys_user`.`house_type` = #{query.houseType}</if>
<if test="query.nation != null and query.nation != ''"> and `sys_user`.`nation` = #{query.nation}</if>
<if test="query.national != null and query.national != ''"> and `sys_user`.`national` = #{query.national}</if>
<if test="query.nativePlace != null and query.nativePlace != ''"> and `sys_user`.`native_place` = #{query.nativePlace}</if>
<if test="query.nativeAddress != null and query.nativeAddress != ''"> and `sys_user`.`native_address` = #{query.nativeAddress}</if>
<if test="query.currAddress != null and query.currAddress != ''"> and `sys_user`.`curr_address` = #{query.currAddress}</if>
<if test="query.politicsStatus != null and query.politicsStatus != ''"> and `sys_user`.`politics_status` = #{query.politicsStatus}</if>
<if test="query.marriedFlag != null"> and `sys_user`.`married_flag` = #{query.marriedFlag}</if>
<if test="query.gender != null"> and `sys_user`.`gender` = #{query.gender}</if>
<if test="query.birthday != null"> and `sys_user`.`birthday` = #{query.birthday}</if>
<if test="query.eduSchool != null and query.eduSchool != ''"> and `sys_user`.`edu_school` = #{query.eduSchool}</if>
<if test="query.eduLevel != null"> and `sys_user`.`edu_level` = #{query.eduLevel}</if>
<if test="query.eduProfession != null and query.eduProfession != ''"> and `sys_user`.`edu_profession` = #{query.eduProfession}</if>
<if test="query.appClient != null and query.appClient != ''"> and `sys_user`.`app_client` = #{query.appClient}</if>
<if test="query.appToken != null and query.appToken != ''"> and `sys_user`.`app_token` = #{query.appToken}</if>
<if test="query.createTime != null"> and `sys_user`.`create_time` = #{query.createTime}</if>
<if test="query.createBy != null and query.createBy != ''"> and `sys_user`.`create_by` = #{query.createBy}</if>
<if test="query.updateTime != null"> and `sys_user`.`update_time` = #{query.updateTime}</if>
<if test="query.updateBy != null and query.updateBy != ''"> and `sys_user`.`update_by` = #{query.updateBy}</if>
<if test="query.delFlag != null"> and `sys_user`.`del_flag` = #{query.delFlag}</if>
<if test="query.tenantId != null and query.tenantId != ''"> and `sys_user`.`tenant_id` = #{query.tenantId}</if>
<if test="query.multiDeptIds != null and query.multiDeptIds.size > 0 "> and `sys_user`.dept_id in
<if test="query.id != null and query.id != ''"> and sys_user.id = #{query.id}</if>
<if test="query.mobile != null and query.mobile != ''"> and sys_user.mobile = #{query.mobile}</if>
<if test="query.account != null and query.account != ''"> and sys_user.account = #{query.account}</if>
<if test="query.name != null and query.name != ''"> and sys_user.name = #{query.name}</if>
<if test="query.code != null and query.code != ''"> and sys_user.code = #{query.code}</if>
<if test="query.password != null and query.password != ''"> and sys_user.password = #{query.password}</if>
<if test="query.icon != null and query.icon != ''"> and sys_user.icon = #{query.icon}</if>
<if test="query.deptId != null and query.deptId != ''"> and sys_user.dept_id = #{query.deptId}</if>
<if test="query.positionId != null and query.positionId != ''"> and sys_user.position_id = #{query.positionId}</if>
<if test="query.superFlag != null"> and sys_user.super_flag = #{query.superFlag}</if>
<if test="query.loginEnable != null"> and sys_user.login_enable = #{query.loginEnable}</if>
<if test="query.servingState != null"> and sys_user.serving_state = #{query.servingState}</if>
<if test="query.identityNo != null and query.identityNo != ''"> and sys_user.identity_no = #{query.identityNo}</if>
<if test="query.enterDate != null"> and sys_user.enter_date = #{query.enterDate}</if>
<if test="query.formalDate != null"> and sys_user.formal_date = #{query.formalDate}</if>
<if test="query.formalStatus != null"> and sys_user.formal_status = #{query.formalStatus}</if>
<if test="query.remark != null and query.remark != ''"> and sys_user.remark = #{query.remark}</if>
<if test="query.emerName != null and query.emerName != ''"> and sys_user.emer_name = #{query.emerName}</if>
<if test="query.emerRelate != null and query.emerRelate != ''"> and sys_user.emer_relate = #{query.emerRelate}</if>
<if test="query.emerWorksapce != null and query.emerWorksapce != ''"> and sys_user.emer_worksapce = #{query.emerWorksapce}</if>
<if test="query.emerAddress != null and query.emerAddress != ''"> and sys_user.emer_address = #{query.emerAddress}</if>
<if test="query.localType != null"> and sys_user.local_type = #{query.localType}</if>
<if test="query.houseType != null"> and sys_user.house_type = #{query.houseType}</if>
<if test="query.nation != null and query.nation != ''"> and sys_user.nation = #{query.nation}</if>
<!-- <if test="query.national != null and query.national != ''"> and sys_user.national = #{query.national}</if>-->
<if test="query.nativePlace != null and query.nativePlace != ''"> and sys_user.native_place = #{query.nativePlace}</if>
<if test="query.nativeAddress != null and query.nativeAddress != ''"> and sys_user.native_address = #{query.nativeAddress}</if>
<if test="query.currAddress != null and query.currAddress != ''"> and sys_user.curr_address = #{query.currAddress}</if>
<if test="query.politicsStatus != null and query.politicsStatus != ''"> and sys_user.politics_status = #{query.politicsStatus}</if>
<if test="query.marriedFlag != null"> and sys_user.married_flag = #{query.marriedFlag}</if>
<if test="query.gender != null"> and sys_user.gender = #{query.gender}</if>
<if test="query.birthday != null"> and sys_user.birthday = #{query.birthday}</if>
<if test="query.eduSchool != null and query.eduSchool != ''"> and sys_user.edu_school = #{query.eduSchool}</if>
<if test="query.eduLevel != null"> and sys_user.edu_level = #{query.eduLevel}</if>
<if test="query.eduProfession != null and query.eduProfession != ''"> and sys_user.edu_profession = #{query.eduProfession}</if>
<if test="query.appClient != null and query.appClient != ''"> and sys_user.app_client = #{query.appClient}</if>
<if test="query.appToken != null and query.appToken != ''"> and sys_user.app_token = #{query.appToken}</if>
<if test="query.createTime != null"> and sys_user.create_time = #{query.createTime}</if>
<if test="query.createBy != null and query.createBy != ''"> and sys_user.create_by = #{query.createBy}</if>
<if test="query.updateTime != null"> and sys_user.update_time = #{query.updateTime}</if>
<if test="query.updateBy != null and query.updateBy != ''"> and sys_user.update_by = #{query.updateBy}</if>
<if test="query.delFlag != null"> and sys_user.del_flag = #{query.delFlag}</if>
<if test="query.tenantId != null and query.tenantId != ''"> and sys_user.tenant_id = #{query.tenantId}</if>
<if test="query.multiDeptIds != null and query.multiDeptIds.size > 0 "> and sys_user.dept_id in
<foreach collection="query.multiDeptIds" item ="muDeptId" index="i" open="(" close=")" separator=",">
#{muDeptId}
</foreach>

Loading…
Cancel
Save