|
|
|
<?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.lzbi.targetFolder.mapper.DcBaseAssetTargetMapper">
|
|
|
|
|
|
|
|
<resultMap type="com.lzbi.targetFolder.domain.DcBaseAssetTarget" id="DcBaseAssetTargetResult">
|
|
|
|
<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="targetField" column="target_field" />
|
|
|
|
<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="targetFieldName" column="target_field_name" />
|
|
|
|
<result property="columnType" column="column_type" />
|
|
|
|
<result property="fieldUnit" column="field_unit" />
|
|
|
|
</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
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectDcBaseAssetTargetList" parameterType="DcBaseAssetTarget" resultMap="DcBaseAssetTargetResult">
|
|
|
|
<include refid="selectDcBaseAssetTargetVo"/>
|
|
|
|
<where>
|
|
|
|
<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="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="columnType != null and columnType != ''"> and column_type = #{columnType}</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectDcBaseAssetTargetById" parameterType="Long" resultMap="DcBaseAssetTargetResult">
|
|
|
|
<include refid="selectDcBaseAssetTargetVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertDcBaseAssetTarget" parameterType="DcBaseAssetTarget" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into dc_base_asset_target
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="assetCode != null">asset_code,</if>
|
|
|
|
<if test="assetId != null">asset_id,</if>
|
|
|
|
<if test="targetModelCode != null">target_model_code,</if>
|
|
|
|
<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="limitUp != null">limit_up,</if>
|
|
|
|
<if test="limitDown != null">limit_down,</if>
|
|
|
|
<if test="valueBase != null">value_base,</if>
|
|
|
|
<if test="flagAvg != null">flag_avg,</if>
|
|
|
|
<if test="flagSum != null">flag_sum,</if>
|
|
|
|
<if test="flagCompute != null">flag_compute,</if>
|
|
|
|
<if test="tenantId != null">tenant_id,</if>
|
|
|
|
<if test="revision != null">revision,</if>
|
|
|
|
<if test="createdBy != null">created_by,</if>
|
|
|
|
<if test="createdTime != null">created_time,</if>
|
|
|
|
<if test="updatedBy != null">updated_by,</if>
|
|
|
|
<if test="updatedTime != null">updated_time,</if>
|
|
|
|
<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="columnType != null">column_type,</if>
|
|
|
|
<if test="fieldUnit != null">field_unit,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="assetCode != null">#{assetCode},</if>
|
|
|
|
<if test="assetId != null">#{assetId},</if>
|
|
|
|
<if test="targetModelCode != null">#{targetModelCode},</if>
|
|
|
|
<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="limitUp != null">#{limitUp},</if>
|
|
|
|
<if test="limitDown != null">#{limitDown},</if>
|
|
|
|
<if test="valueBase != null">#{valueBase},</if>
|
|
|
|
<if test="flagAvg != null">#{flagAvg},</if>
|
|
|
|
<if test="flagSum != null">#{flagSum},</if>
|
|
|
|
<if test="flagCompute != null">#{flagCompute},</if>
|
|
|
|
<if test="tenantId != null">#{tenantId},</if>
|
|
|
|
<if test="revision != null">#{revision},</if>
|
|
|
|
<if test="createdBy != null">#{createdBy},</if>
|
|
|
|
<if test="createdTime != null">#{createdTime},</if>
|
|
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
|
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
|
|
|
<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="columnType != null">#{columnType},</if>
|
|
|
|
<if test="fieldUnit != null">#{fieldUnit},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateDcBaseAssetTarget" parameterType="DcBaseAssetTarget">
|
|
|
|
update dc_base_asset_target
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="assetCode != null">asset_code = #{assetCode},</if>
|
|
|
|
<if test="assetId != null">asset_id = #{assetId},</if>
|
|
|
|
<if test="targetModelCode != null">target_model_code = #{targetModelCode},</if>
|
|
|
|
<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="limitUp != null">limit_up = #{limitUp},</if>
|
|
|
|
<if test="limitDown != null">limit_down = #{limitDown},</if>
|
|
|
|
<if test="valueBase != null">value_base = #{valueBase},</if>
|
|
|
|
<if test="flagAvg != null">flag_avg = #{flagAvg},</if>
|
|
|
|
<if test="flagSum != null">flag_sum = #{flagSum},</if>
|
|
|
|
<if test="flagCompute != null">flag_compute = #{flagCompute},</if>
|
|
|
|
<if test="tenantId != null">tenant_id = #{tenantId},</if>
|
|
|
|
<if test="revision != null">revision = #{revision},</if>
|
|
|
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
|
|
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
|
|
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
|
|
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
|
|
|
<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="columnType != null">column_type = #{columnType},</if>
|
|
|
|
<if test="fieldUnit != null">field_unit = #{fieldUnit},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteDcBaseAssetTargetById" parameterType="Long">
|
|
|
|
delete from dc_base_asset_target where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteDcBaseAssetTargetByIds" parameterType="String">
|
|
|
|
delete from dc_base_asset_target where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper>
|