zoukankan      html  css  js  c++  java
  • mybatis 判断参数有没有传入

     <!--审核展示列表-->
        <select id="auditResList" resultType="java.util.HashMap">
            <include refid="auditRes"/>
        </select>
        <!--审核展示 一条-->
        <select id="auditResInfo" resultType="java.util.HashMap">
            <include refid="auditRes"/>
        </select>
        <sql id="auditRes">
            SELECT
            r.id AS resId,
            r.res_desc,
            r.res_type,
            r.res_state,
            r.expires_date,
            r.res_pic_path,
            ra.id as applyId,
            ra.reason,
            ra.apply_note,
            ra.company_id,
            ra.state,
            r.res_name,
            c.companyName,
            c.shopName
            FROM resource r
            inner JOIN resource_apply ra
            ON r.id = ra.res_id
            left JOIN company c
            on ra.company_id = c.companyId
            <where>
                r.res_state = 1
                <if test="resType != null">
                    and r.res_type = #{resType}
                </if>
                <if test="_parameter.containsKey('applyId') and applyId != null">
                    and ra.id = #{applyId}
                </if>
                <if test=" _parameter.containsKey('state') and state != null">
                    and ra.state = #{state}
                </if>
                <if test=" _parameter.containsKey('resName') and resName != null and resName != ''">
                    and r.res_name like CONCAT('%', #{resName}, '%')
                </if>
                <if test=" _parameter.containsKey('companyName') and companyName != null and companyName != ''">
                    and c.companyName like CONCAT('%', #{companyName}, '%')
                </if>
                <if test=" _parameter.containsKey('shopName') and shopName != null and shopName != ''">
                    and c.shopName like CONCAT('%', #{shopName}, '%')
                </if>
            </where>
        </sql>
    
    
        /**
         * 审核展示列表
         *
         * @param resType
         * @return
         */
        List<HashMap> auditResList(@Param("resType") Integer resType,
                                   @Param("companyName") String companyName,
                                   @Param("shopName") String shopName,
                                   @Param("state") Integer state,
                                   @Param("resName") String resName);
    
        /**
         * 审核展示 一条
         *
         * @param resType
         * @param applyId
         * @return
         */
        HashMap auditResInfo(@Param("resType") Integer resType, @Param("applyId") Integer applyId);
    

      

  • 相关阅读:
    K最近邻kNN-学习笔记
    随机森林学习-sklearn
    matplotlib画堆叠条形图
    PCA和SVD最佳理解
    1,机器学习应用概述
    linux unzip 中文乱码解决方法
    python文件、文件夹操作OS模块
    利用pyecharts做地图数据展示
    描述机器学习之神经网络算法原理
    python-pandas 高级功能(通过学习kaggle案例总结)
  • 原文地址:https://www.cnblogs.com/jwlfpzj/p/9162540.html
Copyright © 2011-2022 走看看