1016. Phone Bills (25)

电话计费系统实现
本文介绍了一种基于时间分段的电话计费系统的实现方法,包括数据结构设计、记录筛选和排序逻辑,以及最终计费结果的计算和展示。

题目地址

https://www.patest.cn/contests/pat-a-practise/1016

题目描述

A long-distance telephone company charges its customers by the following rules:

Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When a customer starts connecting a long-distance call, the time will be recorded, and so will be the time when the customer hangs up the phone. Every calendar month, a bill is sent to the customer for each minute called (at a rate determined by the time of day). Your job is to prepare the bills for each month, given a set of phone call records.

Input Specification:

Each input file contains one test case. Each case has two parts: the rate structure, and the phone call records.

The rate structure consists of a line with 24 non-negative integers denoting the toll (cents/minute) from 00:00 - 01:00, the toll from 01:00 - 02:00, and so on for each hour in the day.

The next line contains a positive number N (<= 1000), followed by N lines of records. Each phone call record consists of the name of the customer (string of up to 20 characters without space), the time and date (mm:dd:hh:mm), and the word “on-line” or “off-line”.

For each test case, all dates will be within a single month. Each “on-line” record is paired with the chronologically next record for the same customer provided it is an “off-line” record. Any “on-line” records that are not paired with an “off-line” record are ignored, as are “off-line” records not paired with an “on-line” record. It is guaranteed that at least one call is well paired in the input. You may assume that no two records for the same customer have the same time. Times are recorded using a 24-hour clock.

Output Specification:

For each test case, you must print a phone bill for each customer.

Bills must be printed in alphabetical order of customers’ names. For each customer, first print in a line the name of the customer and the month of the bill in the format shown by the sample. Then for each time period of a call, print in one line the beginning and ending time and date (dd:hh:mm), the lasting time (in minute) and the charge of the call. The calls must be listed in chronological order. Finally, print the total charge for the month in the format shown by the sample.

Sample Input:

10 10 10 10 10 10 20 20 20 15 15 15 15 15 15 15 20 30 20 15 15 10 10 10
10
CYLL 01:01:06:01 on-line
CYLL 01:28:16:05 off-line
CYJJ 01:01:07:00 off-line
CYLL 01:01:08:03 off-line
CYJJ 01:01:05:59 on-line
aaa 01:01:01:03 on-line
aaa 01:02:00:01 on-line
CYLL 01:28:15:41 on-line
aaa 01:05:02:24 on-line
aaa 01:04:23:59 off-line

Sample Output:

CYJJ 01
01:05:59 01:07:00 61 $12.10
Total amount: $12.10
CYLL 01
01:06:01 01:08:03 122 $24.40
28:15:41 28:16:05 24 $3.85
Total amount: $28.25
aaa 01
02:00:01 04:23:59 4318 $638.80
Total amount: $638.80

ac 1

  • 计算时间和费用(采用与0点相减 计算的办法)
  • 如何剔除无效的记录 (原纪录排序后逐一判断)

ac代码(未优化)

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack> 
#include <map> 
#include <set> 
#include <unordered_map> 
#include <unordered_set> 

using namespace std;

const int INF = 0x7fffffff;
const int MIN_INF = - INF -1;
typedef long long int LL;

int fees[24];
int dayfee;
int n;

struct record
{
  string name;
  int mon;
  int day, h,m;
  int timeInt;
  bool on_off;
};

vector<record> records;

int getTimeInt(int day, int h,int m)
{
    return day * 24 * 60 + h * 60 + m;
}

// 以秒为单位 - 0:0:0的费用
int getCost(int day,int h,int m)
{
    int cost = 0;
    for(int i = 0; i < h; i++) // h
    {
        cost += fees[i] * 60;
    }
    cost += m * fees[h]; // m

    return cost + day * dayfee; // day
}

// 持续时间
int lastMin(int day1, int h1,int m1,int day2 , int h2,int m2)
{
    int t1 = getTimeInt(day1, h1, m1);
    int t2 = getTimeInt(day2, h2, m2);
    return t2 - t1;
}

// 所需花费
int lastCost(int day1, int h1,int m1,int day2, int h2,int m2)
{
    int c1 = getCost(day1,h1,m1);
    int c2 = getCost(day2,h2,m2);
    return c2 - c1;
}

