<?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.ghy.system.mapper.SysDeptConfigMapper">
    <resultMap id="SysDeptConfigResult" type="com.ghy.system.domain.SysDeptConfig">
        <result property="sysDeptConfigId"     column="sys_dept_config_id"     />
        <result property="deptId"              column="dept_id"     />
        <result property="bannerUrl"           column="banner_url"     />
        <result property="createBy"            column="create_by"     />
        <result property="createTime"          column="create_time"   />
        <result property="updateBy"            column="update_by"     />
        <result property="updateTime"          column="update_time"   />
        <result property="remark"              column="remark"        />
    </resultMap>

    <sql id="selectSysDeptConfig">
        SELECT sys_dept_config_id, dept_id, banner_url, create_by, create_time, remark
        FROM sys_dept_config
    </sql>

    <select id="selectByDeptId" parameterType="long" resultMap="SysDeptConfigResult">
        <include refid="selectSysDeptConfig" />
        <where>
            <if test="deptId != null and deptId != 0">
                AND dept_id = #{deptId}
            </if>
        </where>

    </select>

</mapper>