<?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.shanghaichengdi.ghjgitem.mapper.SysGroupMapper">

    <resultMap id="BaseResultMap" type="com.shanghaichengdi.ghjgitem.domain.SysGroup">
            <id property="id" column="ID" jdbcType="DECIMAL"/>
            <result property="identity" column="IDENTITY" jdbcType="VARCHAR"/>
            <result property="name" column="NAME" jdbcType="VARCHAR"/>
            <result property="parentId" column="PARENT_ID" jdbcType="DECIMAL"/>
            <result property="no" column="NO" jdbcType="DECIMAL"/>
            <result property="path" column="PATH" jdbcType="VARCHAR"/>
            <result property="depthLevel" column="DEPTH_LEVEL" jdbcType="DECIMAL"/>
            <result property="available" column="AVAILABLE" jdbcType="DECIMAL"/>
            <result property="isDefault" column="IS_DEFAULT" jdbcType="DECIMAL"/>
            <result property="property1" column="PROPERTY1" jdbcType="VARCHAR"/>
            <result property="property2" column="PROPERTY2" jdbcType="VARCHAR"/>
            <result property="property3" column="PROPERTY3" jdbcType="VARCHAR"/>
            <result property="property4" column="PROPERTY4" jdbcType="VARCHAR"/>
            <result property="property5" column="PROPERTY5" jdbcType="VARCHAR"/>
            <result property="property6" column="PROPERTY6" jdbcType="VARCHAR"/>
            <result property="property7" column="PROPERTY7" jdbcType="VARCHAR"/>
            <result property="property8" column="PROPERTY8" jdbcType="VARCHAR"/>
            <result property="property9" column="PROPERTY9" jdbcType="VARCHAR"/>
            <result property="property10" column="PROPERTY10" jdbcType="VARCHAR"/>
            <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
            <result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
    </resultMap>

    <sql id="Base_Column_List">
        ID,IDENTITY,NAME,
        PARENT_ID,NO,PATH,
        DEPTH_LEVEL,AVAILABLE,IS_DEFAULT,
        PROPERTY1,PROPERTY2,PROPERTY3,
        PROPERTY4,PROPERTY5,PROPERTY6,
        PROPERTY7,PROPERTY8,PROPERTY9,
        PROPERTY10,CREATE_TIME,UPDATE_TIME
    </sql>

  <select id="selectGroupInfo" resultType="com.shanghaichengdi.ghjgitem.vo.SysGroupVo">
    SELECT T.ID id, T.NAME name, T.PARENT_ID parentId, T.AVAILABLE available, T.CREATE_TIME
    createTime, T.UPDATE_TIME updateTime
    FROM GHJG_BASICS.SYS_GROUP T
    WHERE 1 = 1
    <if test="id != '' and id != null">
      and T.ID = #{id}
    </if>
    <if test="name != '' and name != null">
      and T.NAME like '%' || #{name} || '%'
    </if>
  </select>
</mapper>
