All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.base4j.mvc.sys.mapper.xml.SysDeptMapper.xml Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
<?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.base4j.mvc.sys.mapper.SysDeptMapper">

    <resultMap id="ChildNumResultMap" extends="BaseResultMap" type="com.base4j.mvc.sys.entity.SysDept">
        <result column="CHILD_NUM" property="childNum"/>
    </resultMap>

    <select id="selectChildNumListByParentId" resultMap="ChildNumResultMap" parameterType="long">
        SELECT
          T.*,
          (SELECT COUNT(0) FROM SEED_SYS_DEPT SSD WHERE SSD.PARENT_ID =  T.ID) AS CHILD_NUM
        FROM SEED_SYS_DEPT T
        where T.PARENT_ID=#{parentId}
    </select>

</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy