修改区域地域ip和地域运营商不互斥的bug

去掉cfgIndexInfo中areaIpCfg对象
cont_ip修改功能完成
This commit is contained in:
duandongmei
2018-05-30 17:10:39 +08:00
parent 911b9a6e09
commit d0d9c3eece
9 changed files with 221 additions and 205 deletions

View File

@@ -17,10 +17,9 @@ import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface AreaIpCfgDao extends CrudDao<AreaIpCfg>{
public List<AreaIpCfg> getByCompileId(@Param("compileId") int compileId) ;
public List<AreaIpCfg> findAreaIpCfgList(CfgIndexInfo entity);
public void saveAreaIpCfg(AreaIpCfg entity);
public void saveAreaIpCfgFromCfgIndexInfo(CfgIndexInfo entity);
public void updateAreaIpCfgFromCfgIndexInfo(CfgIndexInfo entity);
public void updateAreaIpCfg(AreaIpCfg entity);
public void updateAreaIpCfgValid(AreaIpCfg entity);
public void deleteAreaIpCfg(AreaIpCfg entity);
public void deleteAreaIpCfgByCfgId(CfgIndexInfo entity);
public void deleteAreaIpCfgByCfgId(AreaIpCfg entity);
}

View File

@@ -52,26 +52,6 @@
</if>
AND IS_VALID!=-1
</trim>
</select>
<!-- 根据compileId获取avVoipAccountCfg信息 -->
<select id="findAreaIpCfgList" resultMap="BaseIpMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
select
<include refid="AreaIpCfg_Column_List_with_id" />
from area_ip_cfg r
<where>
<if test="compileId != null">
and r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<choose>
<when test="isValid != null">
and r.is_valid=#{isValid,jdbcType=INTEGER}
</when>
<otherwise>
and r.is_valid != -1
</otherwise>
</choose>
</where>
</select>
<!-- insert area_ip_cfg表信息 -->
<insert id="saveAreaIpCfg" parameterType="com.nis.domain.configuration.AreaIpCfg" >
@@ -141,76 +121,9 @@
#{cfgRegionCode,jdbcType=INTEGER}
)
</insert>
<!-- insert area_ip_cfg表信息 -->
<insert id="saveAreaIpCfgFromCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
insert into area_ip_cfg (
CFG_DESC,
ACTION,
IS_VALID,
IS_AUDIT,
CREATOR_ID,
CREATE_TIME,
EDITOR_ID,
EDIT_TIME,
AUDITOR_ID,
AUDIT_TIME,
SERVICE_ID,
REQUEST_ID,
COMPILE_ID,
IS_AREA_EFFECTIVE,
CLASSIFY,
ATTRIBUTE,
LABLE,
AREA_EFFECTIVE_IDS,
function_id,
ip_type,
src_ip_address,
ip_pattern,
port_pattern,
src_port,
protocol,
protocol_id,
direction,
dest_port,
dest_ip_address,
cfg_type,
cfg_region_code
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
0,
0,
#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{editorId,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP},
#{auditorId,jdbcType=INTEGER},
#{auditTime,jdbcType=TIMESTAMP},
#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},
#{compileId,jdbcType=INTEGER},
#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},
#{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER},
#{areaIpCfg.ipType,jdbcType=INTEGER},
#{areaIpCfg.srcIpAddress,jdbcType=VARCHAR},
#{areaIpCfg.ipPattern,jdbcType=INTEGER},
#{areaIpCfg.portPattern,jdbcType=INTEGER},
#{areaIpCfg.srcPort,jdbcType=VARCHAR},
#{areaIpCfg.protocol,jdbcType=INTEGER},
#{areaIpCfg.protocolId,jdbcType=INTEGER},
#{areaIpCfg.direction,jdbcType=INTEGER},
#{areaIpCfg.destPort,jdbcType=VARCHAR},
#{areaIpCfg.destIpAddress,jdbcType=VARCHAR},
#{areaIpCfg.cfgType,jdbcType=VARCHAR},
#{areaIpCfg.cfgRegionCode,jdbcType=INTEGER}
)
</insert>
<!-- update av_voip_ip_cfg表信息 -->
<update id="updateAreaIpCfgFromCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
<update id="updateAreaIpCfg" parameterType="com.nis.domain.configuration.AreaIpCfg" >
update area_ip_cfg
<set >
<trim suffixOverrides=",">
@@ -265,47 +178,47 @@
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.ipType != null" >
ip_type = #{areaIpCfg.ipType,jdbcType=INTEGER},
<if test="ipType != null" >
ip_type = #{ipType,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.srcIpAddress != null and areaIpCfg.srcIpAddress != ''" >
src_ip_address = #{areaIpCfg.srcIpAddress,jdbcType=VARCHAR},
<if test="srcIpAddress != null and srcIpAddress != ''" >
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.ipPattern != null" >
ip_pattern = #{areaIpCfg.ipPattern,jdbcType=INTEGER},
<if test="ipPattern != null" >
ip_pattern = #{ipPattern,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.portPattern != null" >
port_pattern = #{areaIpCfg.portPattern,jdbcType=INTEGER},
<if test="portPattern != null" >
port_pattern = #{portPattern,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.srcPort != null and areaIpCfg.srcPort != ''" >
src_port = #{areaIpCfg.srcPort,jdbcType=VARCHAR},
<if test="srcPort != null and srcPort != ''" >
src_port = #{srcPort,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.protocol != null" >
protocol = #{areaIpCfg.protocol,jdbcType=INTEGER},
<if test="protocol != null" >
protocol = #{protocol,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.protocolId != null" >
protocol_id = #{areaIpCfg.protocolId,jdbcType=INTEGER},
<if test="protocolId != null" >
protocol_id = #{protocolId,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.direction != null" >
direction = #{areaIpCfg.direction,jdbcType=INTEGER},
<if test="direction != null" >
direction = #{direction,jdbcType=INTEGER},
</if>
<if test="areaIpCfg != null and areaIpCfg.destPort != null and areaIpCfg.destPort != ''" >
dest_port = #{areaIpCfg.destPort,jdbcType=VARCHAR},
<if test="destPort != null and destPort != ''" >
dest_port = #{destPort,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.destIpAddress != null and areaIpCfg.destIpAddress != ''" >
dest_ip_address = #{areaIpCfg.destIpAddress,jdbcType=VARCHAR},
<if test="destIpAddress != null and destIpAddress != ''" >
dest_ip_address = #{destIpAddress,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.cfgType != null and areaIpCfg.cfgType != ''" >
cfg_type = #{areaIpCfg.cfgType,jdbcType=VARCHAR},
<if test="cfgType != null and cfgType != ''" >
cfg_type = #{cfgType,jdbcType=VARCHAR},
</if>
<if test="areaIpCfg != null and areaIpCfg.cfgRegionCode != null " >
cfg_region_code = #{areaIpCfg.cfgRegionCode,jdbcType=INTEGER},
<if test="cfgRegionCode != null " >
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
</if>
</trim>
</set>
<where>
<if test="areaIpCfg != null and areaIpCfg.cfgId != null" >
and cfg_id = #{areaIpCfg.cfgId,jdbcType=INTEGER}
<if test="cfgId != null" >
and cfg_id = #{cfgId,jdbcType=INTEGER}
</if>
<if test="compileId != null" >
and compile_id = #{compileId,jdbcType=INTEGER}
@@ -319,20 +232,23 @@
<delete id="deleteAreaIpCfg" >
delete from area_ip_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<update id="updateAreaIpCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
update area_ip_cfg set is_valid = #{isValid,jdbcType=INTEGER},
editor_id = #{editorId,jdbcType=INTEGER} ,
edit_time = #{editTime,jdbcType=TIMESTAMP}
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="cfgId !=null ">
AND cfg_id = #{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId !=null ">
AND compile_id = #{compileId,jdbcType=INTEGER}
</if>
and function_id=#{functionId,jdbcType=INTEGER}
</trim>
</update>
<!-- 删除区域IP配置 -->
<!-- 删除voipIp信息 -->
<delete id="deleteAreaIpCfgByCfgId" parameterType="com.nis.domain.configuration.AreaIpCfg" >
delete from area_ip_cfg
<where>
<if test="areaIpCfg != null and areaIpCfg.cfgId != null" >
and cfg_id = #{areaIpCfg.cfgId,jdbcType=INTEGER}
</if>
<if test="compileId != null" >
and compile_id = #{compileId,jdbcType=INTEGER}
</if>
<if test="functionId != null" >
and function_id = #{functionId,jdbcType=INTEGER}
</if>
</where>
delete from area_ip_cfg where cfg_id = #{cfgId,jdbcType=INTEGER}
</delete>
</mapper>

View File

@@ -31,7 +31,7 @@ public interface AvContentCfgDao {
public void updateAvVoipAccount(CfgIndexInfo entity);
public void deleteAvVoipIp(CfgIndexInfo entity);
public void deleteAvVoipAccount(CfgIndexInfo entity);
public AvContIpCfg findVoipIpCfgById(AvContIpCfg entity) ;
public AvContIpCfg findContIpCfgById(AvContIpCfg entity) ;
public void insertAvContIp(AvContIpCfg entity);
public void updateAvContIp(AvContIpCfg entity);
}