Commit 33d05fde by Suvalue

科室接口修改

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