Vintage表的写法(sql/python)

SQL写法

先建一个month表,明确月末时间点。

-- Create table `months`
--
CREATE TABLE months (
  num int(11) NOT NULL,
  yyyymm varchar(20) DEFAULT NULL,
  start_datetime datetime DEFAULT NULL,
  end_datetime datetime DEFAULT NULL,
  PRIMARY KEY (num)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 80,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_general_ci;

--
-- Create index `idx_end_datetime` on table `months`
--
ALTER TABLE months
ADD UNIQUE INDEX idx_end_datetime (end_datetime);

--
-- Create index `idx_start_datetime` on table `months`
--
ALTER TABLE months
ADD UNIQUE INDEX idx_start_datetime (start_datetime);

--
-- Create index `idx_yyyymm` on table `months`
--
ALTER TABLE months
ADD UNIQUE INDEX idx_yyyymm (yyyymm);


INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(61, '2019/01', '2019-01-01 00:00:00', '2019-01-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(62, '2019/02', '2019-02-01 00:00:00', '2019-02-28 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(63, '2019/03', '2019-03-01 00:00:00', '2019-03-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(64, '2019/04', '2019-04-01 00:00:00', '2019-04-30 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(65, '2019/05', '2019-05-01 00:00:00', '2019-05-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(66, '2019/06', '2019-06-01 00:00:00', '2019-06-30 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(67, '2019/07', '2019-07-01 00:00:00', '2019-07-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(68, '2019/08', '2019-08-01 00:00:00', '2019-08-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(69, '2019/09', '2019-09-01 00:00:00', '2019-09-30 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(70, '2019/10', '2019-10-01 00:00:00', '2019-10-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(71, '2019/11', '2019-11-01 00:00:00', '2019-11-30 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(72, '2019/12', '2019-12-01 00:00:00', '2019-12-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(73, '2020/01', '2020-01-01 00:00:00', '2020-01-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(74, '2020/02', '2020-02-01 00:00:00', '2020-02-29 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(75, '2020/03', '2020-03-01 00:00:00', '2020-03-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(76, '2020/04', '2020-04-01 00:00:00', '2020-04-30 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(77, '2020/05', '2020-05-01 00:00:00', '2020-05-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(78, '2020/06', '2020-06-01 00:00:00', '2020-06-30 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(79, '2020/07', '2020-07-01 00:00:00', '2020-07-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(80, '2020/08', '2020-08-01 00:00:00', '2020-08-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(81, '2020/09', '2020-09-01 00:00:00', '2020-09-30 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(82, '2020/10', '2020-10-01 00:00:00', '2020-10-31 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(83, '2020/11', '2020-11-01 00:00:00', '2020-11-30 23:59:59');
INSERT INTO months(num, yyyymm, start_datetime, end_datetime) VALUES(84, '2020/12', '2020-12-01 00:00:00', '2020-12-31 23:59:59');

再进入正题。

SELECT
  m.yyyymm                                                                                                                                                                                                                                                                                                                                                                                                                                      AS '放款年月',
  SUM(lrp.receivable_principal)                                                                                                                                                                                                                                                                                                                                                                                                                 AS '放款本金',
  COUNT(lrp.id)                                                                                                                                                                                                                                                                                                                                                                                                                                 AS '放款对应还款计划数',
  COUNT(DISTINCT lrp.user_id)                                                                                                                                                                                                                                                                                                                                                                                                                   AS '放款对应用户数',
  PERIOD_DIFF(DATE_FORMAT(STR_TO_DATE(m_after.yyyymm, '%Y/%m'), '%Y%m'), DATE_FORMAT(STR_TO_DATE(m.yyyymm, '%Y/%m'), '%Y%m'))                                                                                                                                                                                                                                                                                                                   AS '后续年月序号',
  m_after.yyyymm                                                                                                                                                                                                                                                                                                                                                                                                                                AS '后续年月',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), lrp.receivable_principal, 0))                                                                                                                                                                                                                                                                                                                 AS '累计应收本金',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), 1, 0))                                                                                                                                                                                                                                                                                                                                        AS '累计应收还款计划数',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), lrp.user_id, NULL))                                                                                                                                                                                                                                                                                                                AS '累计应收用户数',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 >= 1, lrp.receivable_principal, 0))                 AS '累计逾期本金',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 >= 1, 1, 0))                                        AS '累计逾期还款计划数',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 >= 1, lrp.user_id, NULL))                AS '累计逾期还款用户数',

  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 1 AND 3, lrp.receivable_principal, 0))      AS '累计逾期本金(1-3)',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 1 AND 3, 1, 0))                             AS '累计逾期还款计划数(1-3)',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 1 AND 3, lrp.user_id, NULL))     AS '累计逾期还款用户数(1-3)',

  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 1 AND 30, lrp.receivable_principal, 0))     AS '累计逾期本金(1-30)',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 1 AND 30, 1, 0))                            AS '累计逾期还款计划数(1-30)',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 1 AND 30, lrp.user_id, NULL))    AS '累计逾期还款用户数(1-30)',

  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 31 AND 60, lrp.receivable_principal, 0))    AS '累计逾期本金(31-60)',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 31 AND 60, 1, 0))                           AS '累计逾期还款计划数(31-60)',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 31 AND 60, lrp.user_id, NULL))   AS '累计逾期还款用户数(31-60)',

  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 61 AND 90, lrp.receivable_principal, 0))    AS '累计逾期本金(61-90)',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 61 AND 90, 1, 0))                           AS '累计逾期还款计划数(61-90)',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 61 AND 90, lrp.user_id, NULL))   AS '累计逾期还款用户数(61-90)',

  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 91 AND 120, lrp.receivable_principal, 0))   AS '累计逾期本金(91-120)',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 91 AND 120, 1, 0))                          AS '累计逾期还款计划数(91-120)',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 91 AND 120, lrp.user_id, NULL))  AS '累计逾期还款用户数(91-120)',

  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 121 AND 150, lrp.receivable_principal, 0))  AS '累计逾期本金(121-150)',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 121 AND 150, 1, 0))                         AS '累计逾期还款计划数(121-150)',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 121 AND 150, lrp.user_id, NULL)) AS '累计逾期还款用户数(121-150)',

  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 151 AND 180, lrp.receivable_principal, 0))  AS '累计逾期本金(151-180)',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 151 AND 180, 1, 0))                         AS '累计逾期还款计划数(151-180)',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 BETWEEN 151 AND 180, lrp.user_id, NULL)) AS '累计逾期还款用户数(151-180)',

  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 > 180, lrp.receivable_principal, 0))                AS '累计逾期本金(>180)',
  SUM(IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 > 180, 1, 0))                                       AS '累计逾期本金还款计划数(>180)',
  COUNT(DISTINCT IF(lrp.repayment_due_date <= IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime) AND lrp.repayment_status IN (4, 5, 6) AND DATEDIFF(IF(lrp.repayment_date IS NULL OR lrp.repayment_date > IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), IF(NOW() < m_after.end_datetime, NOW(), m_after.end_datetime), '2000/01/01 23:59:59'), lrp.repayment_due_date) + 1 > 180, lrp.user_id, NULL))               AS '累计逾期本金还款用户数(>180)'
