<?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.njcn.mapper.configuration.DevFunctionMapper'>
	<resultMap type="DevFunction" id="devfunctionMap" autoMapping="true">
	<id column="FUC_INDEX" property="fucIndex"/>
	</resultMap>

	<insert id="insertData" databaseId="Oracle">
		insert into PQS_DEVFUCTION (FUC_INDEX,DEV_INDEX,FUC_NAME)
  		select * from (
		<foreach item="item" index="index" collection="list" separator="union all">
            select #{item.fucIndex},#{item.devIndex},#{item.fucname} from dual
        </foreach>
        )
	</insert>

	<insert id="insertData" databaseId="MariaDB">
		insert into PQS_DEVFUCTION (FUC_INDEX,DEV_INDEX,FUC_NAME)
  		values
		<foreach item="item" index="index" collection="list" separator=",">
            (#{item.fucIndex},#{item.devIndex},#{item.fucname})
        </foreach>
	</insert>

	<select id="queryByDevIndex" resultType="DevFunction">
		select * from pqs_devfuction where dev_index = #{devIndex}
	</select>

	<delete id="deleteByIndex">
		delete from pqs_devfuction where dev_index = #{devIndex}
	</delete>

	<!--删除pqs_pushinfo表数据-->
	<delete id="delNodeIp" parameterType="string">
        delete from pqs_pushinfo
        where node_ip=#{nodeIp}
        and pushType = 0
    </delete>


</mapper>
