2024-10-29 10:50:16 +08:00
<?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">
2024-11-12 16:39:53 +08:00
<mapper namespace= "com.electromagnetic.industry.software.data.manage.repository.dao.EDDataMapper" >
<insert id= "createFolder" parameterType= "com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.EDDataInfo" >
<selectKey keyProperty= "id" order= "AFTER" resultType= "java.lang.Long" >
SELECT LAST_INSERT_ID()
</selectKey>
insert into ed_data_info (id, category_id,
data_id, data_no, data_name,
data_type, file_type,
version,content, implant_json, data_status,
creator, creator_name, gmt_create,
modifier, modifier_name, gmt_modified,
effect_flag
)
values (#{id,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR},
#{dataId,jdbcType=VARCHAR}, #{dataNo,jdbcType=VARCHAR}, #{dataName,jdbcType=VARCHAR},
#{dataType,jdbcType=VARCHAR}, #{fileType,jdbcType=VARCHAR},
#{version,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR}, #{implantJson,jdbcType=VARCHAR}, #{dataStatus,jdbcType=VARCHAR},
#{creator,jdbcType=VARCHAR}, #{creatorName,jdbcType=VARCHAR}, now(), #{modifier,jdbcType=VARCHAR},
#{modifierName,jdbcType=VARCHAR},now(),1
)
</insert>
2024-11-13 16:46:01 +08:00
<select id= "getDataInfoList" resultMap= "EDDataMapper" parameterType= "com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.EDDataParams" >
SELECT
data.id,
data.category_id,
data.data_id,
data.data_no,
data.data_name,
data.data_type,
data.file_type,
data.version,
data.content,
data.implant_json,
data.data_status,
data.creator, card.creator_name, card.gmt_create, card.modifier,
data.modifier_name,card.gmt_modified,card.effect_flag
FROM
ed_data_info data
<where >
data.effect_flag = 1
<if test= "parentId!=null and parentId!=''" >
and data.category_id='${parentId}'
</if>
<if test= "keyWord!=null and keyWord!=''" >
and data.data_name LIKE '%${keyWord}%'
</if>
</where>
GROUP BY data.id
order by data.gmt_modified asc
</select>
2024-11-12 16:39:53 +08:00
</mapper>
<!--
2024-10-29 10:50:16 +08:00
<mapper namespace= "com.electromagnetic.industry.software.data.manage.repository.dao.IndicatorCardMapper" >
2024-11-12 16:39:53 +08:00
<resultMap id= "BaseResultMap" type= "com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.IndicatorCard" >
<id column= "id" jdbcType= "BIGINT" property= "id" />
<result column= "indicator_card_no" jdbcType= "VARCHAR" property= "indicatorCardNo" />
<result column= "indicator_card_name" jdbcType= "VARCHAR" property= "indicatorCardName" />
<result column= "indicator_card_type" jdbcType= "VARCHAR" property= "indicatorCardType" />
<result column= "dataservice_no" jdbcType= "VARCHAR" property= "dataserviceNo" />
<result column= "dataservice_name" jdbcType= "VARCHAR" property= "dataserviceName" />
<result column= "indicator_card_order" jdbcType= "INTEGER" property= "indicatorCardOrder" />
<result column= "access_control" jdbcType= "VARCHAR" property= "accessControl" />
<result column= "home_display" jdbcType= "VARCHAR" property= "homeDisplay" />
<result column= "warning_flag" jdbcType= "VARCHAR" property= "warningFlag" />
<result column= "template_nos" jdbcType= "VARCHAR" property= "templateNos" />
<result column= "card_status" jdbcType= "VARCHAR" property= "cardStatus" />
<result column= "creator" jdbcType= "VARCHAR" property= "creator" />
<result column= "creator_name" jdbcType= "VARCHAR" property= "creatorName" />
<result column= "gmt_create" jdbcType= "TIMESTAMP" property= "gmtCreate" />
<result column= "modifier" jdbcType= "VARCHAR" property= "modifier" />
<result column= "modifier_name" jdbcType= "VARCHAR" property= "modifierName" />
<result column= "gmt_modified" jdbcType= "TIMESTAMP" property= "gmtModified" />
<result column= "effect_flag" jdbcType= "TINYINT" property= "effectFlag" />
</resultMap>
2024-10-29 10:50:16 +08:00
2024-11-12 16:39:53 +08:00
<resultMap id= "IndicatorCardMap" type= "com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.IndicatorCardExtend" >
<id column= "id" jdbcType= "BIGINT" property= "id" />
<result column= "indicator_card_no" jdbcType= "VARCHAR" property= "indicatorCardNo" />
<result column= "indicator_card_name" jdbcType= "VARCHAR" property= "indicatorCardName" />
<result column= "indicator_card_type" jdbcType= "VARCHAR" property= "indicatorCardType" />
<result column= "dataservice_no" jdbcType= "VARCHAR" property= "dataserviceNo" />
<result column= "dataservice_name" jdbcType= "VARCHAR" property= "dataserviceName" />
<result column= "indicator_card_order" jdbcType= "INTEGER" property= "indicatorCardOrder" />
<result column= "access_control" jdbcType= "VARCHAR" property= "accessControl" />
<result column= "home_display" jdbcType= "VARCHAR" property= "homeDisplay" />
<result column= "warning_flag" jdbcType= "VARCHAR" property= "warningFlag" />
<result column= "template_nos" jdbcType= "VARCHAR" property= "templateNos" />
<result column= "home" jdbcType= "VARCHAR" property= "home" />
<result column= "warning" jdbcType= "VARCHAR" property= "warning" />
<result column= "card_status" jdbcType= "VARCHAR" property= "cardStatus" />
<result column= "creator" jdbcType= "VARCHAR" property= "creator" />
<result column= "creator_name" jdbcType= "VARCHAR" property= "creatorName" />
<result column= "gmt_create" jdbcType= "TIMESTAMP" property= "gmtCreate" />
<result column= "modifier" jdbcType= "VARCHAR" property= "modifier" />
<result column= "modifier_name" jdbcType= "VARCHAR" property= "modifierName" />
<result column= "gmt_modified" jdbcType= "TIMESTAMP" property= "gmtModified" />
<result column= "effect_flag" jdbcType= "TINYINT" property= "effectFlag" />
<result column= "renew_type" jdbcType= "VARCHAR" property= "renewType" />
<result column= "warning_indicator" jdbcType= "VARCHAR" property= "warningIndicator" />
</resultMap>
<sql id= "Base_Column_List" >
2024-10-29 10:50:16 +08:00
id, indicator_card_no, indicator_card_name, indicator_card_type, dataservice_no,
dataservice_name, indicator_card_order, access_control,home_display, warning_flag,
template_nos,card_status, creator, creator_name, gmt_create, modifier, modifier_name, gmt_modified,
effect_flag
</sql>
2024-11-12 16:39:53 +08:00
<select id= "selectByPrimaryKey" parameterType= "java.lang.String" resultMap= "BaseResultMap" >
select
<include refid= "Base_Column_List" />
from dataplatform_wisdom_indicator_card
where indicator_card_no = #{indicatorCardNo,jdbcType=VARCHAR} and card_status='Enable' and effect_flag = 1
</select>
<select id= "getIndicatorCardOrder"
parameterType="com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.IndicatorCardParams"
resultMap="BaseResultMap">
select
<include refid= "Base_Column_List" />
from dataplatform_wisdom_indicator_card
where effect_flag = 1
order by indicator_card_order desc
limit 1
</select>
<select id= "getIndicatorCardListConfig" resultMap= "IndicatorCardMap" parameterType= "com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.parames.IndicatorCardParams" >
SELECT
card.id,
card.indicator_card_no,
card.indicator_card_name,
card.indicator_card_type,
card.dataservice_no,
card.dataservice_name,
card.indicator_card_order,
card.access_control,
card.home_display,
card.warning_flag,
card.template_nos,
card.card_status,
card.creator, card.creator_name, card.gmt_create, card.modifier,
card.modifier_name,card.gmt_modified,card.effect_flag,indictor.renew_type,indictor.warning_indicator,
( SELECT config_status FROM dataplatform_wisdom_user_resource_config WHERE resource_no = card.indicator_card_no AND config_type = 'indicatorCard' and member_code=#{userId,jdbcType=VARCHAR} limit 1) AS home,
( SELECT config_status FROM dataplatform_wisdom_indicator_org_config WHERE indicator_no = indictor.indicator_no AND config_type = 'warning' and org_code=#{orgCode,jdbcType=VARCHAR} limit 1) AS warning
FROM
dataplatform_wisdom_indicator_card card LEFT JOIN dataplatform_wisdom_user_resource_config config on config.resource_no=card.indicator_card_no
and config.member_code = #{userId,jdbcType=VARCHAR} and config.config_type = 'indicatorCard'
left JOIN dataplatform_wisdom_indicator indictor on indictor.indicator_card_no=card.indicator_card_no
and indictor.indicator_type='host'
<where >
card.effect_flag = 1
<if test= "indicatorCardType!=null and indicatorCardType!='' and indicatorCardType!='ALL'" >
and card.indicator_card_type='${indicatorCardType}'
</if>
<if test= "accessControl!=null and accessControl!=''" >
and card.access_control LIKE '%${accessControl}%'
</if>
<if test= "indicatorName!=null and indicatorName!=''" >
and indictor.indicator_name LIKE '%${indicatorName}%'
</if>
<if test= "cardStatus!=null and cardStatus!=''" >
and card.card_status='${cardStatus}'
</if>
<if test= "homeType!=null and homeType!=''" >
and ( config.resource_no is null or ( config.member_code=#{userId,jdbcType=VARCHAR} and config.config_status='display'))
</if>
</where>
GROUP BY card.id
order by card.indicator_card_order asc
</select>
<insert id= "insert" parameterType= "com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.IndicatorCard" >
<selectKey keyProperty= "id" order= "AFTER" resultType= "java.lang.Long" >
SELECT LAST_INSERT_ID()
</selectKey>
insert into dataplatform_wisdom_indicator_card (indicator_card_no, indicator_card_name,
indicator_card_type, dataservice_no, dataservice_name,
indicator_card_order, access_control,
home_display,warning_flag, template_nos, creator,
creator_name, gmt_create, modifier,
modifier_name, gmt_modified, effect_flag
)
values (#{indicatorCardNo,jdbcType=VARCHAR}, #{indicatorCardName,jdbcType=VARCHAR},
#{indicatorCardType,jdbcType=VARCHAR}, #{dataserviceNo,jdbcType=VARCHAR}, #{dataserviceName,jdbcType=VARCHAR},
#{indicatorCardOrder,jdbcType=VARCHAR}, #{accessControl,jdbcType=VARCHAR},
#{homeDisplay,jdbcType=VARCHAR},#{warningFlag,jdbcType=VARCHAR}, #{templateNos,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR},
#{creatorName,jdbcType=VARCHAR}, now(), #{modifier,jdbcType=VARCHAR},
#{modifierName,jdbcType=VARCHAR},now(),1
)
</insert>
<update id= "updateByPrimaryKeySelective" parameterType= "com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.IndicatorCard" >
update dataplatform_wisdom_indicator_card
<set >
<if test= "indicatorCardName != null" >
indicator_card_name = #{indicatorCardName,jdbcType=VARCHAR},
</if>
<if test= "indicatorCardType != null" >
indicator_card_type = #{indicatorCardType,jdbcType=VARCHAR},
</if>
<if test= "dataserviceNo != null" >
dataservice_no = #{dataserviceNo,jdbcType=VARCHAR},
</if>
<if test= "dataserviceName != null" >
dataservice_name = #{dataserviceName,jdbcType=VARCHAR},
</if>
<if test= "indicatorCardOrder != null" >
indicator_card_order = #{indicatorCardOrder,jdbcType=INTEGER},
</if>
<if test= "accessControl != null" >
access_control = #{accessControl,jdbcType=VARCHAR},
</if>
<if test= "homeDisplay != null" >
home_display = #{homeDisplay,jdbcType=VARCHAR},
</if>
<if test= "warningFlag != null" >
warning_flag = #{warningFlag,jdbcType=VARCHAR},
</if>
<if test= "templateNos != null" >
template_nos = #{templateNos,jdbcType=VARCHAR},
</if>
<if test= "modifier != null" >
modifier = #{modifier,jdbcType=VARCHAR},
</if>
<if test= "modifierName != null" >
modifier_name = #{modifierName,jdbcType=VARCHAR},
</if>
gmt_modified = now()
</set>
where indicator_card_no = #{indicatorCardNo,jdbcType=VARCHAR} and effect_flag = 1
</update>
2024-10-29 10:50:16 +08:00
2024-11-12 16:39:53 +08:00
<update id= "updateStatusOrEffect" parameterType= "com.electromagnetic.industry.software.data.manage.domain.boardservice.indicator.model.IndicatorCard" >
update dataplatform_wisdom_indicator_card
<set >
<if test= "cardStatus != null" >
card_status = #{cardStatus,jdbcType=VARCHAR},
</if>
<if test= "effectFlag != null" >
effect_flag = #{effectFlag,jdbcType=VARCHAR},
</if>
gmt_modified = now()
</set>
where indicator_card_no = #{indicatorCardNo,jdbcType=VARCHAR} and effect_flag = 1
</update>
2024-10-29 10:50:16 +08:00
2024-11-12 16:39:53 +08:00
<update id= "updateIndicatorCardOrder" parameterType= "java.util.List" >
<foreach collection= "list" separator= ";" item= "item" >
update dataplatform_wisdom_indicator_card
set indicator_card_order = #{item.indicatorCardOrder,jdbcType=INTEGER}
where indicator_card_no = #{item.indicatorCardNo,jdbcType=VARCHAR} and effect_flag = 1
</foreach>
</update>
</mapper>
-->