FROM p2p_system.months m
  JOIN p2p_system.months m_after
    ON m_after.yyyymm >= m.yyyymm
    AND m_after.yyyymm <= '${QUERY_MONTH}'
  JOIN p2p_loan.loan_contract lc
    ON lc.isdel = 0
    AND lc.contract_status IN (19, 7, 8, 9, 10)
    AND lc.contract_transfer_time >= m.start_datetime
    AND lc.contract_transfer_time <= m.end_datetime
      ${IF(len(repayment_type)==0,"","AND lc.repayment_type = "+repayment_type)}
      ${IF(len(term_month)==0,"","AND lc.term_month IN("+term_month+")")}
      ${IF(len(term_day)==0,"","AND lc.term_day IN("+term_day+")")}
${IF(len(channel)==0,"","AND (CASE WHEN lc.channel = '###' THEN '###' END) IN("+channel+")")}
  JOIN p2p_loan.loan_repayment_plan lrp
    ON lrp.isdel = 0
    AND lrp.contract_number = lc.contract_number
WHERE m.yyyymm >= '${BEGIN_MONTH}'
AND m.yyyymm <= '${END_MONTH}'
GROUP BY m.yyyymm,
         m_after.yyyymm
ORDER BY m.yyyymm,
m_after.yyyymm

python写法(待补充)

你可能感兴趣的:(学习笔记)