SQL Server:根据起始日期和终止日期以及缴费方式计算每月的缴费记录

本文介绍了一个SQL过程,用于根据合同的起租日期、终止日期及缴费方式计算租金。该过程首先验证输入的有效性,然后根据不同的缴费周期计算每月的租金,并将结果存入数据库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

做项目时经常碰到的业务:根据合同指定的起租日期和终止日期以及缴费方式,计算出两个日期之间的缴费记录,以便提醒缴费。

 

说明:

1、例子中的两个日期、缴费方式从合同中获取。

2、缴费方式主要有:月份、季付、半年付、年付,且以汉字的形式保存在数据库。

 

思路:根据终止日期和起租日期,计算出两个日期之间相差多少个月份,再根据缴费方式进行月份叠加,即

月付*1,季付*3,半年付*6,年付*12,如此计算出每个月缴费的日期以及下个月缴费的日期,再计算这两个日期之间的天数,最后乘以每天的房租费用,就可以得到每个月应该缴纳的总房租。

SQL如下:

CREATE PROCEDURE [dbo].[calcuteContractPay] 
	@id int --合同序号
AS
BEGIN
	
	SET NOCOUNT ON;

	--1、校验合同序号是否存在
	if @id is null
	begin
		raiserror('必须告知合同序号',16,1);
		return ;
	end   

	--2、获取缴费方式
	declare @field12 varchar(20);--缴费方式
	declare @field39 datetime;--起租日期
	declare @field40 datetime;--截止日期
	declare @field66 numeric(18,2);--每天总租金
	select @field12 = field12,@field39=field39,@field40=field40,@field66=isnull(field66,0) from table3 where field1=@id;
	if @field12 is null or len(@field12)<=0
	begin
		raiserror('必须告知缴费方式',16,1);
		return ;
	end
	
	
	--3、校验日期是否合法
	declare @day int;--两者之间的天数
	set @day = datediff(day,@field39,@field40);
	if(@day<=0)
	begin
		raiserror('终止日期必须大于起租日期',16,1);
		return ;
	end	
	
	--4、根据缴费方式判断总共要输入多少条缴费记录
	set @field12 = rtrim(ltrim(@field12));--去除空格
	declare @monthes int;
	declare @totalRent numeric(18,2);--总租金
	declare @type int;--缴费类型
	if(@field12='月付') set @type=1;
	else if(@field12='季付') set @type=2;
	else if(@field12='半年付') set @type=3;
	else if(@field12='年付') set @type=4;
	
	--4、1 计算开始日期与终止之间有多少个月份		
	set @monthes = datediff(month,@field39,@field40);--月份
	
	if @monthes=0 --说明是在当月/当季/半年之内/当年起租、终止,那么只需要直接计算两者之间的天数
	begin
		set @totalRent = @day*@field66;--天数*每天的总价
		begin
			--添加缴费记录
			insert into table6  
			select field1,field2,field4,field5,field12,field39,@totalRent,field42,field64,field11,0,NULL,0,@totalRent,@totalRent,0,							field13,@day,field40 
			from table3 where field1=@id;
		end
	end
	else --说明至少有一个月
	begin
		declare @startTime datetime;--开始日期
		declare @endTime datetime;--结束日期
		declare @num int;
		set @num=0;
		while(@num<=@monthes)	
		begin
			--print @num;
			set @startTime = dateadd(month,@num,@field39);--计算每个月应缴费日期
			if(@type=1) set @num=@num+1;--月付
			else if(@type=2) set @num=@num+3;--季付
			else if(@type=3) set @num=@num+6;--半年付
			else if(@type=4) set @num=@num+12;--年付

			set @endTime = dateadd(month,@num,@field39);--下个月的缴费日期
			--终止日期减去下一个月的日期,如果终止日期比下一个月的日期大,说明还需要再缴一个月,那么使用下一个月的日期,否则使用终止日期
			set @day = datediff(day,@endTime,@field40);
			if(@day<0) set @endTime=@field40;
			--计算开始日期和结束日期之间的天数
			set @day = datediff(day,@startTime,@endTime);
			set @totalRent = @day*@field66;--天数*每天的总价
			if(@totalRent>0)
			begin
				insert into table6  
				select field1,field2,field4,field5,field12,@startTime,@totalRent,field42,field64,field11,0,NULL,0,@totalRent,@totalRent,0,							field13,@day,@endTime 
				from table3 where field1=@id;
			end
		end		
	end

