Commit 64f94cb0 by 袁伟铭

修改注册中心配置

parent f2c03295
...@@ -12,6 +12,7 @@ spring: ...@@ -12,6 +12,7 @@ spring:
eureka: eureka:
instance: instance:
prefer-ip-address: true prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client: client:
service-url: service-url:
defaultZone: http://admin:123456@127.0.0.1:8800/eureka/ defaultZone: http://admin:123456@127.0.0.1:8800/eureka/
......
package com.zq.portal.config; package com.zq.common.config.mybatis;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.github.pagehelper.PageInterceptor; import com.github.pagehelper.PageInterceptor;
...@@ -22,7 +21,7 @@ public class MybatisConfig { ...@@ -22,7 +21,7 @@ public class MybatisConfig {
@Bean @Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() { public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
return interceptor; return interceptor;
} }
...@@ -35,7 +34,13 @@ public class MybatisConfig { ...@@ -35,7 +34,13 @@ public class MybatisConfig {
public PageInterceptor pageInterceptor() { public PageInterceptor pageInterceptor() {
PageInterceptor pageInterceptor = new PageInterceptor(); PageInterceptor pageInterceptor = new PageInterceptor();
Properties properties = new Properties(); Properties properties = new Properties();
properties.put("helperDialect", "mysql"); properties.setProperty("offsetAsPageNum", "false");
properties.setProperty("rowBoundsWithCount", "false");
properties.setProperty("pageSizeZero", "true");
properties.setProperty("reasonable", "false");
properties.setProperty("supportMethodsArguments", "false");
properties.setProperty("returnPageInfo", "none");
properties.setProperty("autoRuntimeDialect", "true");
pageInterceptor.setProperties(properties); pageInterceptor.setProperties(properties);
return pageInterceptor; return pageInterceptor;
} }
......
...@@ -18,6 +18,7 @@ spring: ...@@ -18,6 +18,7 @@ spring:
eureka: eureka:
instance: instance:
prefer-ip-address: true prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client: client:
service-url: service-url:
defaultZone: http://admin:123456@127.0.0.1:8800/eureka/ defaultZone: http://admin:123456@127.0.0.1:8800/eureka/
......
...@@ -12,6 +12,7 @@ spring: ...@@ -12,6 +12,7 @@ spring:
eureka: eureka:
instance: instance:
prefer-ip-address: true prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client: client:
service-url: service-url:
defaultZone: http://admin:123456@127.0.0.1:8800/eureka/ defaultZone: http://admin:123456@127.0.0.1:8800/eureka/
...@@ -12,6 +12,7 @@ spring: ...@@ -12,6 +12,7 @@ spring:
eureka: eureka:
instance: instance:
prefer-ip-address: true prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client: client:
service-url: service-url:
defaultZone: http://admin:123456@127.0.0.1:8800/eureka/ defaultZone: http://admin:123456@127.0.0.1:8800/eureka/
...@@ -12,6 +12,7 @@ spring: ...@@ -12,6 +12,7 @@ spring:
eureka: eureka:
instance: instance:
prefer-ip-address: true prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client: client:
service-url: service-url:
defaultZone: http://admin:123456@127.0.0.1:8800/eureka/ defaultZone: http://admin:123456@127.0.0.1:8800/eureka/
package com.zq.resource.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.github.pagehelper.PageInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
* @author wilmiam
* @since 2021-08-09 15:59
*/
@Configuration
public class MybatisConfig {
/**
* MybatisPlus分页插件
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.ORACLE_12C));
return interceptor;
}
/**
* PageHelper分页插件
*
* @return
*/
@Bean
public PageInterceptor pageInterceptor() {
PageInterceptor pageInterceptor = new PageInterceptor();
Properties properties = new Properties();
properties.put("helperDialect", "oracle");
pageInterceptor.setProperties(properties);
return pageInterceptor;
}
}
...@@ -2,8 +2,11 @@ package com.zq.resource.dao; ...@@ -2,8 +2,11 @@ package com.zq.resource.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.resource.entity.OrgDept; import com.zq.resource.entity.OrgDept;
import com.zq.resource.vo.OrgDeptFindVo;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.List;
/** /**
* 机构表(OrgDept)表数据库访问层 * 机构表(OrgDept)表数据库访问层
* *
...@@ -13,4 +16,6 @@ import org.springframework.stereotype.Repository; ...@@ -13,4 +16,6 @@ import org.springframework.stereotype.Repository;
@Repository @Repository
public interface OrgDeptDao extends BaseMapper<OrgDept> { public interface OrgDeptDao extends BaseMapper<OrgDept> {
List<OrgDept> queryPageList(OrgDeptFindVo vo);
} }
...@@ -12,6 +12,7 @@ spring: ...@@ -12,6 +12,7 @@ spring:
eureka: eureka:
instance: instance:
prefer-ip-address: true prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client: client:
service-url: service-url:
defaultZone: http://admin:123456@127.0.0.1:8800/eureka/ defaultZone: http://admin:123456@127.0.0.1:8800/eureka/
<?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.zq.resource.dao.OrgDeptDao">
<resultMap id="BaseResultMap" type="com.zq.resource.entity.OrgDept">
<!--@Table ORG_DEPT-->
<result property="id" column="ID" jdbcType="VARCHAR"/>
<result property="parentId" column="PARENT_ID" jdbcType="VARCHAR"/>
<result property="deptName" column="DEPT_NAME" jdbcType="VARCHAR"/>
<result property="deptType" column="DEPT_TYPE" jdbcType="OTHER"/>
<result property="areaCode" column="AREA_CODE" jdbcType="VARCHAR"/>
<result property="address" column="ADDRESS" jdbcType="VARCHAR"/>
<result property="tel" column="TEL" jdbcType="VARCHAR"/>
<result property="totalOrgStaff" column="TOTAL_ORG_STAFF" jdbcType="OTHER"/>
<result property="currOrgStaff" column="CURR_ORG_STAFF" jdbcType="OTHER"/>
<result property="responsibility" column="RESPONSIBILITY" jdbcType="VARCHAR"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
<result property="shareStatus" column="SHARE_STATUS" jdbcType="OTHER"/>
</resultMap>
<!--通过实体作为筛选条件分页查询-->
<select id="queryPageList" resultMap="BaseResultMap">
SELECT
ID, PARENT_ID, DEPT_NAME, DEPT_TYPE, AREA_CODE, ADDRESS, TEL, TOTAL_ORG_STAFF, CURR_ORG_STAFF, RESPONSIBILITY,
CREATE_TIME, UPDATE_TIME, SHARE_STATUS
FROM ORG_DEPT
<where>
<if test="id != null and id != ''">
AND ID = #{id, jdbcType=VARCHAR}
</if>
<if test="parentId != null and parentId != ''">
AND PARENT_ID = #{parentId, jdbcType=VARCHAR}
</if>
<if test="deptName != null and deptName != ''">
AND DEPT_NAME = #{deptName, jdbcType=VARCHAR}
</if>
<if test="deptType != null">
AND DEPT_TYPE = #{deptType, jdbcType=OTHER}
</if>
<if test="areaCode != null and areaCode != ''">
AND AREA_CODE = #{areaCode, jdbcType=VARCHAR}
</if>
<if test="address != null and address != ''">
AND ADDRESS = #{address, jdbcType=VARCHAR}
</if>
<if test="tel != null and tel != ''">
AND TEL = #{tel, jdbcType=VARCHAR}
</if>
<if test="totalOrgStaff != null">
AND TOTAL_ORG_STAFF = #{totalOrgStaff, jdbcType=OTHER}
</if>
<if test="currOrgStaff != null">
AND CURR_ORG_STAFF = #{currOrgStaff, jdbcType=OTHER}
</if>
<if test="responsibility != null and responsibility != ''">
AND RESPONSIBILITY = #{responsibility, jdbcType=VARCHAR}
</if>
<if test="createTime != null">
AND CREATE_TIME = #{createTime, jdbcType=TIMESTAMP}
</if>
<if test="updateTime != null">
AND UPDATE_TIME = #{updateTime, jdbcType=TIMESTAMP}
</if>
<if test="shareStatus != null">
AND SHARE_STATUS = #{shareStatus, jdbcType=OTHER}
</if>
</where>
</select>
</mapper>
\ No newline at end of file
package com.zq.system.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.github.pagehelper.PageInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
* @author wilmiam
* @since 2021-08-09 15:59
*/
@Configuration
public class MybatisConfig {
/**
* MybatisPlus分页插件
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
/**
* PageHelper分页插件
*
* @return
*/
@Bean
public PageInterceptor pageInterceptor() {
PageInterceptor pageInterceptor = new PageInterceptor();
Properties properties = new Properties();
properties.put("helperDialect", "mysql");
pageInterceptor.setProperties(properties);
return pageInterceptor;
}
}
...@@ -12,6 +12,7 @@ spring: ...@@ -12,6 +12,7 @@ spring:
eureka: eureka:
instance: instance:
prefer-ip-address: true prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client: client:
service-url: service-url:
defaultZone: http://admin:123456@127.0.0.1:8800/eureka/ defaultZone: http://admin:123456@127.0.0.1:8800/eureka/
package com.zq.user.config;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import com.github.pagehelper.PageInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
* @author wilmiam
* @since 2021-08-09 15:59
*/
@Configuration
public class MybatisConfig {
/**
* MybatisPlus分页插件
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
/**
* PageHelper分页插件
*
* @return
*/
@Bean
public PageInterceptor pageInterceptor() {
PageInterceptor pageInterceptor = new PageInterceptor();
Properties properties = new Properties();
properties.put("helperDialect", "mysql");
pageInterceptor.setProperties(properties);
return pageInterceptor;
}
}
...@@ -8,11 +8,11 @@ spring: ...@@ -8,11 +8,11 @@ spring:
discovery: discovery:
enabled: true enabled: true
service-id: CONFIG-SERVER service-id: CONFIG-SERVER
uri: http://127.0.0.1:8300/
eureka: eureka:
instance: instance:
prefer-ip-address: true prefer-ip-address: true
instance-id: ${spring.cloud.client.ip-address}:${server.port}
client: client:
service-url: service-url:
defaultZone: http://admin:123456@127.0.0.1:8800/eureka/ defaultZone: http://admin:123456@127.0.0.1:8800/eureka/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment