-- 有无畜户数据填报(物理删除,无 del_flag;村 × 年月唯一) DROP TABLE IF EXISTS `biz_livestock_ownership_household`; CREATE TABLE `biz_livestock_ownership_household` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `stat_year` int(11) NOT NULL COMMENT '所属年份', `stat_month` int(11) NOT NULL COMMENT '所属月份(1-12)', `town_dept_id` bigint(20) NOT NULL COMMENT '所属乡镇dept_id', `town_name` varchar(64) NOT NULL COMMENT '乡镇名称', `village_dept_id` bigint(20) NOT NULL COMMENT '所属村dept_id', `village_name` varchar(128) NOT NULL COMMENT '所属村名称', `with_livestock_household_count` int(11) DEFAULT NULL COMMENT '有畜户户数', `with_livestock_population_count` int(11) DEFAULT NULL COMMENT '有畜户人数', `with_livestock_labor_count` int(11) DEFAULT NULL COMMENT '有畜户劳动力', `with_livestock_animal_count` int(11) DEFAULT NULL COMMENT '有畜户牲畜数', `without_livestock_household_count` int(11) DEFAULT NULL COMMENT '无畜户户数', `without_livestock_population_count` int(11) DEFAULT NULL COMMENT '无畜户人数', `without_livestock_labor_count` int(11) DEFAULT NULL COMMENT '无畜户劳动力', `create_by` varchar(64) DEFAULT '' COMMENT '创建者', `create_time` datetime DEFAULT NULL COMMENT '创建时间', `update_by` varchar(64) DEFAULT '' COMMENT '更新者', `update_time` datetime DEFAULT NULL COMMENT '更新时间', `remark` varchar(500) DEFAULT NULL COMMENT '备注', PRIMARY KEY (`id`), UNIQUE KEY `uk_year_month_village` (`stat_year`, `stat_month`, `village_dept_id`), KEY `idx_stat_year_month` (`stat_year`, `stat_month`), KEY `idx_town_dept_id` (`town_dept_id`), KEY `idx_village_dept_id` (`village_dept_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='有无畜户数据填报';