This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
k18-ntcs-web-argus-service/src/main/java/com/nis/web/dao/ConfigGroupRelationDao.xml
zhangdongxu 13acafd43d 上传代码
2017-12-19 14:55:52 +08:00

114 lines
3.6 KiB
XML

<?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.ConfigGroupRelationDao">
<resultMap id="BaseResultMap" type="com.nis.domain.restful.ConfigGroupRelation">
<result column="ID" jdbcType="BIGINT" property="id" />
<result column="GROUP_ID" jdbcType="BIGINT" property="groupId" />
<result column="COMPILE_ID" jdbcType="BIGINT" property="compileId" />
<result column="IS_VALID" jdbcType="BIGINT" property="isValid" />
<result column="OP_TIME" jdbcType="TIMESTAMP" property="opTime" />
<result column="LAST_UPDATE" jdbcType="TIMESTAMP" property="lastUpdate" />
<result column="PROC_SEQ" jdbcType="BIGINT" property="procSeq" />
</resultMap>
<sql id="compileGroupSql">
ID,GROUP_ID,COMPILE_ID,IS_VALID,OP_TIME,LAST_UPDATE,PROC_SEQ
</sql>
<select id="queryCompileGroupByPID" parameterType="com.nis.domain.restful.ConfigGroupRelation"
resultMap="BaseResultMap">
select
<include refid="compileGroupSql" />
from CONFIG_GROUP where COMPILE_ID = #{compileId ,jdbcType=BIGINT }
</select>
<select id="queryCompileGroupByGID" parameterType="com.nis.domain.restful.ConfigGroupRelation"
resultMap="BaseResultMap">
select
<include refid="compileGroupSql" />
from CONFIG_GROUP where IS_VALID=1 GROUP_ID = #{groupId
,jdbcType=BIGINT }
</select>
<insert id="saveGroupBatch" parameterType="java.util.List">
<!-- insert /*+append*/ into CONFIG_GROUP -->
insert into CONFIG_GROUP
(ID,GROUP_ID, COMPILE_ID, IS_VALID,
OP_TIME,LAST_UPDATE
<!-- ,PROC_SEQ -->
)
<foreach collection="list" item="item" index="index" open="("
close=")" separator="union">
select
<!-- seq_groupId.nextval, -->
#{item.id,jdbcType=BIGINT},
#{item.groupId,jdbcType=BIGINT},
#{item.compileId,jdbcType=BIGINT},
#{item.isValid,jdbcType=BIGINT},
#{item.opTime,jdbcType=TIMESTAMP},
sysdate
<!-- ,#{item.procSeq,jdbcType=BIGINT} -->
from dual
</foreach>
</insert>
<insert id="saveConfigGroupRelation" parameterType="com.nis.domain.restful.ConfigGroupRelation">
<!-- <selectKey keyProperty="groupId" resultType="java.lang.Long" -->
<!-- order="BEFORE"> 取消使用序列,界面会将id传过来 -->
<!-- select seq_groupId.nextval from dual -->
<!-- </selectKey> -->
insert into CONFIG_GROUP
(ID,GROUP_ID, COMPILE_ID, IS_VALID,
LAST_UPDATE,
OP_TIME )
values
(
<!-- #{id,jdbcType=BIGINT}, -->
seq_config_group.nextval,
#{groupId,jdbcType=BIGINT},
#{compileId,jdbcType=BIGINT},
#{isValid,jdbcType=BIGINT},
sysdate,
#{opTime,jdbcType=TIMESTAMP}
)
</insert>
<update id="updateConfigGroupRelation" parameterType="com.nis.domain.restful.ConfigGroupRelation">
UPDATE
CONFIG_GROUP
<set>
<if test="isValid != null">
IS_VALID=#{isValid , jdbcType=BIGINT},
</if>
<if test="opTime != null">
OP_TIME=#{opTime , jdbcType=TIMESTAMP},
</if>
<if test="lastUpdate != null">
LAST_UPDATE=#{lastUpdate , jdbcType=TIMESTAMP},
</if>
</set>
where GROUP_ID=#{groupId}
</update>
<!-- <update id="updateConfigGroupRelation" parameterType="com.nis.domain.restful.ConfigGroupRelation">
UPDATE CONFIG_GROUP <set> <if test="compileId != null"> COMPILE_ID=#{compileId
, jdbcType=BIGINT}, </if> <if test="isValid != null"> IS_VALID=#{isValid
, jdbcType=BIGINT}, </if> <if test="opTime != null"> OP_TIME=#{opTime , jdbcType=TIMESTAMP},
</if> </set> where GROUP_ID=#{groupId} </update> -->
</mapper>