MerchantDictDataMapper.xml 4.5 KB
<?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="cn.com.glsx.merchants.mapper.MerchantDictDataMapper">
    <resultMap id="BaseResultMap" type="cn.com.glsx.merchants.entity.MerchantDictData">
        <!--
          WARNING - @mbg.generated
        -->
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="dict_sort" jdbcType="INTEGER" property="dictSort"/>
        <result column="dict_label" jdbcType="VARCHAR" property="dictLabel"/>
        <result column="dict_value" jdbcType="VARCHAR" property="dictValue"/>
        <result column="dict_type" jdbcType="VARCHAR" property="dictType"/>
        <result column="is_default" jdbcType="CHAR" property="isDefault"/>
        <result column="enable_status" jdbcType="INTEGER" property="enableStatus"/>
        <result column="remark" jdbcType="VARCHAR" property="remark"/>
        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
        <result column="created_by" jdbcType="INTEGER" property="createdBy"/>
        <result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
        <result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
        <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
    </resultMap>

    <resultMap id="resultMap" type="cn.com.glsx.merchants.model.response.MerchantDictDataResponse">
        <!--
          WARNING - @mbg.generated
        -->
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="dict_sort" jdbcType="INTEGER" property="dictSort"/>
        <result column="dict_label" jdbcType="VARCHAR" property="dictLabel"/>
        <result column="dict_value" jdbcType="VARCHAR" property="dictValue"/>
        <result column="dict_type" jdbcType="VARCHAR" property="dictType"/>
        <result column="is_default" jdbcType="CHAR" property="isDefault"/>
        <result column="enable_status" jdbcType="INTEGER" property="enableStatus"/>
        <result column="remark" jdbcType="VARCHAR" property="remark"/>
        <result column="del_flag" jdbcType="TINYINT" property="delFlag"/>
        <result column="created_by" jdbcType="INTEGER" property="createdBy"/>
        <result column="created_date" jdbcType="TIMESTAMP" property="createdDate"/>
        <result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
        <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate"/>
    </resultMap>

    <sql id="Base_Column_List">
        <!--
          WARNING - @mbg.generated
        -->
        id, dict_sort, dict_label, dict_value, dict_type, is_default, enable_status, remark,
        del_flag, created_by, created_date, updated_by, updated_date, product_type
    </sql>
    <select id="findDictData" parameterType="cn.com.glsx.merchants.entity.MerchantDictData" resultMap="BaseResultMap">
    SELECT * FROM platform_merchant_dict_data WHERE dict_value=#{merchantDictData.dictValue} and del_flag = 0
  </select>
    <select id="findMerchantDictData" parameterType="cn.com.glsx.merchants.model.request.MerchantDictDataRequest"
            resultMap="resultMap">
        select * from platform_merchant_dict_data
        <where>
            <if test="condition.dictLabel != null and condition.dictLabel != ''">
                dict_label = #{condition.dictLabel}
            </if>
            <if test="condition.dictType != null and condition.dictType !=''">
                and dict_type = #{condition.dictType}
            </if>
            <if test="condition.enableStatus != null and condition.enableStatus !=''">
                and enable_status = #{condition.enableStatus}
            </if>
        </where>
    </select>

    <select id="findAllDictData" parameterType="cn.com.glsx.merchants.model.request.MerchantDictDataRequest"
            resultMap="resultMap">
        select * from platform_merchant_dict_data where del_flag=0 and enable_status=1
        <if test="merchantDictDataRequest.dictType != null and merchantDictDataRequest.dictType != ''">
            and dict_type=#{merchantDictDataRequest.dictType}
        </if>
    </select>

    <select id="findByDictTypeAndDictValId" resultMap="resultMap">
        select * from platform_merchant_dict_data
        where del_flag = 0 and enable_status = 1
        <if test="dictType != null and dictType != ''">
            and dict_type = #{dictType}
        </if>
        <if test="dictValId != null">
            and dict_value = #{dictValId}
        </if>
    </select>
</mapper>