|
@ -35,6 +35,39 @@ |
|
|
<result property="userId" column="user_id" /> |
|
|
<result property="userId" column="user_id" /> |
|
|
</resultMap> |
|
|
</resultMap> |
|
|
|
|
|
|
|
|
|
|
|
<resultMap type="com.lzbi.targetFolder.domain.DcBaseAssetTargetExpand" id="DcBaseAssetTargetExpandResult"> |
|
|
|
|
|
<result property="id" column="id" /> |
|
|
|
|
|
<result property="assetCode" column="asset_code" /> |
|
|
|
|
|
<result property="assetId" column="asset_id" /> |
|
|
|
|
|
<result property="targetModelCode" column="target_model_code" /> |
|
|
|
|
|
<result property="targetName" column="target_name" /> |
|
|
|
|
|
<result property="targetNameAlias" column="target_name_alias" /> |
|
|
|
|
|
<result property="targetCode" column="target_code" /> |
|
|
|
|
|
<result property="fieldCode" column="field_code" /> |
|
|
|
|
|
<result property="limitUp" column="limit_up" /> |
|
|
|
|
|
<result property="limitDown" column="limit_down" /> |
|
|
|
|
|
<result property="valueBase" column="value_base" /> |
|
|
|
|
|
<result property="flagAvg" column="flag_avg" /> |
|
|
|
|
|
<result property="flagSum" column="flag_sum" /> |
|
|
|
|
|
<result property="flagCompute" column="flag_compute" /> |
|
|
|
|
|
<result property="tenantId" column="tenant_id" /> |
|
|
|
|
|
<result property="revision" column="revision" /> |
|
|
|
|
|
<result property="createdBy" column="created_by" /> |
|
|
|
|
|
<result property="createdTime" column="created_time" /> |
|
|
|
|
|
<result property="updatedBy" column="updated_by" /> |
|
|
|
|
|
<result property="updatedTime" column="updated_time" /> |
|
|
|
|
|
<result property="deleteBy" column="delete_by" /> |
|
|
|
|
|
<result property="deleteTime" column="delete_time" /> |
|
|
|
|
|
<result property="sort" column="sort" /> |
|
|
|
|
|
<result property="fieldName" column="field_name" /> |
|
|
|
|
|
<result property="columnType" column="column_type" /> |
|
|
|
|
|
<result property="fieldUnit" column="field_unit" /> |
|
|
|
|
|
<result property="deptId" column="dept_id" /> |
|
|
|
|
|
<result property="userId" column="user_id" /> |
|
|
|
|
|
<result property="modelName" column="model_name" /> |
|
|
|
|
|
<result property="modelValue" column="model_value" /> |
|
|
|
|
|
</resultMap> |
|
|
|
|
|
|
|
|
<sql id="selectDcBaseAssetTargetVo"> |
|
|
<sql id="selectDcBaseAssetTargetVo"> |
|
|
select id, asset_code, asset_id, target_model_code, target_name, target_name_alias, target_code, field_code, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, sort, field_name, column_type, field_unit, dept_id, user_id from dc_base_asset_target |
|
|
select id, asset_code, asset_id, target_model_code, target_name, target_name_alias, target_code, field_code, limit_up, limit_down, value_base, flag_avg, flag_sum, flag_compute, tenant_id, revision, created_by, created_time, updated_by, updated_time, delete_by, delete_time, sort, field_name, column_type, field_unit, dept_id, user_id from dc_base_asset_target |
|
|
</sql> |
|
|
</sql> |
|
@ -182,4 +215,77 @@ |
|
|
#{id} |
|
|
#{id} |
|
|
</foreach> |
|
|
</foreach> |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectDcBaseAssetTargetExpandList" resultMap="DcBaseAssetTargetExpandResult"> |
|
|
|
|
|
SELECT |
|
|
|
|
|
t_table.id, |
|
|
|
|
|
t_table.asset_code, |
|
|
|
|
|
t_table.asset_id, |
|
|
|
|
|
t_table.target_model_code, |
|
|
|
|
|
t_table.target_name, |
|
|
|
|
|
t_table.target_name_alias, |
|
|
|
|
|
t_table.target_code, |
|
|
|
|
|
t_table.field_code, |
|
|
|
|
|
t_table.limit_up, |
|
|
|
|
|
t_table.limit_down, |
|
|
|
|
|
t_table.value_base, |
|
|
|
|
|
t_table.flag_avg, |
|
|
|
|
|
t_table.flag_sum, |
|
|
|
|
|
t_table.flag_compute, |
|
|
|
|
|
t_table.tenant_id, |
|
|
|
|
|
t_table.revision, |
|
|
|
|
|
t_table.created_by, |
|
|
|
|
|
t_table.created_time, |
|
|
|
|
|
t_table.updated_by, |
|
|
|
|
|
t_table.updated_time, |
|
|
|
|
|
t_table.delete_by, |
|
|
|
|
|
t_table.delete_time, |
|
|
|
|
|
t_table.sort, |
|
|
|
|
|
t_table.field_name, |
|
|
|
|
|
t_table.column_type, |
|
|
|
|
|
t_table.field_unit, |
|
|
|
|
|
t_table.dept_id, |
|
|
|
|
|
t_table.user_id, |
|
|
|
|
|
CASE |
|
|
|
|
|
WHEN (t_model.target_model_code IS NOT NULL AND t_model.target_model_code != '') THEN t_model.target_model_name |
|
|
|
|
|
ELSE p_model.param_model_name |
|
|
|
|
|
END AS model_name, |
|
|
|
|
|
t_table.target_model_code AS model_value |
|
|
|
|
|
FROM |
|
|
|
|
|
dc_base_asset_target t_table |
|
|
|
|
|
LEFT JOIN |
|
|
|
|
|
dc_base_param_model p_model ON p_model.param_model_code = t_table.target_model_code |
|
|
|
|
|
AND p_model.flag_status = 1 |
|
|
|
|
|
LEFT JOIN |
|
|
|
|
|
dc_base_target_model t_model ON t_model.target_model_code = t_table.target_model_code |
|
|
|
|
|
<where> |
|
|
|
|
|
(p_model.param_model_code IS NOT NULL |
|
|
|
|
|
OR t_model.target_model_code IS NOT NULL ) |
|
|
|
|
|
<if test="assetCode != null and assetCode != ''"> and t_table.asset_code = #{assetCode}</if> |
|
|
|
|
|
<if test="assetId != null"> and t_table.asset_id = #{assetId}</if> |
|
|
|
|
|
<if test="targetModelCode != null and targetModelCode != ''"> and t_table.target_model_code = #{targetModelCode}</if> |
|
|
|
|
|
<if test="targetName != null and targetName != ''"> and t_table.target_name like concat('%', #{targetName}, '%')</if> |
|
|
|
|
|
<if test="targetNameAlias != null and targetNameAlias != ''"> and t_table.target_name_alias = #{targetNameAlias}</if> |
|
|
|
|
|
<if test="targetCode != null and targetCode != ''"> and t_table.target_code = #{targetCode}</if> |
|
|
|
|
|
<if test="fieldCode != null and fieldCode != ''"> and t_table.field_code = #{fieldCode}</if> |
|
|
|
|
|
<if test="limitUp != null"> and t_table.limit_up = #{limitUp}</if> |
|
|
|
|
|
<if test="limitDown != null"> and t_table.limit_down = #{limitDown}</if> |
|
|
|
|
|
<if test="valueBase != null"> and t_table.value_base = #{valueBase}</if> |
|
|
|
|
|
<if test="flagAvg != null and flagAvg != ''"> and t_table.flag_avg = #{flagAvg}</if> |
|
|
|
|
|
<if test="flagSum != null and flagSum != ''"> and t_table.flag_sum = #{flagSum}</if> |
|
|
|
|
|
<if test="flagCompute != null and flagCompute != ''"> and t_table.flag_compute = #{flagCompute}</if> |
|
|
|
|
|
<if test="sort != null and sort != ''"> and t_table.sort = #{sort}</if> |
|
|
|
|
|
<if test="fieldName != null and fieldName != ''"> and t_table.field_name like concat('%', #{fieldName}, '%')</if> |
|
|
|
|
|
<if test="columnType != null and columnType != ''"> and t_table.column_type = #{columnType}</if> |
|
|
|
|
|
<if test="fieldUnit != null and fieldUnit != ''"> and t_table.field_unit = #{fieldUnit}</if> |
|
|
|
|
|
<if test="deptId != null"> and t_table.dept_id = #{deptId}</if> |
|
|
|
|
|
<if test="userId != null"> and t_table.user_id = #{userId}</if> |
|
|
|
|
|
<if test="modelName != null and modelName != ''"> |
|
|
|
|
|
and ( |
|
|
|
|
|
p_model.param_model_name like concat('%', #{modelName}, '%') |
|
|
|
|
|
or t_model.target_model_name like concat('%', #{modelName}, '%') |
|
|
|
|
|
</if> |
|
|
|
|
|
</where> |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
</mapper> |
|
|
</mapper> |