Commit 3a856190 by Suvalue

预算编制保存

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