计划库新增字段及逻辑

This commit is contained in:
yuezhihang
2021-12-25 16:47:50 +08:00
parent f999a8fd77
commit c7b0affb87
16 changed files with 461 additions and 5 deletions
@@ -0,0 +1,18 @@
<?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.adc.da.slrs.esMatingRelation.dao.EsMatingRelationDao">
<select id="getDatas" resultType="com.adc.da.slrs.esMatingRelation.entity.EsMatingRelation">
select es_mating_relation.id , es_mating_relation.stand_id , es_mating_relation.stand_type,sar_standards_info.STAND_NAME as standName,
concat(sar_standards_info.STAND_SORT,concat(' ',concat(concat(sar_standards_info.STAND_NUMBER,concat('-',sar_standards_info.STAND_YEAR))))) as standNumber
from es_mating_relation
left join sar_standards_info on es_mating_relation.stand_id = sar_standards_info.ID
where es_mating_relation.es_id=#{id}
union all
select es_mating_relation.id , es_mating_relation.stand_id , es_mating_relation.stand_type,sar_bussioness_stand.STAND_NAME as standName,
sar_bussioness_stand.STAND_CODE as standNumber
from es_mating_relation
left join sar_bussioness_stand on es_mating_relation.stand_id = sar_bussioness_stand.ID
where es_mating_relation.es_id=#{id}
</select>
</mapper>
@@ -18,8 +18,37 @@
draft_time,
release_time,
unit,
rqb_json as rqbJson,
ts_json as tsJson,
area,
qblb,
(select sar_bussioness_stand.STAND_NAME from sar_bussioness_stand where sar_bussioness_stand.ID = rqb_json )as rqbName,
(select sar_bussioness_stand.STAND_CODE from sar_bussioness_stand where sar_bussioness_stand.ID = rqb_json )as rqbCode,
(select group_concat(ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit)) as unitName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,drafter) ) as drafterName,
(SELECT GROUP_CONCAT(DICTIONARY_NAME) from ts_dictionary WHERE find_in_set(ts_dictionary.DICTIONARY_CODE,tsJson) ) as tsJsonName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,res_person) ) as res_personName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,wg_leader) ) as wg_leaderName
</sql>
<sql id="BaseInfoList">
id,
es_name,
plan_status,
revise_status,
drafter,
res_person,
wg_leader,
draft_time,
release_time,
unit,
rqb_json as rqbJson,
ts_json as tsJson,
area,
qblb,
(select group_concat(ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit)) as unitName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,drafter) ) as drafterName,
(SELECT GROUP_CONCAT(ts_dictype.DIC_TYPE_NAME) from ts_dictype WHERE find_in_set(ts_dictype.DIC_TYPE_CODE,area) ) as areaName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,res_person) ) as res_personName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,wg_leader) ) as wg_leaderName
</sql>
@@ -34,6 +63,31 @@
<result property="draftTime" column="draft_time"></result>
<result property="releaseTime" column="release_time"></result>
<result property="unit" column="unit"></result>
<result property="area" column="area"></result>
<result property="rqbJson" column="rqb_json"></result>
<result property="tsJson" column="ts_json"></result>
<result property="qblb" column="qblb"></result>
<association property="esMatingRelations" javaType="java.util.List" column="id" select="com.adc.da.slrs.esMatingRelation.dao.EsMatingRelationDao.getDatas"/>
<association property="esStandRelations" javaType="java.util.List" column="id" select="com.adc.da.slrs.esStandRelation.dao.EsStandRelationDao.getDatas"/>
</resultMap>
<resultMap id="BaseInfoMapList" type="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan">
<id property="id" column="id"></id>
<result property="esName" column="es_name"></result>
<result property="planStatus" column="plan_status"></result>
<result property="reviseStatus" column="revise_status"></result>
<result property="drafter" column="drafter"></result>
<result property="resPerson" column="res_person"></result>
<result property="wgLeader" column="wg_leader"></result>
<result property="draftTime" column="draft_time"></result>
<result property="releaseTime" column="release_time"></result>
<result property="unit" column="unit"></result>
<result property="area" column="area"></result>
<result property="rqbJson" column="rqb_json"></result>
<result property="tsJson" column="ts_json"></result>
<result property="qblb" column="qblb"></result>
<!--<association property="esMatingRelations" javaType="java.util.List" column="id" select="com.adc.da.slrs.esMatingRelation.dao.EsMatingRelationDao.getDatas"/>-->
<!--<association property="esStandRelations" javaType="java.util.List" column="id" select="com.adc.da.slrs.esStandRelation.dao.EsStandRelationDao.getDatas"/>-->
</resultMap>
<!-- 查询条件-->
<sql id="Conditions">
@@ -41,6 +95,12 @@
<if test="esName != null and esName != ''">
and es_name like concat('%',#{esName},'%')
</if>
<if test="area != null and area != ''">
and area = #{area}
</if>
<if test="qblb != null and qblb != ''">
and qblb = #{qblb}
</if>
<if test="planStatus != null and planStatus != ''">
and plan_status = #{planStatus}
</if>
@@ -75,14 +135,14 @@
<include refid="Conditions"></include>
</select>
<!-- 查询所有-->
<select id="selectAll" resultMap="BaseInfoMap" >
select <include refid="BaseInfo"></include> from es_revise_plan
<select id="selectAll" resultMap="BaseInfoMapList" >
select <include refid="BaseInfoList"></include> from es_revise_plan
<include refid="pages">
</include>
</select>
<!-- 多条件查询-->
<select id="queryAll" parameterType="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan" resultMap="BaseInfoMap">
select <include refid="BaseInfo"></include> from es_revise_plan
<select id="queryAll" parameterType="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan" resultMap="BaseInfoMapList">
select <include refid="BaseInfoList"></include> from es_revise_plan
<include refid="Conditions">
</include>
<include refid="pages">
@@ -127,6 +187,18 @@
<if test="unit != null and unit != ''">
unit = #{unit},
</if>
<if test="rqbJson != null and rqbJson != ''">
rqb_json=#{rqbJson}
</if>
<if test="tsJson != null and tsJson != ''">
ts_json=#{tsJson}
</if>
<if test="area != null and area != ''">
area=#{area}
</if>
<if test="qblb != null and qblb != ''">
qblb=#{qblb}
</if>
</set>
where id = #{id}
</update>
@@ -164,6 +236,18 @@
<if test="unit != null and unit != ''">
unit,
</if>
<if test="rqbJson != null and rqbJson != ''">
rqb_json,
</if>
<if test="tsJson != null and tsJson != ''">
ts_json,
</if>
<if test="area != null and area != ''">
area,
</if>
<if test="qblb != null and qblb != ''">
qblb,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -197,6 +281,18 @@
<if test="unit != null and unit != ''">
#{unit},
</if>
<if test="rqbJson != null and rqbJson != ''">
#{rqbJson},
</if>
<if test="tsJson != null and tsJson != ''">
#{tsJson},
</if>
<if test="area != null and area != ''">
#{area},
</if>
<if test="qblb != null and qblb != ''">
#{qblb},
</if>
</trim>
</insert>
<!-- 删除-->
@@ -0,0 +1,19 @@
<?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.adc.da.slrs.esStandRelation.dao.EsStandRelationDao">
<select id="getDatas" resultType="com.adc.da.slrs.esStandRelation.entity.EsStandRelation">
select es_stand_relation.id , es_stand_relation.stand_id , es_stand_relation.stand_type,sar_standards_info.STAND_NAME as standName,
concat(sar_standards_info.STAND_SORT,concat(' ',concat(concat(sar_standards_info.STAND_NUMBER,concat('-',sar_standards_info.STAND_YEAR))))) as standNumber,
es_stand_relation.is_relate as isRelate,es_stand_relation.technologic,es_stand_relation.use_level as useLevel
from es_stand_relation
left join sar_standards_info on es_stand_relation.stand_id = sar_standards_info.ID
where es_stand_relation.es_id=#{id}
union all
select es_stand_relation.id , es_stand_relation.stand_id , es_stand_relation.stand_type,sar_bussioness_stand.STAND_NAME as standName,
sar_bussioness_stand.STAND_CODE as standNumber,es_stand_relation.is_relate as isRelate,es_stand_relation.technologic,es_stand_relation.use_level as useLevel
from es_stand_relation
left join sar_bussioness_stand on es_stand_relation.stand_id = sar_bussioness_stand.ID
where es_stand_relation.es_id=#{id}
</select>
</mapper>