Commit 8183cb92 by Suvalue

根据疾病名称搜索疾病

预算编制汇总数据根据用户科室查询
parent 66b068d4
...@@ -22,5 +22,5 @@ public interface SerProjMapper { ...@@ -22,5 +22,5 @@ public interface SerProjMapper {
List<ProjectInfo> selectState(@Param("projType") Integer projType, List<ProjectInfo> selectState(@Param("projType") Integer projType,
@Param("typeState") Integer typeState); @Param("typeState") Integer typeState);
List<Summary> selectDept(@Param("date") Integer date,@Param("budgetType") Integer budgetType); List<Summary> selectDept(@Param("date") Integer date, @Param("budgetType") Integer budgetType, @Param("userId") Long userId);
} }
\ No newline at end of file
#### \u6D4B\u8BD5\u73AF\u5883 ################################################### #### \u6D4B\u8BD5\u73AF\u5883 ###################################################
spring.datasource.url=jdbc:mysql://192.168.18.176:3306/scml_zp_cs?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC spring.datasource.url=jdbc:mysql://192.168.18.176:3306/scml_sy_test1.0?useUnicode=true&characterEncoding=utf8&useSSL=false&autoReconnect=true&rewriteBatchedStatements=TRUE&serverTimezone=UTC
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=Suvalue2016 spring.datasource.password=Suvalue2016
spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.driver-class-name=com.mysql.jdbc.Driver
......
...@@ -2,30 +2,30 @@ ...@@ -2,30 +2,30 @@
<!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">
...@@ -43,10 +43,21 @@ ...@@ -43,10 +43,21 @@
) )
</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,
PARENT_ID, `LEVEL`, ORG_ID, ORG_NAME, PARENT_CODE CREATE_DATE,
from SER_DISEASE CREATE_USERID,
</select> `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 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
...@@ -66,7 +77,7 @@ ...@@ -66,7 +77,7 @@
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR} and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR}
</if> </if>
<if test="mdcName!=null"> <if test="mdcName!=null">
and d.MDC_NAME like '%'||#{mdcName,jdbcType=VARCHAR}||'%' and INSTR(d.MDC_NAME,#{mdcName,jdbcType=VARCHAR})>0
</if> </if>
order by d.MDC_NUM order by d.MDC_NUM
</select> </select>
......
<?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.SerProjMapper"> <mapper namespace="com.bsoft.api.mapper.SerProjMapper">
<resultMap id="BaseResultMap" type="com.bsoft.api.model.SerProj"> <resultMap id="BaseResultMap" type="com.bsoft.api.model.SerProj">
<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="TYPE" jdbcType="DECIMAL" property="type" /> <result column="TYPE" jdbcType="DECIMAL" property="type"/>
<result column="PROJ_TYPE" jdbcType="DECIMAL" property="projType" /> <result column="PROJ_TYPE" jdbcType="DECIMAL" property="projType"/>
<result column="PROJ_NAME" jdbcType="VARCHAR" property="projName" /> <result column="PROJ_NAME" jdbcType="VARCHAR" property="projName"/>
<result column="IS_BUDGET" jdbcType="DECIMAL" property="isBudget" /> <result column="IS_BUDGET" jdbcType="DECIMAL" property="isBudget"/>
<result column="TYPE_STATE" jdbcType="DECIMAL" property="typeState" /> <result column="TYPE_STATE" jdbcType="DECIMAL" property="typeState"/>
<result column="SORT" jdbcType="DECIMAL" property="sort" /> <result column="SORT" jdbcType="DECIMAL" property="sort"/>
<result column="PARENT" jdbcType="DECIMAL" property="parent" /> <result column="PARENT" jdbcType="DECIMAL" property="parent"/>
</resultMap> </resultMap>
<resultMap id="Summary" type="com.bsoft.api.model.respmodel.Summary"> <resultMap id="Summary" type="com.bsoft.api.model.respmodel.Summary">
<result column="DEPT_CODE" jdbcType="VARCHAR" property="deptCode" /> <result column="DEPT_CODE" jdbcType="VARCHAR" property="deptCode"/>
</resultMap> </resultMap>
<resultMap id="ProjectInfo" type="com.bsoft.api.model.respmodel.ProjectInfo"> <resultMap id="ProjectInfo" type="com.bsoft.api.model.respmodel.ProjectInfo">
<result column="EXPONENT_ID" jdbcType="DECIMAL" property="exponentId" /> <result column="EXPONENT_ID" jdbcType="DECIMAL" property="exponentId"/>
<result column="EXPONENT_NAME" jdbcType="VARCHAR" property="exponentName" /> <result column="EXPONENT_NAME" jdbcType="VARCHAR" property="exponentName"/>
</resultMap> </resultMap>
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal"> <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
delete from SER_PROJ delete
where ID = #{id,jdbcType=DECIMAL} from SER_PROJ
</delete> where ID = #{id,jdbcType=DECIMAL}
<insert id="insert" parameterType="com.bsoft.api.model.SerProj"> </delete>
<selectKey keyProperty="id" order="AFTER" resultType="java.math.BigDecimal"> <insert id="insert" parameterType="com.bsoft.api.model.SerProj">
SELECT LAST_INSERT_ID() <selectKey keyProperty="id" order="AFTER" resultType="java.math.BigDecimal">
</selectKey> SELECT LAST_INSERT_ID()
insert into SER_PROJ (CREATE_DATE, CREATE_USERID, `STATE`, </selectKey>
`TYPE`, PROJ_TYPE, PROJ_NAME, insert into SER_PROJ (CREATE_DATE, CREATE_USERID, `STATE`,
IS_BUDGET, TYPE_STATE, SORT `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}, values (#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{isBudget,jdbcType=DECIMAL}, #{typeState,jdbcType=DECIMAL}, #{sort,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"> </insert>
update SER_PROJ <update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SerProj">
set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP}, update SER_PROJ
CREATE_USERID = #{createUserid,jdbcType=DECIMAL}, set CREATE_DATE = #{createDate,jdbcType=TIMESTAMP},
`STATE` = #{state,jdbcType=DECIMAL}, CREATE_USERID = #{createUserid,jdbcType=DECIMAL},
`TYPE` = #{type,jdbcType=DECIMAL}, `STATE` = #{state,jdbcType=DECIMAL},
PROJ_TYPE = #{projType,jdbcType=DECIMAL}, `TYPE` = #{type,jdbcType=DECIMAL},
PROJ_NAME = #{projName,jdbcType=VARCHAR}, PROJ_TYPE = #{projType,jdbcType=DECIMAL},
IS_BUDGET = #{isBudget,jdbcType=DECIMAL}, PROJ_NAME = #{projName,jdbcType=VARCHAR},
TYPE_STATE = #{typeState,jdbcType=DECIMAL}, IS_BUDGET = #{isBudget,jdbcType=DECIMAL},
SORT = #{sort,jdbcType=DECIMAL} TYPE_STATE = #{typeState,jdbcType=DECIMAL},
where ID = #{id,jdbcType=DECIMAL} SORT = #{sort,jdbcType=DECIMAL}
</update> where ID = #{id,jdbcType=DECIMAL}
<select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap"> </update>
select ID, CREATE_DATE, CREATE_USERID, `STATE`, `TYPE`, PROJ_TYPE, PROJ_NAME, IS_BUDGET, <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
TYPE_STATE, SORT select ID,
from SER_PROJ CREATE_DATE,
where ID = #{id,jdbcType=DECIMAL} CREATE_USERID,
</select> `STATE`,
<select id="selectAll" resultMap="BaseResultMap"> `TYPE`,
select ID, CREATE_DATE, CREATE_USERID, `STATE`, `TYPE`, PROJ_TYPE, PROJ_NAME, IS_BUDGET, PROJ_TYPE,
TYPE_STATE, SORT PROJ_NAME,
from SER_PROJ IS_BUDGET,
</select> TYPE_STATE,
<select id="selectState" resultMap="ProjectInfo"> SORT
select DISTINCT p.TYPE as EXPONENT_ID,e.EXPONENT_NAME,e.SORT from SER_PROJ
from ser_proj p where ID = #{id,jdbcType=DECIMAL}
join DIC_EXPONENT e on e.EXPONENT_ID=p.`TYPE` and e.STATE = 1 </select>
where p.`STATE` = 1 <select id="selectAll" resultMap="BaseResultMap">
<if test="projType!=null"> select ID,
and p.PROJ_TYPE = #{projType,jdbcType=DECIMAL} CREATE_DATE,
</if> CREATE_USERID,
<if test="typeState!=null"> `STATE`,
and p.TYPE_STATE = #{typeState,jdbcType=DECIMAL} `TYPE`,
</if> PROJ_TYPE,
order by e.SORT PROJ_NAME,
</select> IS_BUDGET,
<select id="selectDept" resultMap="Summary"> TYPE_STATE,
select v.DEPT_CODE SORT
from SER_PROJ_VALUE v from SER_PROJ
join SER_PROJ p on p.ID =v.PROJ_ID and p.STATE = 1 </select>
where 1=1 <select id="selectState" resultMap="ProjectInfo">
<if test="date!=null"> select DISTINCT p.TYPE as EXPONENT_ID,e.EXPONENT_NAME,e.SORT
and v.`DATE`= LEFT(#{date,jdbcType=DECIMAL},4) from ser_proj p
</if> join DIC_EXPONENT e on e.EXPONENT_ID=p.`TYPE` and e.STATE = 1
<if test="budgetType!=null"> where p.`STATE` = 1
and IS_BUDGET&amp;#{budgetType,jdbcType=DECIMAL}>0 <if test="projType!=null">
</if> and p.PROJ_TYPE = #{projType,jdbcType=DECIMAL}
GROUP BY v.DEPT_CODE,v.SORT </if>
order by v.SORT <if test="typeState!=null">
</select> and p.TYPE_STATE = #{typeState,jdbcType=DECIMAL}
</if>
order by e.SORT
</select>
<select id="selectDept" resultMap="Summary">
select v.DEPT_CODE
from SER_PROJ_VALUE v
join SER_PROJ p on p.ID =v.PROJ_ID and p.STATE = 1
where 1=1
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 = v.DEPT_CODE
)
<if test="date!=null">
and v.`DATE`= LEFT(#{date,jdbcType=DECIMAL},4)
</if>
<if test="budgetType!=null">
and IS_BUDGET&amp;#{budgetType,jdbcType=DECIMAL}>0
</if>
GROUP BY v.DEPT_CODE,v.SORT
order by v.SORT
</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