Commit 3a856190 by Suvalue

预算编制保存

parent 18386944
......@@ -95,14 +95,16 @@ public class SerProjValueServiceImpl implements SerProjValueService {
SerProjValue info = null;
long version = System.currentTimeMillis();
for(BudgetValue budgetValue : request.getBudgetValues()){
info = new SerProjValue(budgetValue);
info.setDate(request.getDate());
info.setDeptCode(request.getDeptCode());
info.setCreateDate(new Date());
info.setState(BigDecimal.valueOf(StateType.ON.getValue()));
info.setVersion(String.valueOf(version));
info.setHoscode(orgCode);
serProjValueMapper.insert(info);
if(budgetValue.getProjId() != null){
info = new SerProjValue(budgetValue);
info.setDate(request.getDate());
info.setDeptCode(request.getDeptCode());
info.setCreateDate(new Date());
info.setState(BigDecimal.valueOf(StateType.ON.getValue()));
info.setVersion(String.valueOf(version));
info.setHoscode(orgCode);
serProjValueMapper.insert(info);
}
}
//调用计算数值存储过程
serProjValueMapper.updateValue(request.getDate(),orgCode);
......
<?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.SerDiseaseMapper">
<resultMap id="BaseResultMap" type="com.bsoft.api.model.SerDisease">
<result 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="MDC_CODE" jdbcType="VARCHAR" property="mdcCode" />
<result column="MDC_NAME" jdbcType="VARCHAR" property="mdcName" />
<result column="DATE" jdbcType="DECIMAL" property="date" />
<result column="MDC_NUM" jdbcType="VARCHAR" property="mdcNum" />
<result column="PARENT_ID" jdbcType="DECIMAL" property="parentId" />
<result column="LEVEL" jdbcType="DECIMAL" property="level" />
<result column="ORG_ID" jdbcType="DECIMAL" property="orgId" />
<result column="ORG_NAME" jdbcType="VARCHAR" property="orgName" />
<result column="PARENT_CODE" jdbcType="VARCHAR" property="parentCode" />
</resultMap>
<resultMap id="DiseaseLevel" type="com.bsoft.api.model.respmodel.DiseaseLevel">
<id column="ID" jdbcType="DECIMAL" property="id" />
<result column="MDC_CODE" jdbcType="VARCHAR" property="mdcCode" />
<result column="MDC_NAME" jdbcType="VARCHAR" property="mdcName" />
<result column="DATE" jdbcType="DECIMAL" property="date" />
<result column="MDC_NUM" jdbcType="VARCHAR" property="mdcNum" />
<result column="PARENT_ID" jdbcType="DECIMAL" property="parentId" />
<result column="LEVEL" jdbcType="DECIMAL" property="level" />
<result column="ORG_ID" jdbcType="DECIMAL" property="orgId" />
<result column="ORG_NAME" jdbcType="VARCHAR" property="orgName" />
</resultMap>
<insert id="insert" parameterType="com.bsoft.api.model.SerDisease">
<selectKey keyProperty="id" order="AFTER" resultType="java.math.BigDecimal">
SELECT LAST_INSERT_ID()
</selectKey>
insert into SER_DISEASE (CREATE_DATE, CREATE_USERID, `STATE`,
MDC_CODE, MDC_NAME, `DATE`,
MDC_NUM, PARENT_ID, `LEVEL`,
ORG_ID, ORG_NAME, PARENT_CODE
)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{mdcCode,jdbcType=VARCHAR}, #{mdcName,jdbcType=VARCHAR}, #{date,jdbcType=DECIMAL},
#{mdcNum,jdbcType=VARCHAR}, #{parentId,jdbcType=DECIMAL}, #{level,jdbcType=DECIMAL},
#{orgId,jdbcType=DECIMAL}, #{orgName,jdbcType=VARCHAR}, #{parentCode,jdbcType=VARCHAR}
)
</insert>
<select id="selectAll" resultMap="BaseResultMap">
<resultMap id="BaseResultMap" type="com.bsoft.api.model.SerDisease">
<result 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="MDC_CODE" jdbcType="VARCHAR" property="mdcCode" />
<result column="MDC_NAME" jdbcType="VARCHAR" property="mdcName" />
<result column="DATE" jdbcType="DECIMAL" property="date" />
<result column="MDC_NUM" jdbcType="VARCHAR" property="mdcNum" />
<result column="PARENT_ID" jdbcType="DECIMAL" property="parentId" />
<result column="LEVEL" jdbcType="DECIMAL" property="level" />
<result column="ORG_ID" jdbcType="DECIMAL" property="orgId" />
<result column="ORG_NAME" jdbcType="VARCHAR" property="orgName" />
<result column="PARENT_CODE" jdbcType="VARCHAR" property="parentCode" />
</resultMap>
<resultMap id="DiseaseLevel" type="com.bsoft.api.model.respmodel.DiseaseLevel">
<id column="ID" jdbcType="DECIMAL" property="id" />
<result column="MDC_CODE" jdbcType="VARCHAR" property="mdcCode" />
<result column="MDC_NAME" jdbcType="VARCHAR" property="mdcName" />
<result column="DATE" jdbcType="DECIMAL" property="date" />
<result column="MDC_NUM" jdbcType="VARCHAR" property="mdcNum" />
<result column="PARENT_ID" jdbcType="DECIMAL" property="parentId" />
<result column="LEVEL" jdbcType="DECIMAL" property="level" />
<result column="ORG_ID" jdbcType="DECIMAL" property="orgId" />
<result column="ORG_NAME" jdbcType="VARCHAR" property="orgName" />
</resultMap>
<insert id="insert" parameterType="com.bsoft.api.model.SerDisease">
<selectKey keyProperty="id" order="AFTER" resultType="java.math.BigDecimal">
SELECT LAST_INSERT_ID()
</selectKey>
insert into SER_DISEASE (CREATE_DATE, CREATE_USERID, `STATE`,
MDC_CODE, MDC_NAME, `DATE`,
MDC_NUM, PARENT_ID, `LEVEL`,
ORG_ID, ORG_NAME, PARENT_CODE
)
values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{mdcCode,jdbcType=VARCHAR}, #{mdcName,jdbcType=VARCHAR}, #{date,jdbcType=DECIMAL},
#{mdcNum,jdbcType=VARCHAR}, #{parentId,jdbcType=DECIMAL}, #{level,jdbcType=DECIMAL},
#{orgId,jdbcType=DECIMAL}, #{orgName,jdbcType=VARCHAR}, #{parentCode,jdbcType=VARCHAR}
)
</insert>
<select id="selectAll" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, `STATE`, MDC_CODE, MDC_NAME, `DATE`, MDC_NUM,
PARENT_ID, `LEVEL`, ORG_ID, ORG_NAME, PARENT_CODE
from SER_DISEASE
</select>
<select id="selectByCode" resultMap="BaseResultMap">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where d.STATE=1
and rs.MDC_CODE=d.MDC_CODE and rs.MDC_CODE = #{code,jdbcType=VARCHAR} and rs.`DATE` = #{date,jdbcType=VARCHAR}
and d.`DATE` =#{date,jdbcType=VARCHAR}
<if test="docCode!=null">
and rs.DOC_CODE=#{docCode,jdbcType=VARCHAR}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
</select>
<select id="selectByMdcName" resultMap="BaseResultMap">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where 1 = 1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
<if test="date!=null">
and d.`DATE` = #{date,jdbcType=VARCHAR} and rs.`DATE` = #{date,jdbcType=VARCHAR}
</if>
<if test="docCode!=null">
and rs.DOC_CODE=#{docCode,jdbcType=VARCHAR}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
<if test="mdcName!=null">
and d.MDC_NAME like '%'||#{mdcName,jdbcType=VARCHAR}||'%'
</if>
order by d.MDC_NUM
</select>
<select id="selectByLevel" resultMap="DiseaseLevel">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where 1 = 1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
<if test="date!=null">
and d.`DATE` = #{date,jdbcType=VARCHAR} and rs.`DATE` = #{date,jdbcType=VARCHAR}
</if>
<if test="level!=null">
and d.`LEVEL` = #{level,jdbcType=DECIMAL}
</if>
<if test="docCode!=null">
and rs.DOC_CODE = #{docCode,jdbcType=DECIMAL}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE = #{deptCode,jdbcType=VARCHAR}
</if>
<if test="deptCode==null">
and EXISTS(select o2.ORG_CODE as DEPT_CODE
from SYS_USER_ORG_RS rs2
join DIC_ORG o2 on o2.id = rs2.ORG_ID and rs2.STATE = 1
where o2.STATE = 1
and rs2.USER_ID = #{userId,jdbcType=DECIMAL}
and o2.ORG_CODE = rs.DEPT_CODE
)
</if>
order by d.MDC_NUM
</select>
<select id="selectByParentId" resultMap="DiseaseLevel">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where 1 = 1 and STATE=1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
<if test="date!=null">
and d.`DATE` = #{date,jdbcType=VARCHAR} and rs.`DATE` = #{date,jdbcType=VARCHAR}
</if>
<if test="parentId!=null">
and d.PARENT_ID = #{parentId,jdbcType=DECIMAL}
</if>
<if test="docCode!=null">
and rs.DOC_CODE=#{docCode,jdbcType=VARCHAR}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
order by d.MDC_NUM
</select>
<select id="selectParentById" resultMap="DiseaseLevel">
select *
from SER_DISEASE
where 1 = 1 and STATE=1
<if test="date!=null">
and `DATE` = #{date,jdbcType=VARCHAR}
</if>
<if test="diseaseId!=null">
and id=(select PARENT_ID from SER_DISEASE where id = #{diseaseId,jdbcType=DECIMAL} )
</if>
</select>
<select id="selectSonById" resultMap="DiseaseLevel">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.STATE, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where 1 = 1 and STATE=1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
<if test="date!=null">
and d.`DATE` = #{date,jdbcType=VARCHAR} and rs.`DATE` = #{date,jdbcType=VARCHAR}
</if>
<if test="diseaseId!=null">
and d.PARENT_ID=#{diseaseId,jdbcType=DECIMAL}
</if>
<if test="docCode!=null">
and rs.DOC_CODE=#{docCode,jdbcType=VARCHAR}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
order by d.MDC_NUM
</select>
<select id="selectByCode" resultMap="BaseResultMap">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where d.STATE=1
and rs.MDC_CODE=d.MDC_CODE and rs.MDC_CODE = #{code,jdbcType=VARCHAR}
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
</select>
<select id="selectByMdcName" resultMap="BaseResultMap">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where 1 = 1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
<if test="mdcName!=null">
and d.MDC_NAME like '%'||#{mdcName,jdbcType=VARCHAR}||'%'
</if>
order by d.MDC_NUM
</select>
<select id="selectByLevel" resultMap="DiseaseLevel">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where 1 = 1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
<if test="level!=null">
and d.`LEVEL` = #{level,jdbcType=DECIMAL}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE = #{deptCode,jdbcType=VARCHAR}
</if>
<if test="deptCode==null">
and EXISTS(select o2.ORG_CODE as DEPT_CODE
from SYS_USER_ORG_RS rs2
join DIC_ORG o2 on o2.id = rs2.ORG_ID and rs2.STATE = 1
where o2.STATE = 1
and rs2.USER_ID = #{userId,jdbcType=DECIMAL}
and o2.ORG_CODE = rs.DEPT_CODE
)
</if>
order by d.MDC_NUM
</select>
<select id="selectByParentId" resultMap="DiseaseLevel">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.`STATE`, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where 1 = 1 and STATE=1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
<if test="parentId!=null">
and d.PARENT_ID = #{parentId,jdbcType=DECIMAL}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
order by d.MDC_NUM
</select>
<select id="selectParentById" resultMap="DiseaseLevel">
select *
from SER_DISEASE
where 1 = 1 and STATE=1
<if test="diseaseId!=null">
and id=(select PARENT_ID from SER_DISEASE where id = #{diseaseId,jdbcType=DECIMAL} )
</if>
</select>
<select id="selectSonById" resultMap="DiseaseLevel">
select DISTINCT d.ID, d.CREATE_DATE, d.CREATE_USERID, d.STATE, d.MDC_CODE, d.MDC_NAME, d.`DATE`,d.MDC_NUM,
d.PARENT_ID, d.`LEVEL`, d.ORG_ID, d.ORG_NAME
from SER_DISEASE d,SER_DISEASE_DOC_RS rs
where 1 = 1 and STATE=1 and STATE=1 and rs.MDC_CODE=d.MDC_CODE
<if test="diseaseId!=null">
and d.PARENT_ID=#{diseaseId,jdbcType=DECIMAL}
</if>
<if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if>
order by d.MDC_NUM
</select>
</mapper>
\ No newline at end of file
package com.bsoft.common.utils;
public class StringUtil {
public static boolean isNullOrEmpty(String str){
public static boolean isNullOrEmpty(String str) {
return str == null || str.isEmpty();
}
public static boolean isNullOrBlank(String str){
public static boolean isNullOrBlank(String str) {
return str == null || str.trim().isEmpty();
}
}
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