解决冲突 提交本地

This commit is contained in:
zhangshilin
2018-03-17 17:09:19 +08:00
parent b96389e37f
commit d5a2a32c51
25 changed files with 2737 additions and 8 deletions

View File

@@ -0,0 +1,157 @@
<?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.nis.web.dao.specific.SpecificServiceHostCfgDao">
<resultMap id="specificServiceHostCfgResultMap"
type="com.nis.domain.specific.SpecificServiceHostCfg">
<id column="host_id" property="hostId" jdbcType="INTEGER" />
<result column="spec_service_id" property="specServiceId"
jdbcType="INTEGER" />
<result column="src_ip" property="srcIp" jdbcType="VARCHAR" />
<result column="src_ip_mask" property="srcIpMask" jdbcType="VARCHAR" />
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
<result column="src_port_mask" property="srcPortMask" jdbcType="VARCHAR" />
<result column="dst_ip" property="dstIp" jdbcType="VARCHAR" />
<result column="dst_ip_mask" property="dstIpMask" jdbcType="VARCHAR" />
<result column="dst_port" property="dstPort" jdbcType="VARCHAR" />
<result column="dst_port_mask" property="dstPortMask" jdbcType="VARCHAR" />
<result column="direction" property="direction" jdbcType="INTEGER" />
<result column="protocol" property="protocol" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<!-- 创建人员 -->
<association property="creator" javaType="com.nis.domain.SysUser">
<id property="id" column="creator_id" />
</association>
<!-- 修改人员 -->
<association property="editor" javaType="com.nis.domain.SysUser">
<id property="id" column="editor_id" />
</association>
<!-- 审核人员 -->
<association property="auditor" javaType="com.nis.domain.SysUser">
<id property="id" column="auditor_id" />
</association>
</resultMap>
<sql id="specificServiceHostCfgColumns">
s.host_id AS hostId,
s.spec_service_id AS specServiceId,
s.src_ip AS srcIp,
s.src_ip_mask AS srcIpMask,
s.src_port AS srcPort,
s.src_port_mask AS srcPortMask,
s.dst_ip AS dstIp,
s.dst_ip_mask AS dstIpMask,
s.dst_port AS dstPort,
s.dst_port_mask AS dstPortMask,
s.direction AS direction,
s.protocol AS protocol,
s.is_valid AS isValid,
s.is_audit AS isAudit,
s.creator_id AS "creator.id",
s.create_time AS createTime,
s.editor_id AS "editor.id",
s.edit_time AS editTime,
s.auditor_id AS "auditor.id",
s.audit_time AS auditTime
</sql>
<!-- 根据id查出对象 -->
<select id="getByHostId" resultType="com.nis.domain.specific.SpecificServiceHostCfg"
parameterType="java.lang.Integer">
select
<include refid="specificServiceHostCfgColumns" />
from specific_service_host_cfg s where s.host_id = #{hostId}
</select>
<!-- 查询分页 -->
<select id="findSpecHostList" resultMap="specificServiceHostCfgResultMap" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
select * from specific_service_host_cfg where 1 = 1
<if test="isAudit !=null" >
AND is_audit = #{isAudit}
</if>
<if test="specServiceId !=null" >
AND spec_service_id = #{specServiceId}
</if>
<if test="protocol !=null" >
AND protocol = #{protocol}
</if>
<if test="direction !=null" >
AND direction = #{direction}
</if>
<if test="beginDate !=null" >
AND create_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if>
<if test="endDate !=null" >
AND create_time &lt;= #{endDate,jdbcType=TIMESTAMP}
</if>
<if test="editBeginDate !=null" >
AND edit_time &gt;= #{editBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="editEndDate !=null" >
AND edit_time &lt;= #{editEndDate,jdbcType=TIMESTAMP}
</if>
<if test="auditBeginDate !=null" >
AND audit_time &gt;= #{auditBeginDate,jdbcType=TIMESTAMP}
</if>
<if test="auditEndDate !=null" >
AND audit_time &lt;= #{auditEndDate,jdbcType=TIMESTAMP}
</if>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY create_time desc
</otherwise>
</choose>
</select>
<!-- 查询所有 -->
<select id="getAll" resultMap="specificServiceHostCfgResultMap">
select * from specific_service_host_cfg
</select>
<!-- 新增 -->
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
insert into specific_service_host_cfg (spec_service_id,src_ip,src_ip_mask,src_port,src_port_mask,dst_ip,dst_ip_mask,dst_port,dst_port_mask,direction,protocol,is_valid,is_audit,creator_id,create_time,editor_id,edit_time,auditor_id,audit_time)
values(#{specServiceId},#{srcIp},#{srcIpMask},#{srcPort},#{srcPortMask},#{dstIp},#{dstIpMask},#{dstPort},#{dstPortMask},#{direction},#{protocol},#{isValid},#{isAudit},#{creator.id},#{createTime},#{editor.id},#{editTime},#{auditor.id},#{auditTime})
</insert>
<!-- 修改 -->
<update id="update" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
update specific_service_host_cfg s set
s.spec_service_id = #{specServiceId},
s.src_ip = #{srcIp},
s.src_ip_mask = #{srcIpMask},
s.src_port = #{srcPort},
s.src_port_mask = #{srcPortMask},
s.dst_ip = #{dstIp},
s.dst_ip_mask = #{dstIpMask},
s.dst_port = #{dstPort},
s.dst_port_mask = #{dstPortMask},
s.direction = #{direction},
s.protocol = #{protocol},
s.is_valid = #{isValid},
s.is_audit = #{isAudit},
s.creator_id = #{creator.id},
s.create_time = #{createTime},
s.editor_id = #{editor.id},
s.edit_time = #{editTime},
s.auditor_id = #{auditor.id},
s.audit_time = #{auditTime}
where s.host_id = #{hostId}
</update>
<!-- 删除 -->
<update id="delete" parameterType="java.lang.Integer">
update specific_service_host_cfg s set
s.is_valid = 0
where s.host_id = #{hostId}
</update>
</mapper>