Commit 33d05fde by Suvalue

科室接口修改

parent 61bb4a96
......@@ -3,11 +3,13 @@ package com.bsoft.api.controller;
import com.bsoft.api.common.Result;
import com.bsoft.api.common.annotations.Token;
import com.bsoft.api.model.SerDepartment;
import com.bsoft.api.model.reqmodel.QuerySummary;
import com.bsoft.api.service.SerDeptService;
import io.swagger.annotations.Api;
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.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
......@@ -26,8 +28,8 @@ public class DeptController {
@PostMapping("/dept/list")
@Token
@ApiOperation("查询科室列表")
public Object getList() throws InterruptedException {
List<SerDepartment> list = serDeptService.getList();
public Object getList(@RequestBody QuerySummary req) {
List<SerDepartment> list = serDeptService.getList(req.getDate());
return Result.success(list);
}
}
package com.bsoft.api.mapper;
import com.bsoft.api.model.SerDepartment;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
......@@ -14,4 +16,6 @@ public interface SerDepartmentMapper {
List<SerDepartment> selectAll();
int updateByPrimaryKey(SerDepartment record);
List<SerDepartment> selectSummaryDept(@Param("date") Integer date);
}
\ No newline at end of file
......@@ -14,8 +14,8 @@ public class SerDeptServiceImpl implements SerDeptService {
private SerDepartmentMapper serDepartmentMapper;
@Override
public List<SerDepartment> getList() {
List<SerDepartment> list = serDepartmentMapper.selectAll();
public List<SerDepartment> getList(Integer date) {
List<SerDepartment> list = serDepartmentMapper.selectSummaryDept(date);
return list;
}
}
......@@ -5,5 +5,5 @@ import com.bsoft.api.model.SerDepartment;
import java.util.List;
public interface SerDeptService {
List<SerDepartment> getList();
List<SerDepartment> getList(Integer date);
}
......@@ -5,7 +5,7 @@ jdbc.password=123456
jdbc.driverClass=com.mysql.jdbc.Driver
spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.username=scml_pd
spring.datasource.username=scml_zp
spring.datasource.password=123
spring.datasource.url=jdbc:oracle:thin:@192.168.18.171:1521:his
......
......@@ -43,4 +43,14 @@
from SER_DEPARTMENT
where "STATE" = 1
</select>
<select id="selectSummaryDept" resultMap="BaseResultMap">
select DEPT_CODE as KSBM,DEPT_NAME as KSMC
from SER_PROJ_VALUE
where 1=1
<if test="date!=null">
and "DATE"=#{date}
</if>
GROUP BY DEPT_CODE,DEPT_NAME,SORT
order by SORT
</select>
</mapper>
\ No newline at end of file
......@@ -39,6 +39,7 @@
where ID = #{id,jdbcType=DECIMAL}
</select>
<select id="selectAll" resultMap="BaseResultMap">
<select id="selectAll" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, STATE, BLOCK_ID, PAGE_ID,WHERE_CLAUSE
from SER_PAGE_BLOCK_RS
</select>
......
......@@ -78,8 +78,9 @@
select DEPT_CODE from SER_PROJ_VALUE
where 1=1
<if test="date!=null">
and "DATE"=2020
and "DATE"=#{date}
</if>
GROUP BY DEPT_CODE
GROUP BY DEPT_CODE,SORT
order by SORT
</select>
</mapper>
\ No newline at end of file
......@@ -94,7 +94,9 @@
</select>
<select id="selectValue" resultMap="SerProjValueResp">
SELECT v.*,p.PROJ_NAME,p.IS_BUDGET
FROM (
FROM SER_PROJ p
LEFT JOIN
(
SELECT v.PROJ_ID,MAX(v.VERSION) AS VERSION
FROM SER_PROJ_VALUE v
WHERE v.STATE = 1
......@@ -105,9 +107,14 @@
AND v."DATE" = #{date,jdbcType=DECIMAL}
</if>
GROUP BY v.PROJ_ID
)m
JOIN SER_PROJ_VALUE v ON v.PROJ_ID = m.PROJ_ID AND v.VERSION = m.VERSION
JOIN SER_PROJ p ON p.ID = m.PROJ_ID AND p.STATE = 1
)m on m.PROJ_ID = p.ID
left JOIN SER_PROJ_VALUE v ON v.PROJ_ID = m.PROJ_ID AND v.VERSION = m.VERSION
<if test="dept!=null">
AND v.DEPT_CODE = #{dept,jdbcType=VARCHAR}
</if>
<if test="date!=null">
AND v."DATE" = #{date,jdbcType=DECIMAL}
</if>
WHERE 1 = 1
<if test="projType!=null">
AND p.PROJ_TYPE = #{projType,jdbcType=DECIMAL}
......@@ -118,12 +125,6 @@
<if test="exponentId!=null">
AND p.TYPE = #{exponentId,jdbcType=DECIMAL}
</if>
<if test="dept!=null">
AND v.DEPT_CODE = #{dept,jdbcType=VARCHAR}
</if>
<if test="date!=null">
AND v."DATE" = #{date,jdbcType=DECIMAL}
</if>
<if test="isBudget!=null">
AND p.IS_BUDGET = #{isBudget,jdbcType=DECIMAL}
</if>
......
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