|
|
@ -12,7 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="targetName" column="target_name" /> |
|
|
|
<result property="targetNameAlias" column="target_name_alias" /> |
|
|
|
<result property="targetCode" column="target_code" /> |
|
|
|
<result property="targetField" column="target_field" /> |
|
|
|
<result property="fieldCode" column="field_code" /> |
|
|
|
<result property="limitUp" column="limit_up" /> |
|
|
|
<result property="limitDown" column="limit_down" /> |
|
|
|
<result property="valueBase" column="value_base" /> |
|
|
@ -28,29 +28,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<result property="deleteBy" column="delete_by" /> |
|
|
|
<result property="deleteTime" column="delete_time" /> |
|
|
|
<result property="sort" column="sort" /> |
|
|
|
<result property="targetFieldName" column="target_field_name" /> |
|
|
|
<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" /> |
|
|
|
</resultMap> |
|
|
|
|
|
|
|
<sql id="selectDcBaseAssetTargetVo"> |
|
|
|
select id, asset_code, asset_id, target_model_code, target_name, target_name_alias, target_code, target_field, 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, target_field_name, column_type, field_unit 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> |
|
|
|
|
|
|
|
<select id="selectDcBaseAssetTargetList" parameterType="DcBaseAssetTarget" resultMap="DcBaseAssetTargetResult"> |
|
|
|
<include refid="selectDcBaseAssetTargetVo"/> |
|
|
|
<where> |
|
|
|
<if test="assetCode != null and assetCode != ''"> and asset_code = #{assetCode}</if> |
|
|
|
<if test="assetId != null "> and asset_id = #{assetId}</if> |
|
|
|
<if test="targetModelCode != null and targetModelCode != ''"> and target_model_code = #{targetModelCode}</if> |
|
|
|
<if test="targetName != null and targetName != ''"> and target_name like concat('%', #{targetName}, '%')</if> |
|
|
|
<if test="targetNameAlias != null and targetNameAlias != ''"> and target_name_alias = #{targetNameAlias}</if> |
|
|
|
<if test="targetCode != null and targetCode != ''"> and target_code = #{targetCode}</if> |
|
|
|
<if test="targetField != null and targetField != ''"> and target_field = #{targetField}</if> |
|
|
|
<if test="assetCode != null "> and asset_code = #{assetCode}</if> |
|
|
|
<if test="fieldCode != null and fieldCode != ''"> and field_code = #{fieldCode}</if> |
|
|
|
<if test="limitUp != null "> and limit_up = #{limitUp}</if> |
|
|
|
<if test="limitDown != null "> and limit_down = #{limitDown}</if> |
|
|
|
<if test="valueBase != null "> and value_base = #{valueBase}</if> |
|
|
|
<if test="flagAvg != null and flagAvg != ''"> and flag_avg = #{flagAvg}</if> |
|
|
|
<if test="flagSum != null and flagSum != ''"> and flag_sum = #{flagSum}</if> |
|
|
|
<if test="flagCompute != null and flagCompute != ''"> and flag_compute = #{flagCompute}</if> |
|
|
|
<if test="sort != null and sort != ''"> and sort = #{sort}</if> |
|
|
|
<if test="fieldName != null and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if> |
|
|
|
<if test="columnType != null and columnType != ''"> and column_type = #{columnType}</if> |
|
|
|
<if test="fieldUnit != null and fieldUnit != ''"> and field_unit = #{fieldUnit}</if> |
|
|
|
<if test="deptId != null "> and dept_id = #{deptId}</if> |
|
|
|
<if test="userId != null "> and user_id = #{userId}</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectDcBaseAssetTargetById" parameterType="Long" resultMap="DcBaseAssetTargetResult"> |
|
|
|
<include refid="selectDcBaseAssetTargetVo"/> |
|
|
|
where id = #{id} |
|
|
@ -65,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="targetName != null">target_name,</if> |
|
|
|
<if test="targetNameAlias != null">target_name_alias,</if> |
|
|
|
<if test="targetCode != null">target_code,</if> |
|
|
|
<if test="targetField != null">target_field,</if> |
|
|
|
<if test="fieldCode != null">field_code,</if> |
|
|
|
<if test="limitUp != null">limit_up,</if> |
|
|
|
<if test="limitDown != null">limit_down,</if> |
|
|
|
<if test="valueBase != null">value_base,</if> |
|
|
@ -81,9 +94,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="deleteBy != null">delete_by,</if> |
|
|
|
<if test="deleteTime != null">delete_time,</if> |
|
|
|
<if test="sort != null">sort,</if> |
|
|
|
<if test="targetFieldName != null">target_field_name,</if> |
|
|
|
<if test="fieldName != null">field_name,</if> |
|
|
|
<if test="columnType != null">column_type,</if> |
|
|
|
<if test="fieldUnit != null">field_unit,</if> |
|
|
|
<if test="deptId != null">dept_id,</if> |
|
|
|
<if test="userId != null">user_id,</if> |
|
|
|
</trim> |
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|
|
|
<if test="assetCode != null">#{assetCode},</if> |
|
|
@ -92,7 +107,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="targetName != null">#{targetName},</if> |
|
|
|
<if test="targetNameAlias != null">#{targetNameAlias},</if> |
|
|
|
<if test="targetCode != null">#{targetCode},</if> |
|
|
|
<if test="targetField != null">#{targetField},</if> |
|
|
|
<if test="fieldCode != null">#{fieldCode},</if> |
|
|
|
<if test="limitUp != null">#{limitUp},</if> |
|
|
|
<if test="limitDown != null">#{limitDown},</if> |
|
|
|
<if test="valueBase != null">#{valueBase},</if> |
|
|
@ -108,9 +123,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="deleteBy != null">#{deleteBy},</if> |
|
|
|
<if test="deleteTime != null">#{deleteTime},</if> |
|
|
|
<if test="sort != null">#{sort},</if> |
|
|
|
<if test="targetFieldName != null">#{targetFieldName},</if> |
|
|
|
<if test="fieldName != null">#{fieldName},</if> |
|
|
|
<if test="columnType != null">#{columnType},</if> |
|
|
|
<if test="fieldUnit != null">#{fieldUnit},</if> |
|
|
|
<if test="deptId != null">#{deptId},</if> |
|
|
|
<if test="userId != null">#{userId},</if> |
|
|
|
</trim> |
|
|
|
</insert> |
|
|
|
|
|
|
@ -123,7 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="targetName != null">target_name = #{targetName},</if> |
|
|
|
<if test="targetNameAlias != null">target_name_alias = #{targetNameAlias},</if> |
|
|
|
<if test="targetCode != null">target_code = #{targetCode},</if> |
|
|
|
<if test="targetField != null">target_field = #{targetField},</if> |
|
|
|
<if test="fieldCode != null">field_code = #{fieldCode},</if> |
|
|
|
<if test="limitUp != null">limit_up = #{limitUp},</if> |
|
|
|
<if test="limitDown != null">limit_down = #{limitDown},</if> |
|
|
|
<if test="valueBase != null">value_base = #{valueBase},</if> |
|
|
@ -139,9 +156,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
<if test="deleteBy != null">delete_by = #{deleteBy},</if> |
|
|
|
<if test="deleteTime != null">delete_time = #{deleteTime},</if> |
|
|
|
<if test="sort != null">sort = #{sort},</if> |
|
|
|
<if test="targetFieldName != null">target_field_name = #{targetFieldName},</if> |
|
|
|
<if test="fieldName != null">field_name = #{fieldName},</if> |
|
|
|
<if test="columnType != null">column_type = #{columnType},</if> |
|
|
|
<if test="fieldUnit != null">field_unit = #{fieldUnit},</if> |
|
|
|
<if test="deptId != null">dept_id = #{deptId},</if> |
|
|
|
<if test="userId != null">user_id = #{userId},</if> |
|
|
|
</trim> |
|
|
|
where id = #{id} |
|
|
|
</update> |
|
|
|