zoukankan      html  css  js  c++  java
  • 拼接sql

    //        var from="""
    //                    FROM
    //                        biz_value_added_tax_info a
    //                    WHERE
    //                        sys_status = 1
    //                  """
    //        var paras = mutableListOf<Any>()
    //
    //        //核心企业
    //        if(StringUtils.notBlank(coreEnterpriseId)  ){
    //            from += " AND a.core_enterprise_id = ? "
    //            var  coreEnterpriseId="${coreEnterpriseId?.trim()}"
    //            paras.add(coreEnterpriseId)
    //        }
    //        //年份
    //        if(StringUtils.notBlank(billingYear) ){
    //            from += " AND a.billing_year = ? "
    //            var years="${billingYear?.trim()}"
    //            paras.add(years)
    //        }
    //        //月份
    //        if(StringUtils.notBlank(billingMonth) ){
    //            from += " AND a.billing_month = ? "
    //            var mouths = "${billingMonth?.trim()}"
    //            paras.add(mouths.trim())
    //        }
            //获取付款单信息列表
    //        var IncomeInfoList  = dbp.find(select+from,*paras.toTypedArray<Any>())
     // 主画面的 select 语句
        var select= """
                        SELECT
                            id,
                            CONVERT(billing_year, char) AS billing_year,
                            billing_month,
                            core_enterprise_id,
                            assets_trusteeship_income,
                            account_receivable,
                            billing_amount,
                            tax_amount,
                            total_amount,
                            service_fee_income,
                            asset_custody_income,
                            service_charge_income,
                            input_tax,
                            transfer_input_tax,
                            real_payment
                        """
        /**
         * 主画面查询from SQL构造
         * @param ctl
         * @throws ActiveRecordException
         */
        fun fromSql( coreEnterpriseId:String ?, billingYear:String?, billingMonth:String? ): String? {
            var from="""
                        FROM
                            biz_value_added_tax_info a
                        WHERE
                            sys_status = 1
                      """
            var where = ""
            //核心企业
            if(StringUtils.notBlank(coreEnterpriseId)  ){
                where += " AND a.core_enterprise_id = '" + coreEnterpriseId?.trim() + "' "
            }
            //年份
            if(StringUtils.notBlank(billingYear) ){
                from += " AND a.billing_year = ' "+billingYear?.trim()+"' "
            }
            //月份
            if(StringUtils.notBlank(billingMonth) ){
                from += " AND a.billing_month = ' "+billingMonth?.trim()+"' "
            }
            return  from+where
        }
       /**
         * 财务部ABS费用表:管理一览画面
         * @param  billingYear
         *               年份
         * @param billingMonth
         *               月份
         * @param  coreEnterpriseId
         *               核心企业
         */
        fun pages(iwebReq: IwebReq, pageInfo: PageInfo, coreEnterpriseId:String ?, billingYear:String?, billingMonth:String? ): Page<Record>? {
            var dbp = DbPro.use(iwebReq.dsName)
            var pageIndex = pageInfo?.pageIndex ?: 1
            var pageSize = pageInfo?.pageSize ?: IwebConstant.DEFAULT_PAGE_SIZE
    
    //        var from="""
    //                    FROM
    //                        biz_value_added_tax_info a
    //                    WHERE
    //                        sys_status = 1
    //                  """
    //        var paras = mutableListOf<Any>()
    //
    //        //核心企业
    //        if(StringUtils.notBlank(coreEnterpriseId)  ){
    //            from += " AND a.core_enterprise_id = ? "
    //            var  coreEnterpriseId="${coreEnterpriseId?.trim()}"
    //            paras.add(coreEnterpriseId)
    //        }
    //        //年份
    //        if(StringUtils.notBlank(billingYear) ){
    //            from += " AND a.billing_year = ? "
    //            var years="${billingYear?.trim()}"
    //            paras.add(years)
    //        }
    //        //月份
    //        if(StringUtils.notBlank(billingMonth) ){
    //            from += " AND a.billing_month = ? "
    //            var mouths = "${billingMonth?.trim()}"
    //            paras.add(mouths.trim())
    //        }
    //        return dbp.paginate(pageIndex,pageSize,select,from,*paras.toTypedArray<Any>())
            var fromql=fromSql( coreEnterpriseId, billingYear, billingMonth)
            return dbp.paginate(pageIndex,pageSize,select,fromql)
        }
  • 相关阅读:
    vue.js 源代码学习笔记 ----- 工具方法 option
    日期字符串格式转换
    MySQL数据库的知识总结
    Mybatis 中#{}和${}的区别
    MySQL数据库 常用命令
    MySQL -进阶
    JQuery杂项方法
    ASP.NET MVC 扩展自定义视图引擎支持多模板&动态换肤skins机制
    C#各种导入Excel文件的数据的方法总结
    C#基础随手笔记之基础操作优化
  • 原文地址:https://www.cnblogs.com/xiaoniuniu886/p/10244323.html
Copyright © 2011-2022 走看看