struct data
{
  int dd;
  int hh;
  int mm;
  int dd2;
  int hh2;
  int mm2;
  int lasttime;
  double cost;
};

bool cmp1(record r1, record r2)
{
  if(r1.name < r2.name)
  {
    return true;
  }else if(r1.name == r2.name)
  {
    if(r1.timeInt < r2.timeInt)
    {
      return true;
    }
  }
  return false;
}

int main() 
{
    // freopen("in.txt","r",stdin);

    dayfee = 0;
    for(int i=0;i<24;i++)
    {
        scanf("%d",&fees[i]);
        dayfee += 60 * fees[i];
    }
    scanf("%d",&n);

    record rt;
    for(int i=0;i<n;i++)
    {
        cin >> rt.name;
        scanf("%d:%d:%d:%d",&rt.mon, &rt.day, &rt.h, &rt.m);
        string r_on_off;
        cin >> r_on_off;
        if(r_on_off == "on-line")
        {
            rt.on_off = true;
        }else{
            rt.on_off = false;
        }
        rt.timeInt = getTimeInt(rt.day, rt.h,rt.m);
        records.push_back(rt);
    }

    sort(records.begin(), records.end(),cmp1);
    int len = records.size();

    // 得到有效的record
    vector<record> vr;

    int index = 0; // 按顺序找到第一个on-line
    while(index < len)
    {
        if(records[index].on_off == false)
            index ++;
        else
            break;
    }
    vr.push_back(records[index]);
    string lastName = records[index].name;
    bool lastLine = true;

    for(int i= index + 1; i < len;i++)
    {
        if(records[i].name == lastName) // 与上一name相同
        {
            if(lastLine)
            {
                if(records[i].on_off == true){
                    vr.pop_back();
                    vr.push_back(records[i]);
                }else{
                    vr.push_back(records[i]);
                    lastLine = false;
                }
            }else{
                if(records[i].on_off == true)
                {
                    vr.push_back(records[i]);
                    lastLine = true;
                }
            }

        }else{ // 与上一个name不同

            if(records[i].on_off == false)
                continue;
            if(lastLine)
                vr.pop_back();

            vr.push_back(records[i]);
            lastName = records[i].name;
            lastLine = true;
        }
    }// endfor
    int vrLen = vr.size();
    if(vr[vrLen - 1].on_off == true)
    {
        vr.pop_back();
        vrLen--;
    }

    // 计算结果 
  int mon = vr[0].mon;

  lastName = "";
  vector<data> ans;
  for(int i=0;i<vrLen;i+=2)
  {
    record r1 = vr[i];
    record r2 = vr[i+1];
    if(r1.name != lastName)
    {
      if(lastName != "")
      {
        cout << lastName;
        printf(" %02d\n",mon);
        double rtt = 0;
        int ansLen = ans.size();
        for(int j= 0;j<ansLen;j++)
        {
          double cc = 0.01 * ans[j].cost;
          rtt += cc;
          printf("%02d:%02d:%02d %02d:%02d:%02d %d $%.2lf\n",
            ans[j].dd,ans[j].hh,ans[j].mm,
            ans[j].dd2,ans[j].hh2,ans[j].mm2,
            ans[j].lasttime,cc
            );
        }
        printf("Total amount: $%.2lf\n",rtt);
        ans.clear();
      }
      data dt;
      dt.dd = r1.day;
      dt.hh = r1.h;
      dt.mm = r1.m;

      dt.dd2 = r2.day;
      dt.hh2 = r2.h;
      dt.mm2 = r2.m;

      dt.lasttime = lastMin(r1.day, r1.h,r1.m, r2.day, r2.h, r2.m);
      dt.cost = lastCost(r1.day, r1.h,r1.m, r2.day, r2.h, r2.m);

      ans.push_back(dt);
      lastName = r1.name;
    }else{
      data dt;
      dt.dd = r1.day;
      dt.hh = r1.h;
      dt.mm = r1.m;

      dt.dd2 = r2.day;
      dt.hh2 = r2.h;
      dt.mm2 = r2.m;

      dt.lasttime = lastMin(r1.day, r1.h,r1.m, r2.day, r2.h, r2.m);
      dt.cost = lastCost(r1.day, r1.h,r1.m, r2.day, r2.h, r2.m);

      ans.push_back(dt);
    }
  }

  if(!ans.empty())
  {
      cout << lastName;
      printf(" %02d\n",mon);
      double rtt = 0;
      int ansLen = ans.size();
      for(int j= 0;j<ansLen;j++)
      {
        double cc = 0.01 * ans[j].cost;
        rtt += cc;
        printf("%02d:%02d:%02d %02d:%02d:%02d %d $%.2lf\n",
          ans[j].dd,ans[j].hh,ans[j].mm,
          ans[j].dd2,ans[j].hh2,ans[j].mm2,
          ans[j].lasttime,cc
          );
      }
      printf("Total amount: $%.2lf\n",rtt);
      ans.clear();
  }

  return 0;
}

