Commit 1459310c by Suvalue

预算编制接口

parent bef7fc52
package com.bsoft.api.common.enums;
public enum ProjectType {
OUTPATIENT(1,"门诊"),
HOSPITALIZED(2,"住院"),
SUMMARY(3,"汇总");
private int value;
private String desc;
ProjectType(int value,String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
package com.bsoft.api.common.enums;
public enum StateType {
ON(1, "启用"),OFF(0, "禁用"),;
private int value;
private String desc;
StateType(int value,String desc){
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
}
package com.bsoft.api.common.enums;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public enum TypeState {
CORE(1,"核心"),
COMPREHENSIVE(2,"综合"),
RESOURCES(3,"资源分配");
private int value;
private String desc;
TypeState(int value,String desc) {
this.value = value;
this.desc = desc;
}
public int getValue() {
return value;
}
public String getDesc() {
return desc;
}
public static List<Map<String,Object>> all() {
List<Map<String,Object>> list = new ArrayList<>();
for(TypeState typeState : values()){
Map<String,Object> map = new HashMap<String,Object>() {
{
put("value",typeState.getValue());
put("description",typeState.getDesc());
}
};
list.add(map);
}
return list;
}
}
package com.bsoft.api.controller;
import com.bsoft.api.common.Result;
import com.bsoft.api.common.annotations.Token;
import com.bsoft.api.model.reqmodel.AddBudgetValue;
import com.bsoft.api.model.reqmodel.BudgetValue;
import com.bsoft.api.service.SerProjValueService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@Api(tags = "预算编制Api")
@RestController
public class SerProjValueController {
@Resource
private SerProjValueService projValueService;
@PostMapping("budget/value")
@Token
@ApiOperation("查询预算编制数据")
public Object getProjValue(@RequestBody BudgetValue request) throws Throwable {
Object result = projValueService.getValue(request.getProjectType(),request.getDate(),request.getDeptCode());
return Result.success(result);
}
@PostMapping("budget/save")
@Token
@ApiOperation("保存数据")
public Object save(@RequestBody AddBudgetValue request) throws Throwable {
boolean result = projValueService.save(request);
if(result)
return Result.success(null);
else
return Result.error();
}
}
package com.bsoft.api.mapper;
import com.bsoft.api.model.SerProj;
import com.bsoft.api.model.respmodel.ProjectInfo;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
public interface SerProjMapper {
int deleteByPrimaryKey(BigDecimal id);
int insert(SerProj record);
SerProj selectByPrimaryKey(BigDecimal id);
List<SerProj> selectAll();
int updateByPrimaryKey(SerProj record);
List<ProjectInfo> selectState(@Param("projType") Integer projType,
@Param("typeState") Integer typeState);
}
\ No newline at end of file
package com.bsoft.api.mapper;
import com.bsoft.api.model.SerProjValue;
import com.bsoft.api.model.respmodel.SerProjValueResp;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
public interface SerProjValueMapper {
int deleteByPrimaryKey(BigDecimal id);
int insert(SerProjValue record);
SerProjValue selectByPrimaryKey(BigDecimal id);
List<SerProjValue> selectAll();
int updateByPrimaryKey(SerProjValue record);
List<SerProjValueResp> selectValue(@Param("projType") Integer projType,
@Param("typeState") Integer typeState,
@Param("exponentId") Integer exponentId,
@Param("dept") String dept,@Param("date") Integer date);
}
\ No newline at end of file
package com.bsoft.api.model;
import java.math.BigDecimal;
import java.util.Date;
public class SerProj {
private BigDecimal id;
private Date createDate;
private BigDecimal createUserid;
private BigDecimal state;
private Long type;
private Short projType;
private String projName;
private Short isBudget;
private Short typeState;
private BigDecimal sort;
public BigDecimal getId() {
return id;
}
public void setId(BigDecimal id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public BigDecimal getCreateUserid() {
return createUserid;
}
public void setCreateUserid(BigDecimal createUserid) {
this.createUserid = createUserid;
}
public BigDecimal getState() {
return state;
}
public void setState(BigDecimal state) {
this.state = state;
}
public Long getType() {
return type;
}
public void setType(Long type) {
this.type = type;
}
public Short getProjType() {
return projType;
}
public void setProjType(Short projType) {
this.projType = projType;
}
public String getProjName() {
return projName;
}
public void setProjName(String projName) {
this.projName = projName;
}
public Short getIsBudget() {
return isBudget;
}
public void setIsBudget(Short isBudget) {
this.isBudget = isBudget;
}
public Short getTypeState() {
return typeState;
}
public void setTypeState(Short typeState) {
this.typeState = typeState;
}
public BigDecimal getSort() {
return sort;
}
public void setSort(BigDecimal sort) {
this.sort = sort;
}
}
\ No newline at end of file
package com.bsoft.api.model;
import com.bsoft.api.model.reqmodel.AddBudgetValue;
import java.math.BigDecimal;
import java.util.Date;
public class SerProjValue {
public SerProjValue() {
}
public SerProjValue(AddBudgetValue request) {
this.projId = request.getProjId();
this.qnz = request.getQnz();
this.wqqs = request.getWqqs();
this.ls = request.getLs();
this.mb = request.getMb();
this.csysz = request.getCsysz();
this.ysz = request.getYsz();
this.sz = request.getSz();
this.zxpl = request.getZxpl();
this.date = request.getDate();
this.deptCode = request.getDeptCode();
this.sort = request.getSort();
}
private BigDecimal id;
private Date createDate;
private BigDecimal createUserid;
private BigDecimal state;
private BigDecimal projId;
private String qnz;
private BigDecimal wqqs;
private String ls;
private String mb;
private String csysz;
private BigDecimal csyszTb;
private String ysz;
private BigDecimal yszTb;
private String sz;
private BigDecimal zxpl;
private BigDecimal date;
private String deptCode;
private BigDecimal sort;
public BigDecimal getId() {
return id;
}
public void setId(BigDecimal id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public BigDecimal getCreateUserid() {
return createUserid;
}
public void setCreateUserid(BigDecimal createUserid) {
this.createUserid = createUserid;
}
public BigDecimal getState() {
return state;
}
public void setState(BigDecimal state) {
this.state = state;
}
public BigDecimal getProjId() {
return projId;
}
public void setProjId(BigDecimal projId) {
this.projId = projId;
}
public String getQnz() {
return qnz;
}
public void setQnz(String qnz) {
this.qnz = qnz;
}
public BigDecimal getWqqs() {
return wqqs;
}
public void setWqqs(BigDecimal wqqs) {
this.wqqs = wqqs;
}
public String getLs() {
return ls;
}
public void setLs(String ls) {
this.ls = ls;
}
public String getMb() {
return mb;
}
public void setMb(String mb) {
this.mb = mb;
}
public String getCsysz() {
return csysz;
}
public void setCsysz(String csysz) {
this.csysz = csysz;
}
public BigDecimal getCsyszTb() {
return csyszTb;
}
public void setCsyszTb(BigDecimal csyszTb) {
this.csyszTb = csyszTb;
}
public String getYsz() {
return ysz;
}
public void setYsz(String ysz) {
this.ysz = ysz;
}
public BigDecimal getYszTb() {
return yszTb;
}
public void setYszTb(BigDecimal yszTb) {
this.yszTb = yszTb;
}
public String getSz() {
return sz;
}
public void setSz(String sz) {
this.sz = sz;
}
public BigDecimal getZxpl() {
return zxpl;
}
public void setZxpl(BigDecimal zxpl) {
this.zxpl = zxpl;
}
public BigDecimal getDate() {
return date;
}
public void setDate(BigDecimal date) {
this.date = date;
}
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public BigDecimal getSort() {
return sort;
}
public void setSort(BigDecimal sort) {
this.sort = sort;
}
}
\ No newline at end of file
package com.bsoft.api.model.reqmodel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
public class AddBudgetValue {
@ApiModelProperty(value = "项目id")
private BigDecimal projId;
@ApiModelProperty(value = "去年值")
private String qnz;
@ApiModelProperty(value = "往期趋势")
private BigDecimal wqqs;
@ApiModelProperty(value = "同级同类位置历史")
private String ls;
@ApiModelProperty(value = "同级同类位置目标")
private String mb;
@ApiModelProperty(value = "初始运算值")
private String csysz;
@ApiModelProperty(value = "初始运算值同比")
private BigDecimal csyszTb;
@ApiModelProperty(value = "预算值")
private String ysz;
@ApiModelProperty(value = "预算值同比")
private BigDecimal yszTb;
@ApiModelProperty(value = "实值")
private String sz;
@ApiModelProperty(value = "执行偏离")
private BigDecimal zxpl;
@ApiModelProperty(value = "时间")
private BigDecimal date;
@ApiModelProperty(value = "科室code")
private String deptCode;
@ApiModelProperty(value = "排序")
private BigDecimal sort;
public BigDecimal getProjId() {
return projId;
}
public void setProjId(BigDecimal projId) {
this.projId = projId;
}
public String getQnz() {
return qnz;
}
public void setQnz(String qnz) {
this.qnz = qnz;
}
public BigDecimal getWqqs() {
return wqqs;
}
public void setWqqs(BigDecimal wqqs) {
this.wqqs = wqqs;
}
public String getLs() {
return ls;
}
public void setLs(String ls) {
this.ls = ls;
}
public String getMb() {
return mb;
}
public void setMb(String mb) {
this.mb = mb;
}
public String getCsysz() {
return csysz;
}
public void setCsysz(String csysz) {
this.csysz = csysz;
}
public BigDecimal getCsyszTb() {
return csyszTb;
}
public void setCsyszTb(BigDecimal csyszTb) {
this.csyszTb = csyszTb;
}
public String getYsz() {
return ysz;
}
public void setYsz(String ysz) {
this.ysz = ysz;
}
public BigDecimal getYszTb() {
return yszTb;
}
public void setYszTb(BigDecimal yszTb) {
this.yszTb = yszTb;
}
public String getSz() {
return sz;
}
public void setSz(String sz) {
this.sz = sz;
}
public BigDecimal getZxpl() {
return zxpl;
}
public void setZxpl(BigDecimal zxpl) {
this.zxpl = zxpl;
}
public BigDecimal getDate() {
return date;
}
public void setDate(BigDecimal date) {
this.date = date;
}
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public BigDecimal getSort() {
return sort;
}
public void setSort(BigDecimal sort) {
this.sort = sort;
}
}
package com.bsoft.api.model.reqmodel;
import io.swagger.annotations.ApiModelProperty;
public class BudgetValue {
@ApiModelProperty(value = "项目类型(1=门诊/2=住院/3=汇总)",required = true)
private Integer projectType;
@ApiModelProperty(value = "时间",required = true)
private Integer date;
@ApiModelProperty(value = "科室",required = true)
private String deptCode;
public Integer getProjectType() {
return projectType;
}
public void setProjectType(Integer projectType) {
this.projectType = projectType;
}
public Integer getDate() {
return date;
}
public void setDate(Integer date) {
this.date = date;
}
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
}
package com.bsoft.api.model.respmodel;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
public class EnumBean implements Serializable {
private static final String ENUM_CLASS = "java.lang.Enum";
private int id;
private String name;
private String value;
public static List<EnumBean> enumToBeanList(Class clz) throws Throwable {
if(!ENUM_CLASS.equalsIgnoreCase(clz.getSuperclass().getName())){
throw new IllegalArgumentException(
"The argument [ " + clz.getName() + " ] can not be asssigned by " + "java.lang.Enum");
}else{
ArrayList list = new ArrayList();
EnumBean bean = null;
Enum[] enums = null;
String value = null;
Method m = clz.getDeclaredMethod("values",(Class[])null);
enums = (Enum[])((Enum[])m.invoke((Object)null,(Object[])null));
Enum[] arg5 = enums;
int arg6 = enums.length;
for(int arg7 = 0;arg7 < arg6;++arg7){
Enum e = arg5[arg7];
value = Enum.valueOf(clz,e.name()).toString();
bean = new EnumBean();
bean.setName(e.name());
if(value.contains(":")){
bean.setId(Integer.parseInt(value.substring(0,value.indexOf(":"))));
bean.setValue(value.substring(value.indexOf(":") + 1));
}else{
bean.setId(e.ordinal());
bean.setValue(e.name());
}
list.add(bean);
}
return list;
}
}
public int getId() {
return this.id;
}
private void setId(int id) {
this.id = id;
}
public String getName() {
return this.name;
}
private void setName(String name) {
this.name = name;
}
public String getValue() {
return this.value;
}
private void setValue(String value) {
this.value = value;
}
}
package com.bsoft.api.model.respmodel;
import java.util.List;
public class ProjectInfo {
private Integer exponentId;
private String exponentName;
private List<SerProjValueResp> projectValues;
public Integer getExponentId() {
return exponentId;
}
public void setExponentId(Integer exponentId) {
this.exponentId = exponentId;
}
public String getExponentName() {
return exponentName;
}
public void setExponentName(String exponentName) {
this.exponentName = exponentName;
}
public List<SerProjValueResp> getProjectValues() {
return projectValues;
}
public void setProjectValues(List<SerProjValueResp> projectValues) {
this.projectValues = projectValues;
}
}
package com.bsoft.api.model.respmodel;
import java.util.List;
public class ProjectValue {
private Integer typeId;
private List<ProjectInfo> project;
public Integer getTypeId() {
return typeId;
}
public void setTypeId(Integer typeId) {
this.typeId = typeId;
}
public List<ProjectInfo> getProject() {
return project;
}
public void setProject(List<ProjectInfo> project) {
this.project = project;
}
}
package com.bsoft.api.model.respmodel;
import com.bsoft.api.model.SerProjValue;
import java.math.BigDecimal;
public class SerProjValueResp extends SerProjValue {
private String projName;
private BigDecimal isBudget;
public String getProjName() {
return projName;
}
public void setProjName(String projName) {
this.projName = projName;
}
public BigDecimal getIsBudget() {
return isBudget;
}
public void setIsBudget(BigDecimal isBudget) {
this.isBudget = isBudget;
}
}
package com.bsoft.api.service.Impl;
import com.bsoft.api.common.enums.StateType;
import com.bsoft.api.common.enums.TypeState;
import com.bsoft.api.mapper.SerProjMapper;
import com.bsoft.api.mapper.SerProjValueMapper;
import com.bsoft.api.model.SerProjValue;
import com.bsoft.api.model.reqmodel.AddBudgetValue;
import com.bsoft.api.model.respmodel.ProjectInfo;
import com.bsoft.api.model.respmodel.ProjectValue;
import com.bsoft.api.model.respmodel.SerProjValueResp;
import com.bsoft.api.service.SerProjValueService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class SerProjValueServiceImpl implements SerProjValueService {
@Resource
private SerProjMapper serProjMapper;
@Resource
private SerProjValueMapper serProjValueMapper;
//查询项目数值
@Override
public Object getValue(Integer projectType,Integer date,String deptCode) throws Throwable {
List<ProjectValue> result = new ArrayList<>();
List<Map<String,Object>> enumList = TypeState.all();
if(enumList != null && enumList.size() > 0){
ProjectValue projectValue = null;
List<ProjectInfo> projectInfo = null;
for(Map<String,Object> enumInfo : enumList){
projectValue = new ProjectValue();
projectValue.setTypeId((Integer)enumInfo.get("value"));
projectInfo = new ArrayList<>();
projectInfo = serProjMapper.selectState(projectType,(Integer)enumInfo.get("value"));
if(projectInfo != null && projectInfo.size() > 0){
for(ProjectInfo projInfo : projectInfo){
List<SerProjValueResp> values = serProjValueMapper.selectValue(projectType,(Integer)enumInfo.get("value"),
projInfo.getExponentId(),deptCode,date);
if(values != null && values.size() > 0)
projInfo.setProjectValues(values);
}
}
projectValue.setProject(projectInfo);
result.add(projectValue);
}
}
return result;
}
@Override
public boolean save(AddBudgetValue request) {
int result = 0;
if(request != null){
SerProjValue info = new SerProjValue(request);
info.setCreateDate(new Date());
info.setState(BigDecimal.valueOf(StateType.ON.getValue()));
result = serProjValueMapper.insert(info);
}
return result > 0;
}
}
package com.bsoft.api.service;
import com.bsoft.api.model.reqmodel.AddBudgetValue;
public interface SerProjValueService {
Object getValue(Integer projectType,Integer date,String deptCode) throws Throwable;
boolean save(AddBudgetValue request);
}
spring.application.name=bsoftapi
spring.profiles.active=test
spring.profiles.active=dev
#server.port=8080
#server.servlet.context-path=/api
mybatis.mapper-locations=classpath:mapper/*.xml
......
<?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.bsoft.api.mapper.SerProjMapper">
<resultMap id="BaseResultMap" type="com.bsoft.api.model.SerProj">
<id column="ID" jdbcType="DECIMAL" property="id" />
<result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" />
<result column="CREATE_USERID" jdbcType="DECIMAL" property="createUserid" />
<result column="STATE" jdbcType="DECIMAL" property="state" />
<result column="TYPE" jdbcType="DECIMAL" property="type" />
<result column="PROJ_TYPE" jdbcType="DECIMAL" property="projType" />
<result column="PROJ_NAME" jdbcType="VARCHAR" property="projName" />
<result column="IS_BUDGET" jdbcType="DECIMAL" property="isBudget" />
<result column="TYPE_STATE" jdbcType="DECIMAL" property="typeState" />
<result column="SORT" jdbcType="DECIMAL" property="sort" />
</resultMap>
<resultMap id="ProjectInfo" type="com.bsoft.api.model.respmodel.ProjectInfo">
<result column="EXPONENT_ID" jdbcType="DECIMAL" property="exponentId" />
<result column="EXPONENT_NAME" jdbcType="VARCHAR" property="exponentName" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
delete from SER_PROJ
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert id="insert" parameterType="com.bsoft.api.model.SerProj">
<selectKey keyProperty="id" order="AFTER" resultType="java.math.BigDecimal">
select SEQ_SER_PROJ_ID.nextval from dual
</selectKey>
insert into SER_PROJ (CREATE_DATE, CREATE_USERID, "STATE",
"TYPE", PROJ_TYPE, PROJ_NAME,
IS_BUDGET, TYPE_STATE, SORT
)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{type,jdbcType=DECIMAL}, #{projType,jdbcType=DECIMAL}, #{projName,jdbcType=VARCHAR},
#{isBudget,jdbcType=DECIMAL}, #{typeState,jdbcType=DECIMAL}, #{sort,jdbcType=DECIMAL}
)
</insert>
<update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SerProj">
update SER_PROJ
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
"TYPE" = #{type,jdbcType=DECIMAL},
PROJ_TYPE = #{projType,jdbcType=DECIMAL},
PROJ_NAME = #{projName,jdbcType=VARCHAR},
IS_BUDGET = #{isBudget,jdbcType=DECIMAL},
TYPE_STATE = #{typeState,jdbcType=DECIMAL},
SORT = #{sort,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, "STATE", "TYPE", PROJ_TYPE, PROJ_NAME, IS_BUDGET,
TYPE_STATE, SORT
from SER_PROJ
where ID = #{id,jdbcType=DECIMAL}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, "STATE", "TYPE", PROJ_TYPE, PROJ_NAME, IS_BUDGET,
TYPE_STATE, SORT
from SER_PROJ
</select>
<select id="selectState" resultMap="ProjectInfo">
select DISTINCT p.TYPE as EXPONENT_ID,e.EXPONENT_NAME,e.SORT
from ser_proj p
join DIC_EXPONENT e on e.EXPONENT_ID=p.TYPE and e.STATE = 1
where p.STATE = 1 and p.PROJ_TYPE = #{projType,jdbcType=DECIMAL}
and p.TYPE_STATE = #{typeState,jdbcType=DECIMAL}
order by e.SORT
</select>
</mapper>
\ No newline at end of file
<?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.bsoft.api.mapper.SerProjValueMapper">
<resultMap id="BaseResultMap" type="com.bsoft.api.model.SerProjValue">
<id column="ID" jdbcType="DECIMAL" property="id" />
<result column="CREATE_DATE" jdbcType="TIMESTAMP" property="createDate" />
<result column="CREATE_USERID" jdbcType="DECIMAL" property="createUserid" />
<result column="STATE" jdbcType="DECIMAL" property="state" />
<result column="PROJ_ID" jdbcType="DECIMAL" property="projId" />
<result column="QNZ" jdbcType="VARCHAR" property="qnz" />
<result column="WQQS" jdbcType="DECIMAL" property="wqqs" />
<result column="LS" jdbcType="VARCHAR" property="ls" />
<result column="MB" jdbcType="VARCHAR" property="mb" />
<result column="CSYSZ" jdbcType="VARCHAR" property="csysz" />
<result column="CSYSZ_TB" jdbcType="DECIMAL" property="csyszTb" />
<result column="YSZ" jdbcType="VARCHAR" property="ysz" />
<result column="YSZ_TB" jdbcType="DECIMAL" property="yszTb" />
<result column="SZ" jdbcType="VARCHAR" property="sz" />
<result column="ZXPL" jdbcType="DECIMAL" property="zxpl" />
<result column="DATE" jdbcType="DECIMAL" property="date" />
<result column="DEPT_CODE" jdbcType="VARCHAR" property="deptCode" />
<result column="SORT" jdbcType="DECIMAL" property="sort" />
</resultMap>
<resultMap id="SerProjValueResp" extends="BaseResultMap" type="com.bsoft.api.model.respmodel.SerProjValueResp">
<result column="PROJ_NAME" jdbcType="VARCHAR" property="projName"/>
<result column="IS_BUDGET" jdbcType="DECIMAL" property="isBudget"/>
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
delete from SER_PROJ_VALUE
where ID = #{id,jdbcType=DECIMAL}
</delete>
<insert id="insert" parameterType="com.bsoft.api.model.SerProjValue">
<selectKey keyProperty="id" order="AFTER" resultType="java.math.BigDecimal">
select SEQ_SER_PROJ_VALUE_ID.nextval from dual
</selectKey>
insert into SER_PROJ_VALUE (CREATE_DATE, CREATE_USERID, "STATE",
PROJ_ID, QNZ, WQQS,
LS, MB, CSYSZ, CSYSZ_TB,
YSZ, YSZ_TB, SZ, ZXPL,
"DATE", DEPT_CODE, SORT
)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{projId,jdbcType=DECIMAL}, #{qnz,jdbcType=VARCHAR}, #{wqqs,jdbcType=DECIMAL},
#{ls,jdbcType=VARCHAR}, #{mb,jdbcType=VARCHAR}, #{csysz,jdbcType=VARCHAR}, #{csyszTb,jdbcType=DECIMAL},
#{ysz,jdbcType=VARCHAR}, #{yszTb,jdbcType=DECIMAL}, #{sz,jdbcType=VARCHAR}, #{zxpl,jdbcType=DECIMAL},
#{date,jdbcType=DECIMAL}, #{deptCode,jdbcType=VARCHAR}, #{sort,jdbcType=DECIMAL}
)
</insert>
<update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SerProjValue">
update SER_PROJ_VALUE
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
"STATE" = #{state,jdbcType=DECIMAL},
PROJ_ID = #{projId,jdbcType=DECIMAL},
QNZ = #{qnz,jdbcType=VARCHAR},
WQQS = #{wqqs,jdbcType=DECIMAL},
LS = #{ls,jdbcType=VARCHAR},
MB = #{mb,jdbcType=VARCHAR},
CSYSZ = #{csysz,jdbcType=VARCHAR},
CSYSZ_TB = #{csyszTb,jdbcType=DECIMAL},
YSZ = #{ysz,jdbcType=VARCHAR},
YSZ_TB = #{yszTb,jdbcType=DECIMAL},
SZ = #{sz,jdbcType=VARCHAR},
ZXPL = #{zxpl,jdbcType=DECIMAL},
"DATE" = #{date,jdbcType=DECIMAL},
DEPT_CODE = #{deptCode,jdbcType=VARCHAR},
SORT = #{sort,jdbcType=DECIMAL}
where ID = #{id,jdbcType=DECIMAL}
</update>
<select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, "STATE", PROJ_ID, QNZ, WQQS, LS, MB, CSYSZ,
CSYSZ_TB, YSZ, YSZ_TB, SZ, ZXPL, "DATE", DEPT_CODE, SORT
from SER_PROJ_VALUE
where ID = #{id,jdbcType=DECIMAL}
</select>
<select id="selectAll" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, "STATE", PROJ_ID, QNZ, WQQS, LS, MB, CSYSZ,
CSYSZ_TB, YSZ, YSZ_TB, SZ, ZXPL, "DATE", DEPT_CODE, SORT
from SER_PROJ_VALUE
</select>
<select id="selectValue" resultMap="SerProjValueResp">
select v.*,p.PROJ_NAME,p.IS_BUDGET
from (
select v.ID,v.PROJ_ID,MAX(v.CREATE_DATE) as CREATE_DATE
from SER_PROJ_VALUE v
where v.STATE = 1
GROUP BY v.PROJ_ID,v.ID
)m
join SER_PROJ_VALUE v on v.ID = m.ID
join SER_PROJ p on p.ID = m.PROJ_ID and p.STATE = 1
where 1 = 1
and p.PROJ_TYPE = #{projType,jdbcType=DECIMAL}
and p.TYPE_STATE = #{typeState,jdbcType=DECIMAL}
and p.TYPE = #{exponentId,jdbcType=DECIMAL}
and v.DEPT_CODE = #{dept,jdbcType=VARCHAR}
and v."DATE" = #{date,jdbcType=DECIMAL}
</select>
</mapper>
\ No newline at end of file
......@@ -42,94 +42,12 @@
<!-- 生成映射接口配置 -->
<javaClientGenerator targetPackage="com.bsoft.api.mapper" targetProject="src/main/java" type="XMLMAPPER"/>
<!-- <table tableName="sys_user" schema="ll" >-->
<!-- &lt;!&ndash; 主键生成方式 &ndash;&gt;-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<table tableName="SER_DEPARTMENT">
<generatedKey column="id" sqlStatement="select SEQ_SER_DEPARTMENT_ID.nextval from dual" identity="true"/>
<table tableName="SER_PROJ">
<generatedKey column="id" sqlStatement="select SEQ_SER_PROJ_ID.nextval from dual" identity="true"/>
</table>
<table tableName="SER_DEPT_DOC_RS">
<generatedKey column="id" sqlStatement="select SEQ_SER_DEPT_DOC_RS_ID.nextval from dual" identity="true"/>
<table tableName="SER_PROJ_VALUE">
<generatedKey column="id" sqlStatement="select SEQ_SER_PROJ_VALUE_ID.nextval from dual" identity="true"/>
</table>
<table tableName="SER_DOCTOR">
<generatedKey column="id" sqlStatement="select SEQ_SER_DOCTOR_ID.nextval from dual" identity="true"/>
</table>
<!-- <table tableName="DIC_IND" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_DIC_IND_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="DIC_ORG" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_DIC_ORG_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_BLOCK_IND_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_ BLOCK_IND_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_BLOCK" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_BLOCK_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_PAGE" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_PAGE_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_PAGE_BLOCK_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_PAGE_BLOCK_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SER_PAGE_DIM_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SER_PAGE_DIM_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_MENU" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_MENU_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_ORG" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_ORG_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_PROJECT" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_PROJECT_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_ROLE" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_ROLE_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_ROLE_MENU_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_ROLE_MENU_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_USER_MENU_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_MENU_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_USER_ORG_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ORG_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
<!-- <table tableName="SYS_USER_ROLE_RS" schema="ll" >-->
<!-- <generatedKey column="id" sqlStatement="select SEQ_SYS_USER_ROLE_RS_ID.nextval from dual" identity="true" />-->
<!-- </table>-->
</context>
<!--<context id="sqlserver" targetRuntime="MyBatis3Simple" defaultModelType="flat">-->
<!--<property enName="beginningDelimiter" value="["/>-->
<!--<property enName="endingDelimiter" value="]"/>-->
<!--&lt;!&ndash; 生成的文件编码 &ndash;&gt;-->
<!--<property enName="javaFileEncoding" value="utf-8"/>-->
<!--&lt;!&ndash; 通过自定义插件类生成自定义注解和接口 &ndash;&gt;-->
<!--&lt;!&ndash;<plugin type="com.suvalue.common.GenPlugin">&ndash;&gt;-->
<!--&lt;!&ndash;<property enName="mappers" value="com.suvalue.demo.mapper.BaseMapper"/>&ndash;&gt;-->
<!--&lt;!&ndash;</plugin>&ndash;&gt;-->
<!--<commentGenerator>-->
<!--&lt;!&ndash; 取消生成注释 &ndash;&gt;-->
<!--<property enName="suppressAllComments" value="false"/>-->
<!--</commentGenerator>-->
<!--&lt;!&ndash; 数据库连接属性 &ndash;&gt;-->
<!--<jdbcConnection driverClass="${jdbc.sqlserver.driver}"-->
<!--connectionURL="${jdbc.sqlserver.url}"-->
<!--userId="${jdbc.sqlserver.username}"-->
<!--password="${jdbc.sqlserver.password}">-->
<!--</jdbcConnection>-->
<!--&lt;!&ndash; 生成实体类配置 &ndash;&gt;-->
<!--<javaModelGenerator targetPackage="com.suvalue.verctrl.model" targetProject="src/main/java"/>-->
<!--&lt;!&ndash; 生成映射文件配置 &ndash;&gt;-->
<!--<sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources"/>-->
<!--&lt;!&ndash; 生成映射接口配置 &ndash;&gt;-->
<!--&lt;!&ndash;<javaClientGenerator targetPackage="com.suvalue.verctrl.mapper" targetProject="src/main/java" type="XMLMAPPER"/>&ndash;&gt;-->
<!--<table tableName="data_version" schema="dbo">-->
<!--&lt;!&ndash;mysql 配置 &ndash;&gt;-->
<!--<generatedKey column="id" sqlStatement="SqlServer" identity="true"/>-->
<!--</table>-->
<!--</context>-->
</generatorConfiguration>
jdbc.url=jdbc:mysql://192.168.18.55:3306/db_appointment?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE
jdbc.username=ll
jdbc.username=CH
jdbc.password=123456
jdbc.driverClass=com.mysql.jdbc.Driver
\ 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