<!--<?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.dk.mdm.mapper.core.SettingValueMapper">-->

<!--    &lt;!&ndash; 通用设置 &ndash;&gt;-->
<!--    &lt;!&ndash; 通用查询列 &ndash;&gt;-->
<!--    <sql id="Base_Column_List">-->
<!--        fty_id, setting_code, setting_value, remarks, flg_valid, op_create_time, op_create_user_id, op_update_time, op_update_user_id, op_app_code, op_timestamp, op_db_user-->
<!--    </sql>-->

<!--    &lt;!&ndash; 通用查询映射结果 &ndash;&gt;-->
<!--    <resultMap id="BaseResultMap" type="com.dk.mdm.model.pojo.core.SettingValue">-->
<!--        <id column="fty_id" property="ftyId"/>-->
<!--                <result column="setting_code" property="settingCode"/>-->
<!--                <result column="setting_value" property="settingValue"/>-->
<!--                <result column="remarks" property="remarks"/>-->
<!--                <result column="flg_valid" property="flgValid"/>-->
<!--            <result column="op_create_time" property="opCreateTime"-->
<!--                    typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>-->
<!--                <result column="op_create_user_id" property="opCreateUserId"/>-->
<!--            <result column="op_update_time" property="opUpdateTime"-->
<!--                    typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>-->
<!--                <result column="op_update_user_id" property="opUpdateUserId"/>-->
<!--                <result column="op_app_code" property="opAppCode"/>-->
<!--            <result column="op_timestamp" property="opTimestamp"-->
<!--                    typeHandler="com.dk.common.infrastructure.handler.TimestampTypeHandler"/>-->
<!--                <result column="op_db_user" property="opDbUser"/>-->
<!--    </resultMap>-->

<!--    &lt;!&ndash; 通用条件列 &ndash;&gt;-->
<!--    <sql id="Condition">-->
<!--        <where>-->
<!--            <if test="settingCode != null and settingCode != ''">-->
<!--                AND setting_code = #{settingCode}-->
<!--            </if>-->
<!--            <if test="settingValue != null and settingValue != ''">-->
<!--                AND setting_value = #{settingValue}-->
<!--            </if>-->
<!--            <if test="remarks != null and remarks != ''">-->
<!--                AND remarks = #{remarks}-->
<!--            </if>-->
<!--            <if test="flgValid != null">-->
<!--                AND flg_valid = #{flgValid}-->
<!--            </if>-->
<!--            <if test="opCreateTime != null">-->
<!--                AND op_create_time = #{opCreateTime}-->
<!--            </if>-->
<!--            <if test="opCreateUserId != null">-->
<!--                AND op_create_user_id = #{opCreateUserId}-->
<!--            </if>-->
<!--            <if test="opUpdateTime != null">-->
<!--                AND op_update_time = #{opUpdateTime}-->
<!--            </if>-->
<!--            <if test="opUpdateUserId != null">-->
<!--                AND op_update_user_id = #{opUpdateUserId}-->
<!--            </if>-->
<!--            <if test="opAppCode != null and opAppCode != ''">-->
<!--                AND op_app_code = #{opAppCode}-->
<!--            </if>-->
<!--            <if test="opTimestamp != null">-->
<!--                AND op_timestamp = #{opTimestamp}-->
<!--            </if>-->
<!--            <if test="opDbUser != null and opDbUser != ''">-->
<!--                AND op_db_user = #{opDbUser}-->
<!--            </if>-->
<!--        </where>-->
<!--    </sql>-->

<!--    <sql id="idsForeach">-->
<!--        &lt;!&ndash; 根据主键ftyId批量操作 &ndash;&gt;-->
<!--        WHERE fty_id in-->
<!--        <foreach collection="ids" index="index" item="item" separator="," open="(" close=")">-->
<!--            #{item}-->
<!--        </foreach>-->
<!--    </sql>-->

<!--    &lt;!&ndash; 查询表core.t_setting_value，（条件查询+分页）列表 &ndash;&gt;-->
<!--    <select id="selectByCond" resultMap="BaseResultMap">-->
<!--        SELECT-->
<!--        <include refid="Base_Column_List"/>-->
<!--        FROM core.t_setting_value-->
<!--        <include refid="Condition"/>-->
<!--        <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">-->
<!--            limit #{end} offset #{start}-->
<!--        </if>-->
<!--    </select>-->

<!--    &lt;!&ndash; 查询表core.t_setting_value，（条件查询）个数 &ndash;&gt;-->
<!--    <select id="countByCond" resultType="Long">-->
<!--        SELECT-->
<!--        count(1)-->
<!--        FROM core.t_setting_value-->
<!--        <include refid="Condition"/>-->
<!--    </select>-->

<!--    &lt;!&ndash; 根据系统参数类别查询参数信息  &ndash;&gt;-->
<!--    <select id="getSettingValue" resultType="java.util.Map">-->
<!--        <include refid="select"/>-->
<!--        <if test="settingKind != null and settingKind != ''">-->
<!--            AND item.setting_kind = #{settingKind}-->
<!--        </if>-->
<!--        order by kind.kind_code,item.display_no-->
<!--    </select>-->

<!--    <sql id="select">-->
<!--        select-->
<!--            sys.f_get_name_i18n_lang(kind.kind_name_i18n,#{i18n}) as "classCode",-->
<!--            sys.f_get_name_i18n_lang(item.setting_name_i18n,#{i18n})  as "settingName",-->
<!--            item.def_value as "settingDefault",-->
<!--            item.flg_modifiable as "flgModifiable",-->
<!--            item.display_no as "displayNo",-->
<!--            item.value_kind as "valueKind",-->
<!--            item.value_format as "valueFormat",-->
<!--            sys.f_get_name_i18n_lang(item.description_i18n,#{i18n}) as "settingDescription",-->
<!--            case when setting.setting_value is not null then setting.setting_value else item.def_value end "settingValue",-->
<!--            &#45;&#45;setting.setting_value as "settingValue",-->
<!--            item.setting_code as "settingCode"-->
<!--        from sys.t_setting_kind as kind-->
<!--                 inner join sys.t_setting_item as item-->
<!--                            on kind.kind_code = item.setting_kind-->
<!--                 left join core.t_setting_value as setting-->
<!--                           on item.setting_code = setting.setting_code and setting.fty_id=#{ftyId}-->
<!--        where kind.flg_valid and item.flg_valid-->
<!--    </sql>-->

<!--    &lt;!&ndash; 修改系统参数参数值&ndash;&gt;-->
<!--    <update id="updateSettingValues" >-->
<!--            UPDATE core.t_setting_value-->
<!--            set setting_value=#{settingValue}-->
<!--            where fty_id=#{ftyId}  and setting_code = #{settingCode}-->
<!--    </update>-->

<!--    &lt;!&ndash;组织部门编码是否重复&ndash;&gt;-->
<!--    <select id="selectByCode" resultType="Long">-->
<!--        select count(1)-->
<!--         from core.t_setting_value-->
<!--        where setting_code = #{settingCode} and fty_id = #{ftyId}-->
<!--          and flg_valid-->
<!--    </select>-->

<!--    <select id="selectById" resultType="java.util.Map">-->
<!--        <include refid="select"/>-->
<!--        AND item.setting_code = #{settingCode}-->
<!--    </select>-->
<!--</mapper>-->