使用map结构 在处理结果是更加清楚

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack> 
#include <map> 
#include <set> 
#include <unordered_map> 
#include <unordered_set> 

using namespace std;

const int INF = 0x7fffffff;
const int MIN_INF = - INF -1;
typedef long long int LL;

int fees[24];
int dayfee;
int n;

struct record
{
  string name;
  int mon;
  int day, h,m;
  int timeInt;
  bool on_off;
};

bool cmp1(record r1, record r2) // 记录排序规则
{
    if(r1.name < r2.name)
        return true;
    else if(r1.name == r2.name)
    {
        if(r1.timeInt < r2.timeInt)
            return true;
    }
    return false;
}

vector<record> records;

int getTimeInt(int day, int h,int m)
{
    return day * 24 * 60 + h * 60 + m;
}

// 以秒为单位 - 0:0:0的费用
int getCost(int day,int h,int m)
{
    int cost = 0;
    for(int i = 0; i < h; i++) // h
    {
        cost += fees[i] * 60;
    }
    cost += m * fees[h]; // m

    return cost + day * dayfee; // day
}

// 持续时间
int lastMin(int day1, int h1,int m1,int day2 , int h2,int m2)
{
    int t1 = getTimeInt(day1, h1, m1);
    int t2 = getTimeInt(day2, h2, m2);
    return t2 - t1;
}

// 所需花费
int lastCost(int day1, int h1,int m1,int day2, int h2,int m2)
{
    int c1 = getCost(day1,h1,m1);
    int c2 = getCost(day2,h2,m2);
    return c2 - c1;
}

// 记录结果的结构体
struct data
{
    int dd;
    int hh;
    int mm;
    int dd2;
    int hh2;
    int mm2;
    int lasttime;
    double cost;
};

