Commit b55ed9da by Suvalue

Merge branch 'dev' of http://192.168.18.110:8880/bsoft/sv-springboot into dev

parents 47148483 ef3b2855
...@@ -80,6 +80,10 @@ ...@@ -80,6 +80,10 @@
相当于compile,但是打包阶段做了exclude操作--> 相当于compile,但是打包阶段做了exclude操作-->
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -4,7 +4,9 @@ import org.mybatis.spring.annotation.MapperScan; ...@@ -4,7 +4,9 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
@EnableAsync
@SpringBootApplication @SpringBootApplication
@MapperScan("com.bsoft.api.mapper") @MapperScan("com.bsoft.api.mapper")
@ComponentScan(basePackages = {"com.bsoft.common.config","com.bsoft.api"}) @ComponentScan(basePackages = {"com.bsoft.common.config","com.bsoft.api"})
......
package com.bsoft.api.common; package com.bsoft.api.common;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
/** /**
* 请求统一返回结果 * 请求统一返回结果
*/ */
@ApiModel(description = "接口结果")
public class Result<T> { public class Result<T> {
@ApiModelProperty("code") @ApiModelProperty("错误编码")
private int code; private int code;
@ApiModelProperty("错误信息")
private String msg; private String msg;
@ApiModelProperty("返回的数据") @ApiModelProperty(value = "返回的数据")
private T data; private T data;
private Result(int code, String msg, T data) { private Result(int code, String msg, T data) {
...@@ -52,7 +54,7 @@ public class Result<T> { ...@@ -52,7 +54,7 @@ public class Result<T> {
this.data = data; this.data = data;
} }
public static Result success(Object data){ public static <T> Result<T> success(T data){
return new Result(ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getEnMessage(), data); return new Result(ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getEnMessage(), data);
} }
......
package com.bsoft.api.common.exceptions;
public class DBConfigurationError extends ExceptionBase {
public DBConfigurationError(String message){
super(message);
}
}
package com.bsoft.api.common.handlers; package com.bsoft.api.common.handlers;
import com.bsoft.api.common.Result; import com.bsoft.api.common.Result;
import com.bsoft.api.common.exceptions.DBConfigurationError;
import com.bsoft.api.common.exceptions.ExceptionBase;
import com.bsoft.api.common.exceptions.InvalidTokenException;
import com.bsoft.common.utils.HttpUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ControllerAdvice;
...@@ -25,9 +29,44 @@ public class GlobalExceptionHandler { ...@@ -25,9 +29,44 @@ public class GlobalExceptionHandler {
@ExceptionHandler(Exception.class) @ExceptionHandler(Exception.class)
@ResponseBody @ResponseBody
public Object defaultErrorHandler(HttpServletRequest request, Exception e){ public Object defaultErrorHandler(HttpServletRequest request, Exception e){
log.error("未知异常:" + e.getMessage(), e.getStackTrace()); String url = HttpUtil.getIP(request);
log.error(url + "请求未知异常:" + e.getMessage(), e.getStackTrace());
return Result.error(); return Result.error();
} }
/**
* 其他内部异常
* @param request
* @param e
* @return
*/
@ExceptionHandler(ExceptionBase.class)
@ResponseBody
public Object BaseErrorHandler(HttpServletRequest request, Exception e){
String url = HttpUtil.getIP(request);
log.error(url + "请求未知异常:" + e.getMessage(), e.getStackTrace());
return Result.error();
}
@ExceptionHandler(DBConfigurationError.class)
@ResponseBody
public Object DBConfigurationErrorHandler(HttpServletRequest request, Exception e){
String url = HttpUtil.getIP(request);
log.error(url + "请求未知异常:" + e.getMessage(), e.getStackTrace());
return Result.error(400, e.getMessage());
}
/**
* 无效token
* @param request
* @param e
* @return
*/
@ExceptionHandler(InvalidTokenException.class)
@ResponseBody
public Object InvalidTokenExceptionHandler(HttpServletRequest request, Exception e){
String url = HttpUtil.getIP(request);
log.error(url + "请求未知异常:" + e.getMessage(), e.getStackTrace());
return Result.error(Result.ErrorCode.INVALID_TOKEN);
}
} }
...@@ -2,19 +2,14 @@ package com.bsoft.api.controller; ...@@ -2,19 +2,14 @@ package com.bsoft.api.controller;
import com.bsoft.api.common.Result; import com.bsoft.api.common.Result;
import com.bsoft.api.common.annotations.Token; import com.bsoft.api.common.annotations.Token;
import com.bsoft.api.common.base.RequestResult; import com.bsoft.api.model.reqmodel.BlockValues;
import com.bsoft.api.mapper.BlockValuesMapper;
import com.bsoft.api.model.requmodel.BlockValues;
import com.bsoft.api.service.BlockValuesService; import com.bsoft.api.service.BlockValuesService;
import com.bsoft.api.service.Impl.BlockValuesServiceImpl;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -35,10 +30,10 @@ public class BlockValuesController { ...@@ -35,10 +30,10 @@ public class BlockValuesController {
@GetMapping("blockValues") @GetMapping("blockValues")
@Token @Token
@ApiOperation("根据Page查询板块数值") @ApiOperation("根据Page查询板块数值")
public Object getBlockValuesByPageID(@RequestBody BlockValues blockValues){ public Object getBlockValuesByPageID(@RequestBody BlockValues blockValues) throws InterruptedException {
List<Map<String,Object>> list= blockValuesService.getBlockValuesByPageID(blockValues.getPageId(),blockValues.getDisease(), List<Map<String,Object>> list= blockValuesService.getBlockValuesByPageCode(blockValues.getPageCode(),
blockValues.getDoctor(),blockValues.getDepartment(),blockValues.getTime()); blockValues.getDisease(), blockValues.getDoctor(),blockValues.getDepartment(),blockValues.getTime());
return Result.success(list); return Result.success(list);
} }
} }
\ No newline at end of file
...@@ -19,8 +19,14 @@ public class LoginController { ...@@ -19,8 +19,14 @@ public class LoginController {
@Autowired @Autowired
private LoginService loginServiceImpl; private LoginService loginServiceImpl;
/**
*
* @param codeAndPwd
* @param request
* @return
*/
@PostMapping("login") @PostMapping("login")
@ApiOperation("登录") @ApiOperation(value="Result«LoginService.LoginInfo»登录")
public Result<LoginService.LoginInfo> login(@RequestBody CodeAndPwd codeAndPwd,HttpServletRequest request){ public Result<LoginService.LoginInfo> login(@RequestBody CodeAndPwd codeAndPwd,HttpServletRequest request){
String ip = HttpUtil.getIP(request); String ip = HttpUtil.getIP(request);
LoginService.LoginInfo loginInfo = loginServiceImpl.login( LoginService.LoginInfo loginInfo = loginServiceImpl.login(
......
...@@ -42,7 +42,7 @@ public class UserController { ...@@ -42,7 +42,7 @@ public class UserController {
* @return * @return
*/ */
@GetMapping("roles") @GetMapping("roles")
@Token // @Token
@ApiOperation("查询用户角色") @ApiOperation("查询用户角色")
public Object getRoleListByUser(@ApiIgnore@CurrentUser Long userId)throws Exception{ public Object getRoleListByUser(@ApiIgnore@CurrentUser Long userId)throws Exception{
List<SysRole> list = sysUserRoleRsService.getRoleListByUser(userId); List<SysRole> list = sysUserRoleRsService.getRoleListByUser(userId);
...@@ -55,7 +55,7 @@ public class UserController { ...@@ -55,7 +55,7 @@ public class UserController {
* @return * @return
*/ */
@GetMapping("menus") @GetMapping("menus")
@Token // @Token
@ApiOperation("查询用户菜单") @ApiOperation("查询用户菜单")
public Object getMenuByUser(@ApiIgnore@CurrentUser Long userId)throws Exception{ public Object getMenuByUser(@ApiIgnore@CurrentUser Long userId)throws Exception{
return Result.success(sysMenuService.getMenu(userId)); return Result.success(sysMenuService.getMenu(userId));
......
...@@ -16,5 +16,5 @@ public interface SerPageBlockRsMapper { ...@@ -16,5 +16,5 @@ public interface SerPageBlockRsMapper {
int updateByPrimaryKey(SerPageBlockRs record); int updateByPrimaryKey(SerPageBlockRs record);
List<SerPageBlockRs> selectByPageId(Integer pageID); List<SerPageBlockRs> selectByPageId(Long pageID);
} }
\ No newline at end of file
package com.bsoft.api.mapper; package com.bsoft.api.mapper;
import com.bsoft.api.model.SerPage; import com.bsoft.api.model.SerPage;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface SerPageMapper { public interface SerPageMapper {
...@@ -13,4 +15,6 @@ public interface SerPageMapper { ...@@ -13,4 +15,6 @@ public interface SerPageMapper {
List<SerPage> selectAll(); List<SerPage> selectAll();
int updateByPrimaryKey(SerPage record); int updateByPrimaryKey(SerPage record);
List<SerPage> selectByCodeAndDim(@Param("pageCode") Integer pageCode, @Param("inField") String inField, @Param("dimCount") int dimCount);
} }
\ No newline at end of file
...@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -5,7 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import java.util.Date; import java.util.Date;
@ApiModel("用户信息") @ApiModel(description = "用户信息")
public class SysUser { public class SysUser {
/** /**
* *
......
package com.bsoft.api.model.requmodel; package com.bsoft.api.model.reqmodel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.Date; @ApiModel(description = "调用blockValues请求的数据")
@ApiModel("调用blockValues请求的数据")
public class BlockValues { public class BlockValues {
public Integer getPageId() { public Integer getPageCode() {
return pageId; return pageCode;
} }
public void setPageId(Integer pageId) { public void setPageCode(Integer pageCode) {
this.pageId = pageId; this.pageCode = pageCode;
} }
public Integer getDisease() { public Integer getDisease() {
...@@ -49,10 +47,8 @@ public class BlockValues { ...@@ -49,10 +47,8 @@ public class BlockValues {
this.time = time; this.time = time;
} }
@ApiModelProperty(value = "pageID",required = true) @ApiModelProperty(value = "pageCode",required = true)
private Integer pageId; private Integer pageCode;
@ApiModelProperty("病组") @ApiModelProperty("病组")
private Integer disease; private Integer disease;
@ApiModelProperty("科室") @ApiModelProperty("科室")
......
package com.bsoft.api.service;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
public interface AsynBlockValuesService {
void getBlockValues(List<Map<String, Object>> list, String blockId, String tableName,
String whereClause, CountDownLatch latch);
}
...@@ -4,5 +4,5 @@ import java.util.List; ...@@ -4,5 +4,5 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public interface BlockValuesService { public interface BlockValuesService {
List<Map<String,Object>> getBlockValuesByPageID(Integer pageId, Integer disease, Integer doctor, Integer department, Integer time); List<Map<String,Object>> getBlockValuesByPageCode(Integer pageId, Integer disease, Integer doctor, Integer department, Integer time) throws InterruptedException;
} }
package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.BlockValuesMapper;
import com.bsoft.api.service.AsynBlockValuesService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
@Service
public class AsynBlockValuesServiceImpl implements AsynBlockValuesService {
private final static Object obj = new Object();
@Resource
private BlockValuesMapper blockValuesMapper;
@Async
@Override
public void getBlockValues(List<Map<String, Object>> list, String blockId, String tableName,
String whereClause, CountDownLatch latch) {
System.out.println("开始"+tableName);
List<Map<String, Object>> dataList = blockValuesMapper.selectByWhere(tableName, whereClause);
Map<String, Object> map = new HashMap<String,Object>(){
{
put(blockId, dataList);
}
};
synchronized (obj){
list.add(map);
}
System.out.println("结束"+tableName);
latch.countDown();
}
}
package com.bsoft.api.service.Impl; package com.bsoft.api.service.Impl;
import com.bsoft.api.common.exceptions.DBConfigurationError;
import com.bsoft.api.mapper.BlockValuesMapper; import com.bsoft.api.mapper.BlockValuesMapper;
import com.bsoft.api.mapper.DicDimMapper; import com.bsoft.api.mapper.DicDimMapper;
import com.bsoft.api.mapper.SerPageBlockRsMapper; import com.bsoft.api.mapper.SerPageBlockRsMapper;
import com.bsoft.api.mapper.SerPageMapper;
import com.bsoft.api.model.DicDim; import com.bsoft.api.model.DicDim;
import com.bsoft.api.model.SerPage;
import com.bsoft.api.model.SerPageBlockRs; import com.bsoft.api.model.SerPageBlockRs;
import com.bsoft.api.service.AsynBlockValuesService;
import com.bsoft.api.service.BlockValuesService; import com.bsoft.api.service.BlockValuesService;
import org.apache.ibatis.binding.MapperMethod; import org.apache.ibatis.binding.MapperMethod;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.AsyncResult;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -15,72 +21,79 @@ import java.util.ArrayList; ...@@ -15,72 +21,79 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
@Service @Service
public class BlockValuesServiceImpl implements BlockValuesService { public class BlockValuesServiceImpl implements BlockValuesService {
@Resource @Resource
private SerPageBlockRsMapper serPageBlockRsMapper; private SerPageBlockRsMapper serPageBlockRsMapper;
@Resource @Resource
private DicDimMapper dicDimMapper; private SerPageMapper serPageMapper;
@Resource @Resource
private BlockValuesMapper blockValuesMapper; private AsynBlockValuesService asynBlockValuesServiceImpl;
@Override @Override
public List<Map<String,Object>> getBlockValuesByPageID(Integer pageId,Integer disease,Integer doctor,Integer department,Integer time){ public List<Map<String, Object>> getBlockValuesByPageCode(Integer pageCode, Integer disease, Integer doctor, Integer department, Integer time) throws InterruptedException {
Boolean isDisease = false; /**
Boolean isDoctor = false; * 1.根据pageCode,disease,doctor,department,time查询所有对应的pageId
Boolean isDepartment = false; * 查询要求为pageCode为当前pageCode,相同pageId的所有数据有且仅有DIM_ID为
Boolean isTime = false; * disease,doctor,department,time中不为null的对应id
List<Map<String,Object>> list = new ArrayList<>(); * 2.根据pageId获取所有block
//根据pageId查询所有板块 * 3.根据block拼接表名及where语句
List<SerPageBlockRs> pageBlocklist =serPageBlockRsMapper.selectByPageId(pageId); */
//根据pageId查询所有维度 List<Map<String, Object>> list = new ArrayList<>();
List<DicDim> dimList = dicDimMapper.selectByPageid(pageId);
//循环获取需要添加的维度查询条件
for (DicDim data : dimList) {
if(data.getDimField().equalsIgnoreCase("disease")){
isDisease=true;
}
if(data.getDimField().equalsIgnoreCase("doctor")){
isDoctor=true;
}
if(data.getDimField().equalsIgnoreCase("department")){
isDepartment=true;
}
if(data.getDimField().equalsIgnoreCase("time")){
isTime=true;
}
}
//循环获取数据
for (SerPageBlockRs data : pageBlocklist) {
//获取表名
String tableName = "VAL_BLOCK_VALUES_"+data.getBlockId();
String whereSql = "where 1=1"; int count = 0;
String inField = "";
String whereClause = "where 1=1";
if(disease != null){
whereClause += String.format(" and disease='%s'", disease);
inField += "'disease',";
count++;
}
if (doctor != null) {
whereClause += String.format(" and doctor='%s'", doctor);
inField += "'doctor',";
count++;
}
if (department != null) {
whereClause += String.format(" and department='%s'", department);
inField += "'department',";
count++;
}
if (time != null) {
whereClause += String.format(" and time='%s'", time);
inField += "'time',";
count++;
}
if(count > 0){
inField = inField.substring(0, inField.length()-1);
}
//添加查询条件 List<SerPage> pageList = serPageMapper.selectByCodeAndDim(pageCode, inField, count);
if(disease!=null&&isDisease){ if(pageList.size() == 0){
whereSql+=String.format(" and disease='%s'",disease); throw new DBConfigurationError("页面维度配置表错误,请联系管理员");
}
if(doctor!=null&&isDoctor){
whereSql+=String.format(" and doctor='%s'",doctor);
}
if(department!=null&&isDepartment){
whereSql+=String.format(" and department='%s'",department);
}
if(time!=null&&isTime){
whereSql+=String.format(" and time='%s'",time);
}
List<Map<String,Object>> dataList =blockValuesMapper.selectByWhere(tableName,whereSql);
list.add(new HashMap<String,Object>(){
{
put(data.getBlockId().toString(),dataList);
}
});
}
return list;
} }
SerPage page = pageList.get(0);
//根据pageId查询所有板块
List<SerPageBlockRs> pageBlocklist = serPageBlockRsMapper.selectByPageId(page.getId());
//循环获取数据
CountDownLatch latch = new CountDownLatch(pageBlocklist.size());
for (SerPageBlockRs data : pageBlocklist) {
//获取表名
String blockId = data.getBlockId().toString();
String tableName = "VAL_BLOCK_VALUES_" + blockId;
asynBlockValuesServiceImpl.getBlockValues(list, blockId, tableName, whereClause, latch);
}
latch.await();
return list;
}
} }
...@@ -11,7 +11,7 @@ public interface LoginService { ...@@ -11,7 +11,7 @@ public interface LoginService {
String refreshToken(String oldToken); String refreshToken(String oldToken);
@ApiModel("登录信息") @ApiModel(description = "登录信息")
class LoginInfo { class LoginInfo {
@ApiModelProperty("token") @ApiModelProperty("token")
private String token; private String token;
......
...@@ -8,4 +8,9 @@ mybatis.type-aliases-package=com.bsoft.api.model ...@@ -8,4 +8,9 @@ mybatis.type-aliases-package=com.bsoft.api.model
config.path.include[0]=/token config.path.include[0]=/token
config.path.include[1]=/user/** config.path.include[1]=/user/**
config.path.exclude[0]=/login config.path.exclude[0]=/login
\ No newline at end of file
# Add @EnableAspectJAutoProxy.
spring.aop.auto=true
# Whether subclass-based (CGLIB) proxies are to be created (true)
spring.aop.proxy-target-class=false
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bsoft.api.mapper.SerPageMapper"> <mapper namespace="com.bsoft.api.mapper.SerPageMapper">
<resultMap id="BaseResultMap" type="com.bsoft.api.model.SerPage"> <resultMap id="BaseResultMap" type="com.bsoft.api.model.SerPage">
<id column="ID" jdbcType="DECIMAL" property="id" /> <id column="ID" jdbcType="DECIMAL" property="id"/>
<result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" /> <result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate"/>
<result column="CREATE_USERID" jdbcType="DECIMAL" property="createUserid" /> <result column="CREATE_USERID" jdbcType="DECIMAL" property="createUserid"/>
<result column="STATE" jdbcType="DECIMAL" property="state" /> <result column="STATE" jdbcType="DECIMAL" property="state"/>
<result column="PAGE_CODE" jdbcType="VARCHAR" property="pageCode" /> <result column="PAGE_CODE" jdbcType="VARCHAR" property="pageCode"/>
<result column="PAGE_NAME" jdbcType="VARCHAR" property="pageName" /> <result column="PAGE_NAME" jdbcType="VARCHAR" property="pageName"/>
</resultMap> </resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from LL.SER_PAGE delete from LL.SER_PAGE
where ID = #{id,jdbcType=DECIMAL} where ID = #{id,jdbcType=DECIMAL}
</delete> </delete>
<insert id="insert" parameterType="com.bsoft.api.model.SerPage"> <insert id="insert" parameterType="com.bsoft.api.model.SerPage">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
select SEQ_SER_PAGE_ID.nextval from dual select SEQ_SER_PAGE_ID.nextval from dual
</selectKey> </selectKey>
insert into LL.SER_PAGE (CREATE_DATE, CREATE_USERID, STATE, insert into LL.SER_PAGE (CREATE_DATE, CREATE_USERID, STATE,
PAGE_CODE, PAGE_NAME) PAGE_CODE, PAGE_NAME)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL}, values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{pageCode,jdbcType=VARCHAR}, #{pageName,jdbcType=VARCHAR}) #{pageCode,jdbcType=VARCHAR}, #{pageName,jdbcType=VARCHAR})
</insert> </insert>
<update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SerPage"> <update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SerPage">
update LL.SER_PAGE update LL.SER_PAGE
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL}, CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
STATE = #{state,jdbcType=DECIMAL}, STATE = #{state,jdbcType=DECIMAL},
PAGE_CODE = #{pageCode,jdbcType=VARCHAR}, PAGE_CODE = #{pageCode,jdbcType=VARCHAR},
PAGE_NAME = #{pageName,jdbcType=VARCHAR} PAGE_NAME = #{pageName,jdbcType=VARCHAR}
where ID = #{id,jdbcType=DECIMAL} where ID = #{id,jdbcType=DECIMAL}
</update> </update>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, STATE, PAGE_CODE, PAGE_NAME select ID, CREATE_DATE, CREATE_USERID, STATE, PAGE_CODE, PAGE_NAME
from LL.SER_PAGE from LL.SER_PAGE
where ID = #{id,jdbcType=DECIMAL} where ID = #{id,jdbcType=DECIMAL}
</select> </select>
<select id="selectAll" resultMap="BaseResultMap"> <select id="selectAll" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, STATE, PAGE_CODE, PAGE_NAME select ID, CREATE_DATE, CREATE_USERID, STATE, PAGE_CODE, PAGE_NAME
from LL.SER_PAGE from LL.SER_PAGE
</select> </select>
<select id="selectByCodeAndDim" resultMap="BaseResultMap">
select d.* from SER_PAGE d,
<if test="dimCount != 0">
(select a.id,COUNT(b.ID) count
from SER_PAGE a
LEFT JOIN ser_page_dim_rs b on a.id = b.PAGE_ID and b.state = 1
LEFT JOIN DIC_DIM c on c.ID = b.DIM_ID
where a.state =1 and a.PAGE_CODE = #{pageCode,jdbcType=VARCHAR}
and c.DIM_FIELD in (${inField})
GROUP BY a.ID) e,
</if>
(select a.id,COUNT(b.ID) count
from SER_PAGE a
LEFT JOIN ser_page_dim_rs b on a.id = b.PAGE_ID and b.state = 1
LEFT JOIN DIC_DIM c on c.ID = b.DIM_ID
where a.state =1 and a.PAGE_CODE = #{pageCode,jdbcType=VARCHAR}
GROUP BY a.ID) f
where d.id = f.id
<if test="dimCount != 0">
and f.count = e.count
and d.Id = e.id
</if>
and f.count =#{dimCount,jdbcType=INTEGER}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -13,20 +13,6 @@ http { ...@@ -13,20 +13,6 @@ http {
sendfile on; sendfile on;
keepalive_timeout 65; keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server { server {
listen 8080; listen 8080;
...@@ -46,6 +32,8 @@ http { ...@@ -46,6 +32,8 @@ http {
add_header 'Access-Control-Allow-Methods' 'GET,POST'; add_header 'Access-Control-Allow-Methods' 'GET,POST';
# 获取请求的host # 获取请求的host
proxy_set_header Host $host; proxy_set_header Host $host;
# 获取请求的port(为解决swagger调用接口用)
proxy_set_header X-Forwarded-Port 83;
# 获取请求的ip地址 # 获取请求的ip地址
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
# 获取请求的多级ip地址,当请求经过多个反向代理时,会获取多个ip,英文逗号隔开 # 获取请求的多级ip地址,当请求经过多个反向代理时,会获取多个ip,英文逗号隔开
......
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