src/main/resources/mapper/DictionaryDao.xml

(完整代码) 1KB

<?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.dao.DictionaryDao">

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        a.id as id
        ,a.dic_code as dicCode
        ,a.dic_name as dicName
        ,a.code_index as codeIndex
        ,a.index_name as indexName
        ,a.super_id as superId
        ,a.create_time as createTime
    </sql>
    <select id="selectListView" parameterType="map" resultType="com.entity.view.DictionaryView" >
        SELECT
        <include refid="Base_Column_List" />

--         级联表的字段

        FROM dictionary  a

        <where>
            <if test=" params.dicCode != '' and params.dicCode != null and params.dicCode != 'null' ">
                and a.dic_code like CONCAT('%',#{params.dicCode},'%')
            </if>
            <if test=" params.dicName != '' and params.dicName != null and params.dicName != 'null' ">
                and a.dic_name like CONCAT('%',#{params.dicName},'%')
            </if>
            <if test="params.codeIndexStart != null">
                <![CDATA[  and a.code_index >= #{params.codeIndexStart}   ]]>
            </if>
            <if test="params.codeIndexEnd != null">
                <![CDATA[  and a.code_index <= #{params.codeIndexEnd}   ]]>
            </if>
            <if test=" params.indexName != '' and params.indexName != null and params.indexName != 'null' ">
                and a.index_name like CONCAT('%',#{params.indexName},'%')
            </if>
            <if test="params.superId != null">
                and a.super_id = #{params.superId}
            </if>

        </where>
        order by a.id desc
    </select>

</mapper>

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。