zoukankan      html  css  js  c++  java
  • LIKE CONCAT 连用

    SELECT
        (@i :=@i + 1) AS number,
        x.uuid,
        x.payment_code,
        x.supplier_name,
        x.receive_money,
        x.is_export_flag,
        x.export_time,
        x.payer,
        x.region_name,
        x.user_name,
        x.marketer_id ,
    x.region_id
    FROM
        (
            SELECT DISTINCT
                a.uuid,
                a.payment_code,
                a.supplier_name,
                a.receive_money,
    
            IF (
                is_export_flag = 0,
                '未导出',
                '已导出'
            ) AS is_export_flag,
            a.export_time,
            b.payer,
            d.region_name,
             GROUP_CONCAT(DISTINCT f.user_name) AS user_name,
    -- ( f.user_name )AS user_name,
            e.marketer_id,
    d.uuid as region_id
        FROM
            biz_lc_payment_info a,
            biz_lc_payment_invoice_info b
        LEFT JOIN biz_item_company c ON b.payer = c.item_company_name
        AND c.sys_status = 1
        LEFT JOIN biz_item_region d ON c.region_id = d.uuid
        AND d.sys_status = 1
        LEFT JOIN biz_link_marketer_region e ON e.region_id = d.uuid
        AND d.sys_status = 1
        LEFT JOIN sys_user f ON e.marketer_id LIKE CONCAT('%', f.uuid, '%')
        AND f.sys_status = 1
        WHERE
            a.payment_id = b.payment_id
        AND a.sys_status = 1
        AND b.sys_status = 1
        GROUP BY
            a.uuid
        ) x,
        (SELECT @i := 0) AS y
    WHERE
    --     x.marketer_id LIKE '%u1032%' 
     x.is_export_flag = '已导出' 

     String StrSql = " SELECT "
                    + " CASE WHEN b.ACTIVITY_NAME = '非常规价格申请' THEN '申请中' "
                    + " WHEN b.ACTIVITY_NAME = '资金部价格审批'  THEN '金融副总监审批中' "
                    + " WHEN b.ACTIVITY_NAME = '总经理价格审批'  THEN '总经理审批中' "
                    + " WHEN b.ACTIVITY_NAME = '董事长价格审批' and b.`status`<> '已完成'  THEN '董事长审批中' "
                    + " WHEN b.ACTIVITY_NAME = '董事长价格审批' and b.`status`= '已完成'  THEN '已通过' "
                    + " END AS activity_name "
                +" FROM "
                    + " bpm_process_instance a, "
                    + " bpm_last_activity b,"
                    + " biz_un_price_apply c  "
                +" WHERE "
                    + " a.instance_id = b.instance_id "
                    + "    AND a.process_name = 'BusinessModel2.0/非常规价格审批流程' "
                    + "    AND a.biz_uuid = c.uuid "
                    + "    AND a.sys_status = 1 "
                    + "    AND b.sys_status = 1 "
                    + "    AND c.sys_status = 1 "
                    + " AND c.pay_id = ? "  ;
                       

    String getUserNames = String.format(
                            "SELECT " +
                                    "    GROUP_CONCAT(user_name) AS user_names " +
                                    "FROM " +
                                    "    sys_user " +
                                    "WHERE " +
                                    "    sys_status = 1 " +


    fileName = fileName.substring(0, fileName.lastIndexOf("."));                                "AND uuid IN (%s)", marketerIds);

        // 避免下载的的文件名重复
            // 先去掉后缀
            if (fileName.contains(".")) {
                fileName = fileName.substring(0, fileName.lastIndexOf("."));
            }

     

  • 相关阅读:
    如何用redis/memcache做Mysql缓存层?
    孤儿进程和僵尸进程总结
    二叉树的遍历(非递归)
    Linux进程分配内存的两种方式--brk() 和mmap()
    Hbase
    cgroup 分析之CPU和内存部分
    十道海量数据处理面试题与十个方法大总结
    快速定位性能瓶颈,检查出所有资源(CPU、内存、磁盘IO等)的利用率(utilization)、饱和度(saturation)和错误(error)度量,即USE方法
    红黑树
    tcp 两个重要窗口:滑动窗口 和 拥塞窗口
  • 原文地址:https://www.cnblogs.com/xiaoniuniu886/p/11118996.html
Copyright © 2011-2022 走看看