int main() 
{
    freopen("in.txt","r",stdin);

    dayfee = 0;
    for(int i=0;i<24;i++)
    {
        scanf("%d",&fees[i]);
        dayfee += 60 * fees[i];
    }
    scanf("%d",&n);

    record rt;
    for(int i=0;i<n;i++)
    {
        cin >> rt.name;
        scanf("%d:%d:%d:%d",&rt.mon, &rt.day, &rt.h, &rt.m);
        string r_on_off;
        cin >> r_on_off;
        if(r_on_off == "on-line")
        {
            rt.on_off = true;
        }else{
            rt.on_off = false;
        }
        rt.timeInt = getTimeInt(rt.day, rt.h,rt.m);
        records.push_back(rt);
    }

    sort(records.begin(), records.end(),cmp1);
    int len = records.size();

    // 得到有效的record
    vector<record> vr;

    int index = 0; // 按顺序找到第一个on-line
    while(index < len)
    {
        if(records[index].on_off == false)
            index ++;
        else
            break;
    }
    vr.push_back(records[index]);
    string lastName = records[index].name;
    bool lastLine = true;

    for(int i= index + 1; i < len;i++)
    {
        if(records[i].name == lastName) // 与上一name相同
        {
            if(lastLine)
            {
                if(records[i].on_off == true){
                    vr.pop_back();
                    vr.push_back(records[i]);
                }else{
                    vr.push_back(records[i]);
                    lastLine = false;
                }
            }else{
                if(records[i].on_off == true)
                {
                    vr.push_back(records[i]);
                    lastLine = true;
                }
            }

        }else{ // 与上一个name不同

            if(records[i].on_off == false)
                continue;
            if(lastLine)
                vr.pop_back();

            vr.push_back(records[i]);
            lastName = records[i].name;
            lastLine = true;
        }
    }// endfor
    int vrLen = vr.size();
    if(vr[vrLen - 1].on_off == true)
    {
        vr.pop_back();
        vrLen--;
    }

    // 计算结果 使用map 存储
    int mon = vr[0].mon;
    map<string,vector<data>> mp;
    map<string,double> mpTotal;

    for(int i=0;i<vrLen;i+=2) // 每次取两条记录
    {
        record r1 = vr[i];
        record r2 = vr[i+1];

        data dt;
        dt.dd = r1.day;
        dt.hh = r1.h;
        dt.mm = r1.m;

        dt.dd2 = r2.day;
        dt.hh2 = r2.h;
        dt.mm2 = r2.m;

        dt.lasttime = lastMin(r1.day, r1.h,r1.m, r2.day, r2.h, r2.m);
        dt.cost = lastCost(r1.day, r1.h,r1.m, r2.day, r2.h, r2.m);

        mp[r1.name].push_back(dt);
        mpTotal[r1.name] += dt.cost; 
    }

    // 打印出结果
    map<string,vector<data>>::iterator it = mp.begin();
    while(it != mp.end())
    {
        cout << it->first;
        printf(" %02d\n",mon);

        int ansLen = it->second.size();
        for(int j= 0;j<ansLen;j++)
        {
            double cc = 0.01 * it->second[j].cost;

            printf("%02d:%02d:%02d %02d:%02d:%02d %d $%.2lf\n",
            it->second[j].dd, it->second[j].hh, it->second[j].mm,
            it->second[j].dd2, it->second[j].hh2, it->second[j].mm2,
            it->second[j].lasttime,cc
            );
        }
        printf("Total amount: $%.2lf\n",mpTotal[it->first] * 0.01);

        ++it;
    }

    return 0;
}

ac3

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack> 
#include <map> 
#include <set> 
#include <unordered_map>

using namespace std;

const int INF = 0x7fffffff;
const int MIN_INF = - INF -1;
typedef long long int LL;

const int N  = 10005;

int day24[24];
int daycost;

int n;

struct record{
    string name;
    int mon;
    int dd;
    int hh;
    int mm;
    bool onoff;
    int tTime;
};

vector<record> vr;
int mon;

bool cmp(record r1, record r2)
{
    if(r1.name < r2.name)
        return true;
    else if(r1.name == r2.name)
    {
        if(r1.tTime < r2.tTime)
            return true;
    }
    return false;
}


int getCost(int d,int h,int m)
{
    double ans = 0;
    for(int i=0;i<h;i++)
    {
        ans += day24[i] * 60;
    }
    ans += day24[h] * m;
    ans += d * daycost;
    return ans;
}

struct data{
    int d1,h1,m1;
    int d2,h2,m2;
    int min;
    double money;
};