END
GO

 

 

#include "financialwidget.h" #include "ui_financialwidget.h" #include <QVBoxLayout> #include <QHBoxLayout> #include <QChart> #include <QChartView> #include <QLabel> #include <QComboBox> #include <QDate> #include <QDateEdit> #include <QPushButton> #include <QStringList> #include <QTableWidget> #include <QSqlQuery> #include <QHeaderView> #include <QDialog> #include <QFormLayout> #include <QLineEdit> #include <QDialogButtonBox> #include <QSqlError> #include <QPieSeries> #include <QPieSlice> #include <QLineSeries> #include <QDateTimeAxis> #include <QValueAxis> #include <QMessageBox> FinancialWidget::FinancialWidget(QWidget *parent) : QWidget(parent) , ui(new Ui::FinancialWidget) { ui->setupUi(this); setupUI(); populateStudentComboBox(); } FinancialWidget::~FinancialWidget() { delete ui; } void FinancialWidget::setupUI() { QVBoxLayout* mainLayout = new QVBoxLayout(this); QHBoxLayout* topLayout = new QHBoxLayout(); QHBoxLayout* middleLayout = new QHBoxLayout(); chartView = new QChartView(); mainLayout->addLayout(topLayout); mainLayout->addLayout(middleLayout, 60); // 占60%高度 mainLayout->addWidget(chartView, 40); // 占40%高度 // =============== 顶部筛选条件与按钮布局 =============== topLayout->addWidget(new QLabel("学生姓名:", this)); studentComboBox = new QComboBox(this); topLayout->addWidget(studentComboBox); topLayout->addWidget(new QLabel("起始日期:", this)); startDateEdit = new QDateEdit(QDate::currentDate().addMonths(-1)); startDateEdit->setCalendarPopup(true); topLayout->addWidget(startDateEdit); topLayout->addWidget(new QLabel("结束日期:", this)); endDateEdit = new QDateEdit(QDate::currentDate()); endDateEdit->setCalendarPopup(true); topLayout->addWidget(endDateEdit); addButton = new QPushButton("添加"); deleteButton = new QPushButton("删除"); editButton = new QPushButton("修改"); topLayout->addWidget(addButton); topLayout->addWidget(deleteButton); topLayout->addWidget(editButton); topLayout->addStretch(); // =============== 主内容布局 =============== tableWidget = new QTableWidget(); tableWidget->setFixedWidth(550); tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); tableWidget->setAlternatingRowColors(true); QStringList header = QStringList() << "ID" << "学生名字" << "缴费日期" << "金额" << "支付类型" << "备注"; tableWidget->setColumnCount(header.count()); tableWidget->setHorizontalHeaderLabels(header); tableWidget->setColumnHidden(0, true); middleLayout->addWidget(tableWidget); //饼状图 pieChartView = new QChartView(); middleLayout->addWidget(pieChartView); chartView->setRenderHint(QPainter::Antialiasing); chartView->setMinimumHeight(200); // 最小高度保障 // 连接 // 打印所有控件地址,检查是否为 nullptr qDebug() << "addButton:" << addButton; qDebug() << "deleteButton:" << deleteButton; qDebug() << "editButton:" << editButton; qDebug() << "studentComboBox:" << studentComboBox; qDebug() << "startDateEdit:" << startDateEdit; qDebug() << "endDateEdit:" << endDateEdit; connect(addButton, &QPushButton::clicked, this, &FinancialWidget::addRecord); connect(deleteButton, &QPushButton::clicked, this, &FinancialWidget::deleteRecord); connect(editButton, &QPushButton::clicked, this, &FinancialWidget::editRecord); connect(studentComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FinancialWidget::loadFinancialRecords); connect(startDateEdit, &QDateEdit::dateChanged, this, &FinancialWidget::loadFinancialRecords); connect(endDateEdit, &QDateEdit::dateChanged, this, &FinancialWidget::loadFinancialRecords); } void FinancialWidget::loadFinancialRecords() { tableWidget->setRowCount(0); QString studentId = studentComboBox->currentData().toString(); QDate startDate = startDateEdit->date(); QDate endDate = endDateEdit->date(); QString queryStr = QString( "SELECT fr.id, s.name, fr.payment_date, fr.amount, fr.payment_type, fr.notes " "FROM financialRecords fr " "JOIN studentInfo s ON fr.student_id = s.id " "WHERE fr.payment_date BETWEEN '%1' AND '%2' %3" ).arg(startDate.toString("yyyy-MM-dd"), endDate.toString("yyyy-MM-dd"), (studentId != "-1") ? QString("AND fr.student_id = '%1'").arg(studentId) : ""); QSqlQuery query(queryStr); while (query.next()) { int row = tableWidget->rowCount(); tableWidget->insertRow(row); for (int col = 0; col < 6; ++col) { QTableWidgetItem* item = new QTableWidgetItem(query.value(col).toString()); item->setTextAlignment(Qt::AlignCenter); tableWidget->setItem(row, col, item); } } tableWidget->horizontalHeader()->setDefaultAlignment(Qt::AlignCenter); updateChart(); // 更新下方折线图 updatePieChart(); // 更新右侧饼图 } void FinancialWidget::populateStudentComboBox() { studentComboBox->clear(); studentComboBox->addItem("所有学生", QVariant("-1")); // "-1" 表示所有学生 QSqlQuery query("SELECT id, name FROM studentInfo"); while (query.next()) { QString id = query.value(0).toString(); // id 是字符串类型 QString name = query.value(1).toString(); studentComboBox->addItem(name, QVariant(id)); } } void FinancialWidget::addRecord() { QDialog dialog(this); dialog.setWindowTitle("添加缴费记录"); QFormLayout form(&dialog); // 学生名称下拉菜单 QComboBox* studentNameComboBox = new QComboBox(&dialog); QSqlQuery query("SELECT id, name FROM studentInfo"); while (query.next()) { QString id = query.value(0).toString(); QString name = query.value(1).toString(); studentNameComboBox->addItem(name, QVariant(id)); // 将学生ID与名称关联 } QDateEdit* paymentDateEdit = new QDateEdit(&dialog); paymentDateEdit->setDate(QDate::currentDate()); // 设置默认值为当前日期 paymentDateEdit->setCalendarPopup(true); // 允许弹出日历选择器 QLineEdit* amountEdit = new QLineEdit(&dialog); QLineEdit* feeTypeEdit = new QLineEdit(&dialog); QLineEdit* remarkEdit = new QLineEdit(&dialog); form.addRow("学生名称:", studentNameComboBox); form.addRow("缴费日期:", paymentDateEdit); // 修改为 QDateEdit form.addRow("金额:", amountEdit); form.addRow("支付类型:", feeTypeEdit); form.addRow("备注:", remarkEdit); QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog); buttonBox.button(QDialogButtonBox::Ok)->setText("确定"); buttonBox.button(QDialogButtonBox::Cancel)->setText("取消"); form.addRow(&buttonBox); QObject::connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); QObject::connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); if (dialog.exec() == QDialog::Accepted) { QString studentId = studentNameComboBox->currentData().toString(); QString paymentDate = paymentDateEdit->date().toString("yyyy-MM-dd"); double amount = amountEdit->text().toDouble(); QString feeType = feeTypeEdit->text(); QString remark = remarkEdit->text(); // 准备SQL查询 QSqlQuery query; query.prepare("INSERT INTO financialRecords (student_id, payment_date, amount, payment_type, notes) " "VALUES (:student_id, :payment_date, :amount, :payment_type, :notes)"); query.bindValue(":student_id", studentId); // 绑定学生ID query.bindValue(":payment_date", paymentDate); query.bindValue(":amount", amount); query.bindValue(":payment_type", feeType); query.bindValue(":notes", remark); // 执行SQL查询 if (query.exec()) { qDebug() << "记录添加成功!"; loadFinancialRecords(); // 刷新表格 } else qDebug() << "添加记录失败:" << query.lastError().text(); } } void FinancialWidget::updatePieChart() { // 确保视图有效 if (!pieChartView) return; // 获取筛选条件 QString studentId = studentComboBox->currentData().toString(); QDate startDate = startDateEdit->date(); QDate endDate = endDateEdit->date(); // 安全查询 QString baseQuery = QString( "SELECT payment_type, SUM(amount) " "FROM financialRecords " "WHERE payment_date BETWEEN :startDate AND :endDate %1 " "GROUP BY payment_type") .arg(studentId != "-1" ? "AND student_id = :studentId" : ""); QSqlQuery query; query.prepare(baseQuery); query.bindValue(":startDate", startDate.toString("yyyy-MM-dd")); query.bindValue(":endDate", endDate.toString("yyyy-MM-dd")); if (studentId != "-1") query.bindValue(":studentId", studentId); if (!query.exec()) { qWarning() << "Financial chart query error:" << query.lastError(); return; } // 创建新图表对象 QChart* newChart = new QChart(); newChart->setTitle("支付类型分布"); // 创建饼图系列 QPieSeries* series = new QPieSeries(); series->setPieSize(0.75); bool hasData = false; double totalAmount = 0.0; // 处理查询结果 while (query.next()) { QString type = query.value(0).toString(); qreal value = query.value(1).toDouble(); if (value > 0) { hasData = true; totalAmount += value; // 创建带金额显示的扇区 QPieSlice* slice = series->append( QString("%1\n%2元").arg(type).arg(value), // 显示支付类型金额 value ); // 配置扇区标签 slice->setLabelVisible(true); slice->setLabelPosition(QPieSlice::LabelInsideTangential); slice->setLabelFont(QFont("Arial", 8, QFont::Bold)); slice->setLabelColor(Qt::white); slice->setLabel(QString("%1\n%2元\n%3%") .arg(type) .arg(value) .arg(QString::number(value/totalAmount*100, 'f', 1))); } } // 添加总金额标题 if (hasData) { newChart->setTitle(QString("支付类型分布 (总金额: %1元)").arg(totalAmount)); newChart->addSeries(series); } else { // 无数据时显示占位信息 newChart->setTitle("支付类型分布 (无数据)"); QPieSeries* emptySeries = new QPieSeries(); QPieSlice* slice = emptySeries->append("无数据", 1); slice->setLabelVisible(true); slice->setLabel("暂无支付记录"); newChart->addSeries(emptySeries); } // 配置图例 newChart->legend()->setVisible(true); newChart->legend()->setAlignment(Qt::AlignBottom); newChart->legend()->setBackgroundVisible(true); newChart->legend()->setBrush(QBrush(Qt::white)); newChart->legend()->setLabelColor(Qt::black); newChart->legend()->setContentsMargins(10, 10, 10, 10); // 配置动画效果 newChart->setAnimationOptions(QChart::AllAnimations); // 安全替换图表 QChart* oldChart = pieChartView->chart(); pieChartView->setChart(newChart); // 延迟删除旧图表 if (oldChart) oldChart->deleteLater(); } void FinancialWidget::updateChart() { // ================== 1. 获取并验证日期范围 ================== QDate startDate = startDateEdit->date(); QDate endDate = endDateEdit->date(); if (startDate > endDate) { std::swap(startDate, endDate); startDateEdit->setDate(startDate); endDateEdit->setDate(endDate); } // ================== 2. 构建安全SQL查询 ================== QString studentId = studentComboBox->currentData().toString(); // 如果 studentId 为 "-1"(不筛选特定学生),直接返回 /*if (studentId == "-1") { qDebug() << "未选择特定学生,跳过饼图更新"; return; }*/ QString queryStr = QString("SELECT DATE(payment_date) AS day, SUM(amount) AS total " "FROM financialRecords " "WHERE payment_date BETWEEN :startDate AND :endDate " "%1 GROUP BY day ORDER BY day" ).arg(studentId != "-1" ? "AND student_id = :studentId" : ""); QSqlQuery query; query.prepare(queryStr); query.bindValue(":startDate", startDate.toString("yyyy-MM-dd")); query.bindValue(":endDate", endDate.toString("yyyy-MM-dd")); if (studentId != "-1") query.bindValue(":studentId", studentId); if (!query.exec()) qCritical() << "[SQL错误]" << query.lastError().text(); // ================== 3. 处理查询数据 ================== QMap<QDate, qreal> dayData; qreal maxAmount = 0; while (query.next()) { QDate day = QDate::fromString(query.value(0).toString(), "yyyy-MM-dd"); if (!day.isValid()) continue; qreal amount = query.value(1).toDouble(); dayData[day] = amount; if (amount > maxAmount) maxAmount = amount; } // ================== 4. 创建图表系列 ================== QLineSeries* series = new QLineSeries(); series->setName("销售额"); QPen pen(Qt::blue); series->setPen(pen); QDate currentDate = startDate; while (currentDate <= endDate) { qreal value = dayData.value(currentDate, 0.0); series->append(currentDate.startOfDay().toMSecsSinceEpoch(), value); currentDate = currentDate.addDays(1); } // ================== 5. 配置坐标轴 ================== QChart* chart = new QChart(); chart->addSeries(series); QDateTimeAxis* axisX = new QDateTimeAxis(); axisX->setFormat("yyyy-MM-dd"); axisX->setTitleText("日期"); axisX->setRange(startDate.startOfDay(),endDate.startOfDay()); chart->addAxis(axisX, Qt::AlignBottom); series->attachAxis(axisX); QValueAxis* axisY = new QValueAxis(); axisY->setTitleText("金额 (元)"); axisY->setLabelFormat("%.0f"); chart->addAxis(axisY, Qt::AlignLeft); series->attachAxis(axisY); // ================== 6. 应用图表 ================== if (chartView->chart()) delete chartView->chart(); chartView->setChart(chart); chartView->setRenderHint(QPainter::Antialiasing); chart->legend()->setVisible(false); } void FinancialWidget::editRecord() { int currentRow = tableWidget->currentRow(); if (currentRow < 0) { QMessageBox::warning(this, "警告", "请选择要修改的记录!"); return; } // 获取当前行的数据 QString id = tableWidget->item(currentRow, 0)->text(); // ID 是字符串类型 QString studentName = tableWidget->item(currentRow, 1)->text(); // 学生名称 QString paymentDate = tableWidget->item(currentRow, 2)->text(); QString amount = tableWidget->item(currentRow, 3)->text(); QString feeType = tableWidget->item(currentRow, 4)->text(); QString remark = tableWidget->item(currentRow, 5)->text(); QDialog dialog(this); dialog.setWindowTitle("修改缴费记录"); QFormLayout form(&dialog); // 学生名称下拉菜单 QComboBox* studentNameComboBox = new QComboBox(&dialog); QSqlQuery query("SELECT id, name FROM studentInfo"); while (query.next()) { QString id = query.value(0).toString(); // id 是字符串类型 QString name = query.value(1).toString(); studentNameComboBox->addItem(name, QVariant(id)); } studentNameComboBox->setCurrentText(studentName); // 设置当前学生名称 QLineEdit* paymentDateEdit = new QLineEdit(paymentDate, &dialog); QLineEdit* amountEdit = new QLineEdit(amount, &dialog); QLineEdit* feeTypeEdit = new QLineEdit(feeType, &dialog); QLineEdit* remarkEdit = new QLineEdit(remark, &dialog); form.addRow("学生名称:", studentNameComboBox); form.addRow("缴费日期:", paymentDateEdit); form.addRow("金额:", amountEdit); form.addRow("支付类型:", feeTypeEdit); form.addRow("备注:", remarkEdit); QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, &dialog); buttonBox.button(QDialogButtonBox::Ok)->setText("确定"); buttonBox.button(QDialogButtonBox::Cancel)->setText("取消"); form.addRow(&buttonBox); QObject::connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept); QObject::connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject); if (dialog.exec() == QDialog::Accepted) { QString studentId = studentNameComboBox->currentData().toString(); // studentId 是字符串类型 QString paymentDate = paymentDateEdit->text(); double amount = amountEdit->text().toDouble(); QString feeType = feeTypeEdit->text(); QString remark = remarkEdit->text(); // 准备 SQL 查询 QSqlQuery query; query.prepare("UPDATE financialRecords SET student_id = :student_id, payment_date = :payment_date, " "amount = :amount, payment_type = :payment_type, notes = :notes WHERE id = :id"); query.bindValue(":student_id", studentId); // studentId 是字符串类型 query.bindValue(":payment_date", paymentDate); query.bindValue(":amount", amount); query.bindValue(":payment_type", feeType); query.bindValue(":notes", remark); query.bindValue(":id", id); // 执行 SQL 查询 if (query.exec()) { qDebug() << "记录修改成功!"; loadFinancialRecords(); // 刷新表格 } else qDebug() << "修改记录失败:" << query.lastError().text(); } } void FinancialWidget::deleteRecord() { int currentRow = tableWidget->currentRow(); if (currentRow < 0) { QMessageBox::warning(this, "警告", "请选择要删除的记录!"); return; } // 获取 ID 列的值 int id = tableWidget->item(currentRow, 0)->text().toInt(); // ID 列是第一列 // 确认删除操作 QMessageBox confirmBox(this); confirmBox.setWindowTitle("确认删除"); confirmBox.setText("确定要删除该记录吗?"); // 设置按钮为中文 QPushButton* yesButton = confirmBox.addButton("确定", QMessageBox::YesRole); QPushButton* noButton = confirmBox.addButton("取消", QMessageBox::NoRole); // 设置默认按钮 confirmBox.setDefaultButton(noButton); // 显示对话框并等待用户选择 confirmBox.exec(); if (confirmBox.clickedButton() == yesButton) { // 用户点击了“确定” QSqlQuery query; query.prepare("DELETE FROM financialRecords WHERE id = :id"); query.bindValue(":id", id); if (query.exec()) { qDebug() << "记录删除成功!"; loadFinancialRecords(); // 刷新表格 } else { QMessageBox::warning(this, "错误", "删除记录失败!"); } } } 这是修改后的financialwidget.cpp代码其中函数void FinancialWidget::updatePieChart()已经能够正常使用不用修改,可void FinancialWidget::updateChart()函数会导致进程崩溃请分析原因并修改
06-26
CREATE TABLE `dm1yj_kdyy_tj_weekly` ( `GzWeek` VARCHAR(10), -- 格式为 YYYY-ww,表示年-周 `WeekStartDate` DATE COMMENT '本周起始日期(周一)', `WeekEndDate` DATE COMMENT '本周结束日期(周日)', `WeekLabelWithDate` VARCHAR(50) COMMENT '带日期的周标签,如:本周(2025-07-28 - 2025-08-03)' `YjFlDm` char(2) DEFAULT NULL COMMENT '医技分类代码', `YjFl` varchar(30) DEFAULT NULL COMMENT '医技分类', `YjKs` varchar(30) DEFAULT NULL COMMENT '医技科室', `ExamType` varchar(50) DEFAULT NULL COMMENT '检查类型', `CheckFl` varchar(50) DEFAULT NULL COMMENT '检查类别', `Kd_Cnt` int DEFAULT NULL COMMENT '开单项目数', `Kd_Jf_Cnt` int DEFAULT NULL COMMENT '当天开单缴费项目数', `Yy_Dt_Cnt` int DEFAULT NULL COMMENT '预约当天检查项目数', `Yy_Gt_Cnt` int DEFAULT NULL COMMENT '预约隔天检查项目数', `Yy_Cnt1` int DEFAULT NULL COMMENT '预约当天17点之前项目数', `Yy_Cnt2` int DEFAULT NULL COMMENT '预约当天17点之后项目数', `Yy_Cnt3` int DEFAULT NULL COMMENT '主动超长预约项目数', `Yy_Cnt4` int DEFAULT NULL COMMENT '被动超长预约项目数', `ZdYy_Xm_Cnt` int DEFAULT NULL COMMENT '主动预约项目数', `Kd_Wc_Cnt` int DEFAULT NULL COMMENT '当天开单且检查完成项目数', `Kd_Wc_Cnt1` int DEFAULT NULL COMMENT '当天开单且检查完成项目数(17点之前)', `Time1_Wc_Rate` decimal(20,2) DEFAULT NULL COMMENT '1小时完成率', `Time2_Wc_Rate` decimal(20,2) DEFAULT NULL COMMENT '2小时完成率', `Time3_Wc_Rate` decimal(20,2) DEFAULT NULL COMMENT '11点之前出报告率', `Time4_Wc_Rate` decimal(20,2) DEFAULT NULL COMMENT '16点之前出报告率', `Time5_Wc_Rate` decimal(20,2) DEFAULT NULL COMMENT '当天完成率(17点之前)', `Time6_Wc_Rate` decimal(20,2) DEFAULT NULL COMMENT '第二天完成率(17点之前)', `Dj_Wjc_Cnt` int DEFAULT NULL COMMENT '已登记未检查项目数', `Jc_Wbg_Cnt` int DEFAULT NULL COMMENT '检查中项目数', `Yy_Wc_Cnt` int DEFAULT NULL COMMENT '预约时间段检查完成项目数', `Yy_Wc_Rate` decimal(20,4) DEFAULT NULL COMMENT '预约时间段检查完成率', `OpenSl_Cnt` int DEFAULT NULL COMMENT '开放位置数', `KcSl_Cnt` int DEFAULT NULL COMMENT '当周剩余位置数', `KcSl2_Cnt` int DEFAULT NULL COMMENT '第2周剩余位置数', `Time1_Wc_Num` int DEFAULT NULL COMMENT '1小时完成率分子', `Time2_Wc_Num` int DEFAULT NULL COMMENT '2小时完成率分子', `Time3_Wc_Num` int DEFAULT NULL COMMENT '11点前出报告率分子', `Time4_Wc_Num` int DEFAULT NULL COMMENT '16点前出报告率分子', `Time5_Wc_Num` int DEFAULT NULL COMMENT '当天完成率分子', `Time6_Wc_Num` int DEFAULT NULL COMMENT '非当天完成率分子', `Time_Wc_Den` int DEFAULT NULL COMMENT '完成率分母', `Yy_Wc_Num` int DEFAULT NULL COMMENT '预约时间段检查完成率分子', `Yy_Wc_Den` int DEFAULT NULL COMMENT '预约时间段检查完成率分母', ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='检查开单预约指标周统计'; You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`YjFlDm` char(2) DEFAULT NULL COMMENT '医技分类代码', `YjFl` varchar(30' at line 6 > 时间: 0.003s
最新发布
07-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值