feat: Add Outdoor Fair Attendee and Device management

- Implemented Outdoor Fair Attendee and Device entities, including their respective controllers, services, and mappers.
- Added statistics endpoint for Outdoor Fair data, allowing aggregation by day, week, month, or year.
- Introduced SQL scripts for creating tables and mock data for attendees and devices.
- Created a write-capable script for executing DML/DDL statements against the SHZ HighGo database.
- Enhanced the existing query capabilities to support both read and write operations.
This commit is contained in:
2026-06-26 11:26:04 +08:00
parent 7ca2d878cc
commit 0ccfb6e6dc
15 changed files with 884 additions and 5 deletions

View File

@@ -0,0 +1,42 @@
-- 户外招聘会签到人员表
-- 依赖shz.cms_outdoor_fairfair_id 外键逻辑关联,不建物理外键)
CREATE SEQUENCE IF NOT EXISTS shz.cms_outdoor_fair_attendee_id_seq
START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
CREATE TABLE IF NOT EXISTS shz.cms_outdoor_fair_attendee (
id BIGINT NOT NULL DEFAULT nextval('shz.cms_outdoor_fair_attendee_id_seq'::regclass) PRIMARY KEY,
fair_id BIGINT NOT NULL,
name VARCHAR(64) NOT NULL,
phone VARCHAR(20),
address VARCHAR(255),
check_in_time TIMESTAMP,
create_by VARCHAR(64),
create_time TIMESTAMP,
update_by VARCHAR(64),
update_time TIMESTAMP,
remark VARCHAR(500),
del_flag CHAR(1) DEFAULT '0'
);
CREATE INDEX IF NOT EXISTS idx_cms_outdoor_fair_attendee_fair
ON shz.cms_outdoor_fair_attendee (fair_id);
COMMENT ON TABLE shz.cms_outdoor_fair_attendee IS '户外招聘会签到人员表';
COMMENT ON COLUMN shz.cms_outdoor_fair_attendee.id IS '主键';
COMMENT ON COLUMN shz.cms_outdoor_fair_attendee.fair_id IS '招聘会ID';
COMMENT ON COLUMN shz.cms_outdoor_fair_attendee.name IS '人员姓名';
COMMENT ON COLUMN shz.cms_outdoor_fair_attendee.phone IS '手机号';
COMMENT ON COLUMN shz.cms_outdoor_fair_attendee.address IS '住址';
COMMENT ON COLUMN shz.cms_outdoor_fair_attendee.check_in_time IS '签到时间';
COMMENT ON COLUMN shz.cms_outdoor_fair_attendee.del_flag IS '删除标志0存在 2删除';
-- mock 5 条签到人员数据,归属 id=8 的招聘会
INSERT INTO shz.cms_outdoor_fair_attendee
(fair_id, name, phone, address, check_in_time, create_by, create_time, del_flag)
VALUES
(8, '张伟', '13800000001', '石河子市东城街道北一路上段', '2026-06-25 09:05:00', 'admin', now(), '0'),
(8, '李娜', '13900000002', '石河子市新城街道西一路社区', '2026-06-25 09:12:00', 'admin', now(), '0'),
(8, '王强', '13700000003', '石河子市红山街道三小区', '2026-06-25 09:20:00', 'admin', now(), '0'),
(8, '陈静', '13600000004', '石河子市向阳街道一社区', '2026-06-25 09:31:00', 'admin', now(), '0'),
(8, '刘洋', '13500000005', '石河子市老街街道五小区', '2026-06-25 09:45:00', 'admin', now(), '0');

View File

@@ -0,0 +1,42 @@
-- 户外招聘会设备码表
-- 依赖shz.cms_outdoor_fairfair_id 外键逻辑关联,不建物理外键)
CREATE SEQUENCE IF NOT EXISTS shz.cms_outdoor_fair_device_id_seq
START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
CREATE TABLE IF NOT EXISTS shz.cms_outdoor_fair_device (
id BIGINT NOT NULL DEFAULT nextval('shz.cms_outdoor_fair_device_id_seq'::regclass) PRIMARY KEY,
fair_id BIGINT NOT NULL,
device_code VARCHAR(64) NOT NULL,
company_id BIGINT,
company_name VARCHAR(255),
bind_time TIMESTAMP,
create_by VARCHAR(64),
create_time TIMESTAMP,
update_by VARCHAR(64),
update_time TIMESTAMP,
remark VARCHAR(500),
del_flag CHAR(1) DEFAULT '0'
);
CREATE INDEX IF NOT EXISTS idx_cms_outdoor_fair_device_fair
ON shz.cms_outdoor_fair_device (fair_id);
COMMENT ON TABLE shz.cms_outdoor_fair_device IS '户外招聘会设备码表';
COMMENT ON COLUMN shz.cms_outdoor_fair_device.id IS '主键';
COMMENT ON COLUMN shz.cms_outdoor_fair_device.fair_id IS '招聘会ID';
COMMENT ON COLUMN shz.cms_outdoor_fair_device.device_code IS '设备码UUID';
COMMENT ON COLUMN shz.cms_outdoor_fair_device.company_id IS '绑定的参会企业ID';
COMMENT ON COLUMN shz.cms_outdoor_fair_device.company_name IS '绑定的参会企业名称';
COMMENT ON COLUMN shz.cms_outdoor_fair_device.bind_time IS '绑定时间';
COMMENT ON COLUMN shz.cms_outdoor_fair_device.del_flag IS '删除标志0存在 2删除';
-- mock 数据:为 id=8 的招聘会生成 5 个设备码,其中 2 个绑定参会企业
INSERT INTO shz.cms_outdoor_fair_device
(fair_id, device_code, company_id, company_name, bind_time, create_by, create_time, del_flag)
VALUES
(8, 'a1b2c3d4e5f6471a9b8c1d2e3f4a5b6c', null, null, null, 'admin', now(), '0'),
(8, 'b2c3d4e5f6a7482bac9d0e1f2a3b4c5d', null, null, null, 'admin', now(), '0'),
(8, 'c3d4e5f6a7b8493cbd0e1f2a3b4c5d6e', 101, '示例科技有限公司', '2026-06-25 10:00:00', 'admin', now(), '0'),
(8, 'd4e5f6a7b8c9404dce1f2a3b4c5d6e7f', 102, '示范商贸有限公司', '2026-06-25 10:05:00', 'admin', now(), '0'),
(8, 'e5f6a7b8c9d0415edf2a3b4c5d6e7f8a', null, null, null, 'admin', now(), '0');