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

  <resultMap id="ProjectNodeMap" type="com.xf.huludao.project.entity.ProjectNode" >
      <id column="node_serial" property="nodeSerial" />
      <result column="node_number" property="nodeNumber" />
      <result column="father_node_number" property="fatherNodeNumber" />
      <result column="node_name" property="nodeName" />
      <result column="state" property="state" />
      <result column="information_content" property="informationContent" />
      <result column="type_message" property="typeMessage" />
      <result column="message_type_name" property="messageTypeName" />
      <result column="create_time" property="createTime" />
      <result column="sort" property="sort" />
      <association  property="projectNodeConfig"  javaType="com.xf.huludao.project.entity.ProjectNodeConfig" >
          <id property="nodeConfigSerial" column="node_config_serial" />
          <result property="projectNodeNo" column="project_node_no" />
          <result property="projectNo" column="project_no" />
          <result property="nodeNo" column="node_no" />
          <result property="nodeCreateTime" column="node_create_time" />
          <result property="nodeState" column="node_state" />
          <result property="nodeStateZn" column="node_state_zn" />
      </association>

  </resultMap>


    <select id="selectProjectNode" resultMap="ProjectNodeMap" parameterType="string" >
         SELECT
        pnc.*,pn.*
      FROM
      project_node_config pnc
      LEFT JOIN
      project_node pn
      ON pnc.node_no = pn.node_number
      WHERE pnc.project_no = #{projectNo}
    </select>


<!--    <select id="queryNodeByNameAndNotNodeConfig" resultMap="ProjectNodeMap" >-->
<!--        SELECT-->
<!--          *-->
<!--        FROM-->
<!--         project_node-->
<!--        WHERE-->
<!--          node_number 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-->
<!--        project_node-->
<!--        WHERE-->
<!--        node_number 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="findFatherNodeIsExitsById" resultType="integer">

        SELECT count(node_serial)
        FROM
          project_node
        WHERE
          father_node_number =
          (
             SELECT node_number
             FROM
             project_node
             WHERE
             node_serial = #{id}
          )
    </select>

</mapper>