int main()
{
    //freopen("in.txt","r",stdin);
    daycost = 0;
    for(int i=0;i<24;i++)
    {
        scanf("%d", &day24[i]);
        daycost += day24[i] * 60;
    }
    scanf("%d", &n);
    record rt;
    string on_off;
    for(int i=0;i<n;i++)
    {
        cin >> rt.name;
        scanf("%d:%d:%d:%d", &rt.mon, &rt.dd, &rt.hh, &rt.mm);
        mon = rt.mon;
        cin >> on_off;
        if(on_off == "on-line")
        {
            rt.onoff = true;
        }else{
            rt.onoff = false;
        }
        rt.tTime = rt.dd * 24 * 60 + rt.hh * 60 +  rt.mm;
        vr.push_back(rt);
    }

    sort(vr.begin(), vr.end(),cmp);

    vector<record> filter;

    int index=0;
    while(index < n && vr[index].onoff != true)
        index ++;

    filter.push_back(vr[index]);

    string lastName =  vr[index].name;
    bool lastOnoff = true;
    for(int i = index + 1; i< n;i++)
    {
        if(vr[i].name == lastName)
        {
            if(lastOnoff)
            {   
                if(vr[i].onoff)
                {
                    filter.pop_back();
                    filter.push_back(vr[i]);
                }else{
                    filter.push_back(vr[i]);
                    lastOnoff = false;
                }
            }else{
                if(vr[i].onoff)
                {
                    filter.push_back(vr[i]);
                    lastOnoff = true;
                }else{

                }
            }
        }else{
            if(lastOnoff)
            {
                if(vr[i].onoff)
                {
                    filter.pop_back();
                    filter.push_back(vr[i]);
                    lastName = vr[i].name;
                    lastOnoff = true;
                }else{

                }
            }else{
                if(vr[i].onoff)
                {
                    filter.push_back(vr[i]);
                    lastName = vr[i].name;
                    lastOnoff = true;
                }else{

                }
            }
        }
    }

    int flen = filter.size();
    if(filter[flen -1].onoff == true)
    {
        filter.pop_back();
        flen --;
    }

    map<string,vector<data>> mp;
    map<string,int> mpTcost;

    for(int i =0;i<flen;i+=2)
    {
        record c1 = filter[i];
        record c2 = filter[i+1];

        data dt;
        dt.d1 = c1.dd;
        dt.h1 = c1.hh;
        dt.m1 = c1.mm;

        dt.d2 = c2.dd;
        dt.h2 = c2.hh;
        dt.m2 = c2.mm;

        dt.min = c2.tTime - c1.tTime;
        dt.money = getCost(c2.dd, c2.hh, c2.mm) - getCost(c1.dd, c1.hh, c1.mm);
        mp[c1.name].push_back(dt);
        mpTcost[c1.name] += dt.money;
    }

    map<string,vector<data>>::iterator it = mp.begin();
    while(it != mp.end())
    {
        cout << it ->first << " ";
        printf("%02d\n",mon);

        vector<data> dt2 = it->second;
        int len2 = dt2.size();
        for(int i=0;i<len2;i++)
        {
            printf("%02d:%02d:%02d %02d:%02d:%02d %d $%.2lf\n",
                dt2[i].d1, dt2[i].h1, dt2[i].m1,dt2[i].d2, dt2[i].h2, dt2[i].m2,
                dt2[i].min, (0.01 * dt2[i].money));
        };

        printf("Total amount: $%.2lf\n", 0.01 * mpTcost[it->first]);

        ++it;
    }
    //printf("\n");
    return 0;
}
优化这个sql SELECT count( 1 ) FROM ( SELECT B.ID, B.PURCHASE_REQUEST_ID, B.MATERIAL_ID, B.MATERIAL_CODE, B.MATERIAL_NAME, B.STANDARD, B.MODEL_ID, B.BILL_ROW_ID, B.BILL_NO, BILL_NAME, B.MODEL_CODE, B.MODEL_NAME, B.PARENT_MODEL_ID, B.PARENT_MODEL_CODE, B.PARENT_MODEL_NAME, B.UNIT_CODE, B.UNIT_NAME, B.PURCHASE_TYPE_CODE, CAST( NVL( B.APPLY_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS APPLY_NUM, CAST( NVL( B.DEAL_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS DEAL_NUM, CAST( NVL( B.RETURN_NUM, 0 ) AS NUMBER ( 24, 10 ) ) AS RETURN_NUM, B.DEAL_USER_ID, B.DEAL_USER_NAME, CAST( NVL( B.PRICE, 0 ) AS NUMBER ( 24, 10 ) ) AS PRICE, CAST( NVL( B.AMOUNT, 0 ) AS NUMBER ( 24, 10 ) ) AMOUNT, B.IMPLEMENT_CODE, B.IMPLEMENT_NAME, B.IMPLEMENT_INVEST_AMOUNT, B.PURCHASE_MANAGER_ID, B.PURCHASE_MANAGER_NAME, B.PROVIDER_ID, B.PROVIDER_NAME, B.REMARK, B.DELIVER_AREA, B.DELIVER_ADDRESS, B.RECEIVE_PEOPLE, B.RECEIVE_PEOPLE_PHONE, B.ITEM_STATUS, B.COST_CENTER, B.COST_BUDGET_CODE, B.COST_IMPLEMENT_NAME, B.FRAME_CONT_ID, B.FRAME_CONT_CODE, B.FRAME_CONT_NAME, B.DETAIL_CONFIG, B.PURCHASE_CATEGORY_CODE, B.INVOICE_TITLE_CODE, B.INVOICE_SEND_ADDRRSS, B.MATERIAL_REQUEST_ITEM_ID, B.YEAR, B.DELETE_FLAG, B.PROVINCE_CODE, B.REASON, B.PARENT_ITEM_ID, B.FRAME_CONT_ITEM_ID, B.SUB_MATERIAL_REQUEST_ID, B.SUB_MATERIAL_REQUEST_CODE, B.MATERIAL_URL, B.RECOMMEND_PROVIDER_NAMES, C.PURCHASE_REQUEST_CODE, C.PURCHASE_REQUEST_NAME, C.APPLY_TYPE_CODE, C.CREATOR_NAME, C.APPLY_TELEPHONE, C.COMPANY_NAME, C.DEPT_NAME, B.CREATE_TIME, TO_CHAR( B.CREATE_TIME, 'YYYY-MM-DD' ) CREATE_TIME_STR, C.ARRIVE_TIME, C.IS_TO_END, C.MONEY_WAY_CODE, C.OWN, C.APPLY_CATEGORY_CODE, C.manu_Type, C.BILL_ID, MMD.MATERIAL_TYPE_CODE, B.BRANCH_COMPANY_DEAL_USER_ID, B.BRANCH_COMPANY_DEAL_USER_NAME, ( SELECT ORG_NAME FROM ORGANIZATIONS WHERE DELETE_FLAG = '0' AND ORG_CODE = ( SELECT PARENT_COMPANY_NO FROM ORGANIZATIONS WHERE ID = B.MATERIAL_DEPT_ID )) AS MATERIAL_COMPANY_NAME, B.ORIGINAL, B.PROVIDER_PRODUCT_MODEL, B.PROVIDER_PRODUCT_NAME, B.PRODUCT_DESC, B.Back_Flag, CASE WHEN MMD.material_type_code = 'WZ' THEN '1' WHEN MMD.material_type_code = 'FW' THEN '2' ELSE '3' END apply_category_code_item, NVL( C.IS_CARDSYSTEM_REQUEST, '0' ) IS_CARDSYSTEM_REQUEST, B.APPLY_GROUP_AUTHORITES, B.SCIENTIFIC_RESEARCH_ID, B.SCIENTIFIC_RESEARCH_CODE, B.SCIENTIFIC_RESEARCH_NAME, B.PREQUALFY_CODE, nvl( C.IS_QUICK, '0' ) AS IS_QUICK, C.PURCHASE_WAY_CODE, C.PURCHASE_TYPE_CODE PURCHASE_TYPE_CODE_P, C.ORIGINAL_TYPE, C.PURCHASE_REQUEST_BILLS_TYPE, B.IS_FRAME_CONT_MONAD FROM PURCHASE_REQUEST_ITEM B LEFT JOIN PURCHASE_REQUEST C ON B.PURCHASE_REQUEST_ID = C.ID LEFT JOIN MATERIAL_DATA MMD ON MMD.ID = B.MATERIAL_ID AND MMD.DELETE_FLAG = '0' WHERE B.delete_flag = '0' AND B.Item_Status IN ( 1 ) AND NOT EXISTS ( SELECT * FROM purchase_request_item_log pril WHERE B.id = pril.purchase_request_item_id AND pril.lock_status = '1' AND pril.delete_flag = '0' ) AND ( ( c.apply_type_code NOT IN ( '20', '41', '3' ) AND nvl( B.Apply_Num, 0 ) > nvl( B.Deal_Num, 0 )) OR c.apply_type_code IN ( '20', '41', '3' ) ) AND B.Deal_User_Id =: 1 AND C.MONEY_WAY_CODE =: 2 AND C.APPLY_TYPE_CODE =: 3 AND C.PAY_OUT_TYPE_CODE =: 4 AND C.APPLY_CATEGORY_CODE =: 5 AND NVL( C.IS_CARDSYSTEM_REQUEST, '0' ) = : 6 AND NOT EXISTS ( SELECT * FROM purchase_request_item p left join material_province mp ON p.material_id = mp.material_id WHERE p.delete_flag = 0 AND mp.delete_flag = 0 AND mp.material_status = 03 AND mp.org_code = p.province_code AND p.id = B.id ) ORDER BY C.ID, B.ID ASC)
06-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值