You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.9 KiB
XML
44 lines
1.9 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.glxp.api.dao.basic.BasicHospTypeDao">
|
|
<resultMap id="BaseResultMap" autoMapping="true" type="com.glxp.api.entity.basic.BasicHospTypeEntity">
|
|
<!--@mbg.generated-->
|
|
<!--@Table basic_hosp_type-->
|
|
<!-- <id column="id" jdbcType="INTEGER" property="id"/>-->
|
|
<result column="code" jdbcType="VARCHAR" property="code"/>
|
|
<result column="parentCode" jdbcType="VARCHAR" property="parentCode"/>
|
|
<result column="name" jdbcType="VARCHAR" property="name"/>
|
|
<result column="remark" jdbcType="VARCHAR" property="remark"/>
|
|
<result column="createTime" jdbcType="TIMESTAMP" property="createTime"/>
|
|
<result column="updateTime" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
<result column="createUser" jdbcType="VARCHAR" property="createUser"/>
|
|
<result column="updateUser" jdbcType="VARCHAR" property="updateUser"/>
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
<!--@mbg.generated-->
|
|
id, code, parentCode, `name`, remark, createTime, updateTime, `createUser`, updateUser
|
|
</sql>
|
|
|
|
|
|
<select id="getTreeList" resultType="com.glxp.api.res.basic.BasicHospTypeResponse">
|
|
SELECT id, code, name as label, parentCode
|
|
FROM basic_hosp_type
|
|
ORDER BY id DESC
|
|
</select>
|
|
|
|
<select id="selectLowTypeAll" parameterType="java.lang.String"
|
|
resultType="com.glxp.api.entity.basic.BasicHospTypeEntity">
|
|
WITH recursive table_a AS (
|
|
SELECT *
|
|
FROM basic_hosp_type ta
|
|
WHERE code = #{code}
|
|
UNION ALL
|
|
SELECT tb.*
|
|
FROM basic_hosp_type tb
|
|
INNER JOIN table_a ON table_a.CODE = tb.parentCode
|
|
)
|
|
SELECT *
|
|
FROM table_a
|
|
</select>
|
|
</mapper>
|