Commit c5971914 by Suvalue

添加医生疾病实现层

parent c08d24e7
...@@ -30,7 +30,7 @@ public class GlobalExceptionHandler { ...@@ -30,7 +30,7 @@ public class GlobalExceptionHandler {
@ResponseBody @ResponseBody
public Object defaultErrorHandler(HttpServletRequest request, Exception e){ public Object defaultErrorHandler(HttpServletRequest request, Exception e){
String url = request.getRequestURI(); String url = request.getRequestURI();
log.error(url + "请求未知异常:" + e.getMessage(), e.getStackTrace()); log.error(url + "请求未知异常:" + e.getCause(), e.getStackTrace());
return Result.error(); return Result.error();
} }
......
...@@ -4,19 +4,23 @@ import com.bsoft.api.common.Result; ...@@ -4,19 +4,23 @@ import com.bsoft.api.common.Result;
import com.bsoft.api.common.annotations.Token; import com.bsoft.api.common.annotations.Token;
import com.bsoft.api.model.SerDisease; import com.bsoft.api.model.SerDisease;
import com.bsoft.api.model.reqmodel.Disease; import com.bsoft.api.model.reqmodel.Disease;
import com.bsoft.api.model.respmodel.DiseaseLevel; import com.bsoft.api.service.SerDiseaseService;
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.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
@Api(tags = "疾病信息Api") @Api(tags = "疾病信息Api")
@RestController @RestController
public class SerDiseaseController { public class SerDiseaseController {
@Autowired
private SerDiseaseService serDiseaseService;
/** /**
* 根据pageId查询板块数值 * 根据pageId查询板块数值
* @return * @return
...@@ -25,13 +29,13 @@ public class SerDiseaseController { ...@@ -25,13 +29,13 @@ public class SerDiseaseController {
@PostMapping("disease/level") @PostMapping("disease/level")
@Token @Token
@ApiOperation("根据等级查询疾病信息") @ApiOperation("根据等级查询疾病信息")
public Object getDiseaseByLevel(@RequestBody Disease.DiseaseByLevel disease) throws InterruptedException { public Object getDiseaseByLevel(@RequestBody Disease.DiseaseLevel disease) throws InterruptedException {
return Result.success(new ArrayList<DiseaseLevel>(){ return Result.success(new ArrayList<com.bsoft.api.model.respmodel.DiseaseLevel>(){
{ {
add(new DiseaseLevel(){{ add(new com.bsoft.api.model.respmodel.DiseaseLevel(){{
setDiseaseLevelList(new ArrayList<DiseaseLevel>(){ setDiseaseLevelList(new ArrayList<com.bsoft.api.model.respmodel.DiseaseLevel>(){
{ {
add(new DiseaseLevel()); add(new com.bsoft.api.model.respmodel.DiseaseLevel());
} }
}); });
}}); }});
...@@ -40,17 +44,19 @@ public class SerDiseaseController { ...@@ -40,17 +44,19 @@ public class SerDiseaseController {
} }
@PostMapping("disease/name") @PostMapping("disease/name")
@Token // @Token
@ApiOperation("根据疾病名称查询疾病信息") @ApiOperation("根据疾病名称查询疾病信息")
public Object getDiseaseByMdcName(@RequestBody Disease.DiseaseByName disease) throws InterruptedException { public Object getDiseaseByMdcName(@RequestBody Disease.DiseaseName disease) throws InterruptedException {
return Result.success(new SerDisease()); List<SerDisease> list = serDiseaseService.selectByMdcName(disease.getDate().toString(),disease.getMdcName());
return Result.success(list);
} }
@PostMapping("disease/level/info") @PostMapping("disease/level/info")
@Token // @Token
@ApiOperation("查询特定等级下所有数据以及子数据") @ApiOperation("查询特定等级下所有数据")
public Object getDiseaseByLevelSon(@RequestBody Disease.DiseaseByLevelSon disease) throws InterruptedException { public Object getDiseaseByLevelSon(@RequestBody Disease.DiseaseLevelSon disease) throws InterruptedException {
return Result.success(new SerDisease()); List<SerDisease> list = serDiseaseService.selectByLevel(disease.getDate().toString(),disease.getLevel().intValue());
return Result.success(list);
} }
} }
...@@ -4,20 +4,29 @@ import com.bsoft.api.common.Result; ...@@ -4,20 +4,29 @@ import com.bsoft.api.common.Result;
import com.bsoft.api.common.annotations.Token; import com.bsoft.api.common.annotations.Token;
import com.bsoft.api.model.SerDiseaseDocRs; import com.bsoft.api.model.SerDiseaseDocRs;
import com.bsoft.api.model.reqmodel.DiseaseDoc; import com.bsoft.api.model.reqmodel.DiseaseDoc;
import com.bsoft.api.service.SerDiseaseDocService;
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.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "疾病与医生关系信息Api") @Api(tags = "疾病与医生关系信息Api")
@RestController @RestController
public class SerDiseaseDocController { public class SerDiseaseDocController {
@Autowired
private SerDiseaseDocService serDiseaseDocService;
@PostMapping("diseaseDoc") @PostMapping("diseaseDoc")
@Token // @Token
@ApiOperation("根据疾病名称查询疾病信息") @ApiOperation("根据Code查询疾病关系信息")
public Object getDiseaseDoc(@RequestBody DiseaseDoc disease) throws InterruptedException { public Object getDiseaseDoc(@RequestBody DiseaseDoc disease) throws InterruptedException {
return Result.success(new SerDiseaseDocRs()); List<SerDiseaseDocRs> list = serDiseaseDocService.getDiseaseDoc(disease.getDocCode(),disease.getMdcCode(),
disease.getDeptCode());
return Result.success(list);
} }
} }
package com.bsoft.api.mapper; package com.bsoft.api.mapper;
import com.bsoft.api.model.SerDiseaseDocRs; import com.bsoft.api.model.SerDiseaseDocRs;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -14,5 +15,7 @@ public interface SerDiseaseDocRsMapper { ...@@ -14,5 +15,7 @@ public interface SerDiseaseDocRsMapper {
List<SerDiseaseDocRs> selectAll(); List<SerDiseaseDocRs> selectAll();
List<SerDiseaseDocRs> selectByCode(@Param("docCode") String docCode,@Param("mdcCode") String mdcCode,@Param("deptCode") String deptCode);
int updateByPrimaryKey(SerDiseaseDocRs record); int updateByPrimaryKey(SerDiseaseDocRs record);
} }
package com.bsoft.api.mapper; package com.bsoft.api.mapper;
import com.bsoft.api.model.SerDisease; import com.bsoft.api.model.SerDisease;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -14,6 +15,10 @@ public interface SerDiseaseMapper { ...@@ -14,6 +15,10 @@ public interface SerDiseaseMapper {
List<SerDisease> selectAll(); List<SerDisease> selectAll();
List<SerDisease> selectByMdcName(@Param("date") String date,@Param("mdcName") String mdcName);
List<SerDisease> selectByLevel(@Param("date") String date,@Param("level") Integer level);
int updateByPrimaryKey(SerDisease record); int updateByPrimaryKey(SerDisease record);
} }
...@@ -92,4 +92,5 @@ public class SysMenu { ...@@ -92,4 +92,5 @@ public class SysMenu {
public void setParentId(Long parentId) { public void setParentId(Long parentId) {
this.parentId = parentId; this.parentId = parentId;
} }
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ public class Disease { ...@@ -8,7 +8,7 @@ public class Disease {
/** /**
* 等级查询疾病实体 * 等级查询疾病实体
*/ */
public static class DiseaseByLevel{ public static class DiseaseLevel {
@ApiModelProperty(value = "等级",required = true) @ApiModelProperty(value = "等级",required = true)
private BigDecimal level; private BigDecimal level;
@ApiModelProperty(value = "时间",required = true) @ApiModelProperty(value = "时间",required = true)
...@@ -44,7 +44,7 @@ public class Disease { ...@@ -44,7 +44,7 @@ public class Disease {
/** /**
* 名称查询疾病实体 * 名称查询疾病实体
*/ */
public static class DiseaseByName{ public static class DiseaseName {
@ApiModelProperty(value = "时间",required = true) @ApiModelProperty(value = "时间",required = true)
private BigDecimal date; private BigDecimal date;
...@@ -71,7 +71,7 @@ public class Disease { ...@@ -71,7 +71,7 @@ public class Disease {
/** /**
* 特定等级下所有数据以及子数据实体 * 特定等级下所有数据以及子数据实体
*/ */
public static class DiseaseByLevelSon{ public static class DiseaseLevelSon {
@ApiModelProperty(value = "等级",required = true) @ApiModelProperty(value = "等级",required = true)
private BigDecimal level; private BigDecimal level;
@ApiModelProperty(value = "时间",required = true) @ApiModelProperty(value = "时间",required = true)
......
package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.SerDiseaseDocRsMapper;
import com.bsoft.api.model.SerDiseaseDocRs;
import com.bsoft.api.service.SerDiseaseDocService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class SerDiseaseDocServiceImpl implements SerDiseaseDocService {
@Resource
private SerDiseaseDocRsMapper serDiseaseDocRsMapper;
@Override
public List<SerDiseaseDocRs> getDiseaseDoc(String docCode, String mdcCode, String deptCode) throws InterruptedException {
return serDiseaseDocRsMapper.selectByCode(docCode,mdcCode,deptCode);
}
}
package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.SerDiseaseMapper;
import com.bsoft.api.model.SerDisease;
import com.bsoft.api.service.SerDiseaseService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class SerDiseaseServiceImpl implements SerDiseaseService {
@Resource
private SerDiseaseMapper serDiseaseMapper;
@Override
public List<SerDisease> selectByMdcName(String date, String mdcName) {
return serDiseaseMapper.selectByMdcName(date,mdcName);
}
@Override
public List<SerDisease> selectByLevel(String date, Integer level) {
return serDiseaseMapper.selectByLevel(date,level);
}
}
...@@ -24,7 +24,7 @@ public class SysMenuServiceImpl implements SysMenuService { ...@@ -24,7 +24,7 @@ public class SysMenuServiceImpl implements SysMenuService {
SysMenuList sysMenuList = new SysMenuList(); SysMenuList sysMenuList = new SysMenuList();
SysMenu sysMenu = new SysMenu(); SysMenu sysMenu = new SysMenu();
List<SysMenuList> list = sysMenuMapper.selectMenuByUser(userId); List<SysMenuList> list = sysMenuMapper.selectMenuByUser(userId);
List<SysMenuList> resultList = getLevelData(list, Long.valueOf(0)); List<SysMenuList> resultList = getLevelData(list, Long.valueOf(MENU_TOP_PARENT_ID));
return resultList; return resultList;
} }
......
package com.bsoft.api.service;
import com.bsoft.api.model.SerDiseaseDocRs;
import java.util.List;
public interface SerDiseaseDocService {
List<SerDiseaseDocRs> getDiseaseDoc(String docCode, String mdcCode, String deptCode) throws InterruptedException;
}
package com.bsoft.api.service;
import com.bsoft.api.model.SerDisease;
import java.util.List;
public interface SerDiseaseService {
List<SerDisease> selectByMdcName(String date,String mdcName);
List<SerDisease> selectByLevel(String date,Integer level);
}
...@@ -6,5 +6,8 @@ import com.bsoft.api.model.respmodel.SysMenuList; ...@@ -6,5 +6,8 @@ import com.bsoft.api.model.respmodel.SysMenuList;
import java.util.List; import java.util.List;
public interface SysMenuService extends ServiceBase<SysMenu> { public interface SysMenuService extends ServiceBase<SysMenu> {
//顶级菜单的父级id
final static Integer MENU_TOP_PARENT_ID =0;
List<SysMenuList> getMenu(Long userId) throws Exception; List<SysMenuList> getMenu(Long userId) throws Exception;
} }
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<result column="DEPT_CODE" jdbcType="VARCHAR" property="deptCode" /> <result column="DEPT_CODE" jdbcType="VARCHAR" property="deptCode" />
<result column="DEPT_NAME" jdbcType="VARCHAR" property="deptName" /> <result column="DEPT_NAME" jdbcType="VARCHAR" property="deptName" />
</resultMap> </resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal"> <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
delete from LL.SER_DISEASE_DOC_RS delete from LL.SER_DISEASE_DOC_RS
where ID = #{id,jdbcType=DECIMAL} where ID = #{id,jdbcType=DECIMAL}
...@@ -20,7 +21,7 @@ ...@@ -20,7 +21,7 @@
select SEQ_SER_DISEASE_DOC_RS_ID.nextval from dual select SEQ_SER_DISEASE_DOC_RS_ID.nextval from dual
</selectKey> </selectKey>
insert into LL.SER_DISEASE_DOC_RS (ORG_ID, DOC_CODE, DOC_NAME, insert into LL.SER_DISEASE_DOC_RS (ORG_ID, DOC_CODE, DOC_NAME,
MDC_CODE, DATE, DEPT_CODE, MDC_CODE, "DATE", DEPT_CODE,
DEPT_NAME) DEPT_NAME)
values (#{orgId,jdbcType=DECIMAL}, #{docCode,jdbcType=VARCHAR}, #{docName,jdbcType=VARCHAR}, values (#{orgId,jdbcType=DECIMAL}, #{docCode,jdbcType=VARCHAR}, #{docName,jdbcType=VARCHAR},
#{mdcCode,jdbcType=VARCHAR}, #{date,jdbcType=DECIMAL}, #{deptCode,jdbcType=VARCHAR}, #{mdcCode,jdbcType=VARCHAR}, #{date,jdbcType=DECIMAL}, #{deptCode,jdbcType=VARCHAR},
...@@ -32,18 +33,32 @@ ...@@ -32,18 +33,32 @@
DOC_CODE = #{docCode,jdbcType=VARCHAR}, DOC_CODE = #{docCode,jdbcType=VARCHAR},
DOC_NAME = #{docName,jdbcType=VARCHAR}, DOC_NAME = #{docName,jdbcType=VARCHAR},
MDC_CODE = #{mdcCode,jdbcType=VARCHAR}, MDC_CODE = #{mdcCode,jdbcType=VARCHAR},
DATE = #{date,jdbcType=DECIMAL}, "DATE" = #{date,jdbcType=DECIMAL},
DEPT_CODE = #{deptCode,jdbcType=VARCHAR}, DEPT_CODE = #{deptCode,jdbcType=VARCHAR},
DEPT_NAME = #{deptName,jdbcType=VARCHAR} DEPT_NAME = #{deptName,jdbcType=VARCHAR}
where ID = #{id,jdbcType=DECIMAL} where ID = #{id,jdbcType=DECIMAL}
</update> </update>
<select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE, DATE, DEPT_CODE, DEPT_NAME select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE, "DATE", DEPT_CODE, DEPT_NAME
from LL.SER_DISEASE_DOC_RS from LL.SER_DISEASE_DOC_RS
where ID = #{id,jdbcType=DECIMAL} where ID = #{id,jdbcType=DECIMAL}
</select> </select>
<select id="selectAll" resultMap="BaseResultMap"> <select id="selectAll" resultMap="BaseResultMap">
select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE, DATE, DEPT_CODE, DEPT_NAME select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE, "DATE", DEPT_CODE, DEPT_NAME
from LL.SER_DISEASE_DOC_RS from LL.SER_DISEASE_DOC_RS
</select> </select>
<select id="selectByCode" resultMap="BaseResultMap">
select ID, ORG_ID, DOC_CODE, DOC_NAME, MDC_CODE, "DATE", DEPT_CODE, DEPT_NAME
from LL.SER_DISEASE_DOC_RS
where 1=1
<if test="docCode!=null">
and DOC_CODE = #{docCode,jdbcType=VARCHAR}
</if>
<if test="mdcCode!=null">
and MDC_CODE = #{mdcCode,jdbcType=VARCHAR}
</if>
<if test="deptCode!=null">
and DEPT_CODE = #{deptCode,jdbcType=VARCHAR}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<result column="ORG_ID" jdbcType="DECIMAL" property="orgId" /> <result column="ORG_ID" jdbcType="DECIMAL" property="orgId" />
<result column="ORG_NAME" jdbcType="VARCHAR" property="orgName" /> <result column="ORG_NAME" jdbcType="VARCHAR" property="orgName" />
</resultMap> </resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal"> <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
delete from LL.SER_DISEASE delete from LL.SER_DISEASE
where ID = #{id,jdbcType=DECIMAL} where ID = #{id,jdbcType=DECIMAL}
...@@ -58,4 +59,28 @@ ...@@ -58,4 +59,28 @@
PARENT_ID, LEVEL, ORG_ID, ORG_NAME PARENT_ID, LEVEL, ORG_ID, ORG_NAME
from LL.SER_DISEASE from LL.SER_DISEASE
</select> </select>
<select id="selectByMdcName" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, STATE, MDC_CODE, MDC_NAME, "DATE", MDC_NUM,
PARENT_ID,"LEVEL", ORG_ID, ORG_NAME
from LL.SER_DISEASE
where 1 = 1
<if test="date!=null">
and "DATE" = #{date,jdbcType=VARCHAR}
</if>
<if test="mdcName!=null">
and MDC_NAME like '%'||#{mdcName,jdbcType=VARCHAR}||'%'
</if>
</select>
<select id="selectByLevel" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, STATE, MDC_CODE, MDC_NAME, "DATE", MDC_NUM,
PARENT_ID,"LEVEL", ORG_ID, ORG_NAME
from LL.SER_DISEASE
where 1 = 1
<if test="date!=null">
and "DATE" = #{date,jdbcType=VARCHAR}
</if>
<if test="level!=null">
and "LEVEL" = #{level,jdbcType=DECIMAL}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
<property name="endingDelimiter" value="`"/> <property name="endingDelimiter" value="`"/>
<!-- 生成的文件编码 --> <!-- 生成的文件编码 -->
<property name="javaFileEncoding" value="utf-8"/> <property name="javaFileEncoding" value="utf-8"/>
<property name="autoDelimitKeywords" value="true"/>
<property name="beginningDelimiter" value="&quot;"/>
<property name="endingDelimiter" value="&quot;"/>
<!-- 通过自定义插件类生成自定义注解和接口 --> <!-- 通过自定义插件类生成自定义注解和接口 -->
<!--<plugin type="com.suvalue.common.GenPlugin">--> <!--<plugin type="com.suvalue.common.GenPlugin">-->
<!--<property enName="mappers" value="com.suvalue.demo.mapper.BaseMapper"/>--> <!--<property enName="mappers" value="com.suvalue.demo.mapper.BaseMapper"/>-->
...@@ -42,8 +46,8 @@ ...@@ -42,8 +46,8 @@
<!-- &lt;!&ndash; 主键生成方式 &ndash;&gt;--> <!-- &lt;!&ndash; 主键生成方式 &ndash;&gt;-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ID.nextval from dual" identity="true" />--> <!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ID.nextval from dual" identity="true" />-->
<!-- </table>--> <!-- </table>-->
<table tableName="DIC_DIM" schema="ll" > <table tableName="SER_DISEASE_DOC_RS" schema="ll" >
<generatedKey column="id" sqlStatement="select SEQ_DIC_DIM_ID.nextval from dual" identity="true" /> <generatedKey column="id" sqlStatement="select SEQ_SER_DISEASE_DOC_RS_ID.nextval from dual" identity="true" />
</table> </table>
<!-- <table tableName="DIC_IND" schema="ll" >--> <!-- <table tableName="DIC_IND" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_DIC_IND_ID.nextval from dual" identity="true" />--> <!-- <generatedKey column="id" sqlStatement="select SEQ_DIC_IND_ID.nextval from dual" identity="true" />-->
......
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