Newer
Older
huludao / src / main / resources / mapper / project / NodeMapper.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.xf.huludao.project.dao.NodeMapper">

	<resultMap id="nodeResultMap" type="com.xf.huludao.project.entity.Node">
		<id column="node_serial" property="nodeSerial"/>
		<result column="node_no" property="nodeNo" />
		<result column="node_name" property="nodeName" />
		<result column="node_type" property="nodeType" />
		<result column="project_order" property="projectOrder" />
		<result column="create_time" property="createTime" />
		<result column="node_state" property="nodeState" />
		<result column="node_remark" property="nodeRemark" />
		<result column="node_state_zn" property="nodeStateZn" />
		<result column="node_type_zn" property="nodeTypeZn" />
	</resultMap>

<!--	<select id="queryNodeByNameAndNotNodeConfig" resultMap="nodeResultMap" >-->
<!--		SELECT-->
<!--		*-->
<!--		FROM-->
<!--		node-->
<!--		WHERE-->
<!--		node_no NOT IN-->
<!--		(-->
<!--		SELECT-->
<!--		node_no-->
<!--		FROM-->
<!--		project_node_config-->
<!--		WHERE project_no = #{projectNo}-->
<!--		<if test="nodeName != null and nodeName != ''">-->
<!--			AND project_name like concat('%',#{nodeName},'%')-->
<!--		</if>-->
<!--		)-->
<!--		ORDER BY create_time DESC LIMIT #{current},#{size}-->
<!--	</select>-->
<!--	<select id="queryNodeByNameAndNotNodeConfigCount" resultType="integer">-->
<!--		SELECT-->
<!--		COUNT(*)-->
<!--		FROM-->
<!--		node-->
<!--		WHERE-->
<!--		node_no NOT IN-->
<!--		(-->
<!--		SELECT-->
<!--		node_no-->
<!--		FROM-->
<!--		project_node_config-->
<!--		WHERE project_no = #{projectNo}-->
<!--		<if test="nodeName != null and nodeName != ''">-->
<!--			AND project_name like concat('%',#{nodeName},'%')-->
<!--		</if>-->
<!--		)-->
<!--	</select>-->
	<select id="selectNoConfigNode" resultMap="nodeResultMap">
		select
			node_serial,
			node_no,
			node_name,
			node_type,
			project_order,
			create_time,
			node_state,
			node_remark,
			node_state_zn,
			node_type_zn
		from node
		where node_no not in (select DISTINCT node_number from project_node )
		<if test="nodeName != null and nodeName != ''">
			and node_name like concat('%',#{nodeName},'%')
		</if>
		limit #{current},#{size}
	</select>


	<select id="selectNoConfigNodeCount" resultType="long">
		select
			count(node_serial)
		from node
		where node_no not in (select DISTINCT node_number from project_node )
		  <if test="nodeName != null and nodeName != ''">
			  and node_name like concat('%',#{nodeName},'%')
		  </if>

	</select>

<!--	<select id="selectNoProejctConfigNodeCount" resultType="long">-->
<!--		select-->
<!--			count(node_serial)-->
<!--		from node-->
<!--		where node_no not in (select DISTINCT node_no from project_node_config where project_no = #{projectNo})-->
<!--	</select>-->

	<select id="selectNoProjectTreeNode" resultType="com.xf.huludao.project.entity.NodeTreeDto">
		select
		pn.node_number as nodeNo,
		pn.father_node_number as parentNodeNo,
		pn.node_name,
		pn.create_time
		from project_node pn
		left join node n on pn.node_number = n.node_no
		where node_number not in (select DISTINCT node_no from project_node_config where project_no = #{projectNo})
		order by pn.node_serial
	</select>

<!--	<select id="selectNoProejctConfigNode" resultMap="nodeResultMap">-->
<!--		select-->
<!--			node_serial,-->
<!--			node_no,-->
<!--			node_name,-->
<!--			node_type,-->
<!--			project_order,-->
<!--			create_time,-->
<!--			node_state,-->
<!--			node_remark,-->
<!--			node_state_zn,-->
<!--			node_type_zn-->
<!--		from node-->
<!--		where node_no not in (select DISTINCT node_no from project_node_config where project_no = #{projectNo})-->
<!--		order by node_serial desc limit #{current},#{size}-->
<!--	</select>-->

	<select id="selectDefault" resultMap="nodeResultMap">
		select
			node_serial,
			node_no,
			node_name,
			node_type,
			project_order,
			create_time,
			node_state,
			node_remark,
			node_state_zn,
			node_type_zn
		from node
		where default_state = 1
	</select>
</mapper>