|
|
@@ -5,7 +5,7 @@
|
|
|
<!-- 通用设置 -->
|
|
|
<!-- 通用查询列 -->
|
|
|
<sql id="Base_Column_List">
|
|
|
- activity_id, activity_name, activity_describe, activity_type, activity_status, begin_date, end_date, flg_banner, annex_paths, activity_url, grade_code, fun_id, app_code, cp_ids, display_no, flg_valid, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user
|
|
|
+ activity_id, activity_name, activity_describe, activity_type, activity_status, begin_date, end_date, flg_banner, annex_paths, activity_url, grade_code, fun_id, app_code, cp_ids, display_no, flg_valid, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user,fun_ids,
|
|
|
</sql>
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
@@ -33,6 +33,7 @@
|
|
|
<result column="op_app_code" property="opAppCode"/>
|
|
|
<result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
<result column="op_db_user" property="opDbUser"/>
|
|
|
+ <result column="fun_ids" property="funIds" typeHandler="UuidListTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
|
@@ -131,7 +132,8 @@
|
|
|
tma.op_update_user_id,
|
|
|
tma.op_app_code,
|
|
|
tma.op_timestamp,
|
|
|
- tma.op_db_user
|
|
|
+ tma.op_db_user,
|
|
|
+ tma.fun_ids
|
|
|
</sql>
|
|
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
|
@@ -160,6 +162,7 @@
|
|
|
<result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
<result column="op_db_user" property="opDbUser"/>
|
|
|
<result column="cp_name" property="cpName"/>
|
|
|
+ <result column="fun_ids" property="funIds" typeHandler="UuidListTypeHandler"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
|
@@ -248,9 +251,21 @@
|
|
|
<include refid="Base_Column_List_list"/>
|
|
|
, sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "activityTypeName"
|
|
|
, sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "activityStatusName"
|
|
|
+ , tg.grade_name as "gradeName"
|
|
|
+ ,case when
|
|
|
+ tma.fun_ids is not null
|
|
|
+ then
|
|
|
+ (select string_agg( tf.fun_name,' | ')
|
|
|
+ from sys.t_function as tf
|
|
|
+ where tf.fun_uuid = any( tma.fun_ids)
|
|
|
+ )
|
|
|
+ else tf.fun_name
|
|
|
+ end as "funName"
|
|
|
FROM dkic_a.t_mst_activity as tma
|
|
|
left JOIN sys.t_data_kind as tdk1 on tma.activity_type = tdk1.kind_code
|
|
|
left JOIN sys.t_data_kind as tdk2 on tma.activity_status = tdk2.kind_code
|
|
|
+ left JOIN sys.t_grade as tg on tma.grade_code = tg.grade_code
|
|
|
+ left JOIN sys.t_function as tf on tma.fun_id = tf.fun_uuid
|
|
|
<include refid="Condition_list"/>
|
|
|
order by tma.display_no
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
@@ -273,7 +288,20 @@
|
|
|
,(SELECT COALESCE(array_to_string(array_agg(cp_name), ','),'')
|
|
|
FROM dkic_a.t_a_company
|
|
|
WHERE cp_id = ANY (tma.cp_ids)) AS cp_name
|
|
|
+ ,case when
|
|
|
+ tma.fun_ids is not null
|
|
|
+ then
|
|
|
+ (select string_agg( tf.fun_name,' | ')
|
|
|
+ from sys.t_function as tf
|
|
|
+ where tf.fun_uuid = any( tma.fun_ids)
|
|
|
+ )
|
|
|
+ else tf.fun_name
|
|
|
+ end as "funName"
|
|
|
FROM dkic_a.t_mst_activity as tma
|
|
|
+ left JOIN sys.t_data_kind as tdk1 on tma.activity_type = tdk1.kind_code
|
|
|
+ left JOIN sys.t_data_kind as tdk2 on tma.activity_status = tdk2.kind_code
|
|
|
+ left JOIN sys.t_grade as tg on tma.grade_code = tg.grade_code
|
|
|
+ left JOIN sys.t_function as tf on tma.fun_id = tf.fun_uuid
|
|
|
WHERE activity_id = #{activityId}::uuid
|
|
|
</select>
|
|
|
|