西藏巴青项目

biz_livestock_ownership_household.sql 1.8KB

1234567891011121314151617181920212223242526272829
  1. -- 有无畜户数据填报(物理删除,无 del_flag;村 × 年月唯一)
  2. DROP TABLE IF EXISTS `biz_livestock_ownership_household`;
  3. CREATE TABLE `biz_livestock_ownership_household` (
  4. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  5. `stat_year` int(11) NOT NULL COMMENT '所属年份',
  6. `stat_month` int(11) NOT NULL COMMENT '所属月份(1-12)',
  7. `town_dept_id` bigint(20) NOT NULL COMMENT '所属乡镇dept_id',
  8. `town_name` varchar(64) NOT NULL COMMENT '乡镇名称',
  9. `village_dept_id` bigint(20) NOT NULL COMMENT '所属村dept_id',
  10. `village_name` varchar(128) NOT NULL COMMENT '所属村名称',
  11. `with_livestock_household_count` int(11) DEFAULT NULL COMMENT '有畜户户数',
  12. `with_livestock_population_count` int(11) DEFAULT NULL COMMENT '有畜户人数',
  13. `with_livestock_labor_count` int(11) DEFAULT NULL COMMENT '有畜户劳动力',
  14. `with_livestock_animal_count` int(11) DEFAULT NULL COMMENT '有畜户牲畜数',
  15. `without_livestock_household_count` int(11) DEFAULT NULL COMMENT '无畜户户数',
  16. `without_livestock_population_count` int(11) DEFAULT NULL COMMENT '无畜户人数',
  17. `without_livestock_labor_count` int(11) DEFAULT NULL COMMENT '无畜户劳动力',
  18. `create_by` varchar(64) DEFAULT '' COMMENT '创建者',
  19. `create_time` datetime DEFAULT NULL COMMENT '创建时间',
  20. `update_by` varchar(64) DEFAULT '' COMMENT '更新者',
  21. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  22. `remark` varchar(500) DEFAULT NULL COMMENT '备注',
  23. PRIMARY KEY (`id`),
  24. UNIQUE KEY `uk_year_month_village` (`stat_year`, `stat_month`, `village_dept_id`),
  25. KEY `idx_stat_year_month` (`stat_year`, `stat_month`),
  26. KEY `idx_town_dept_id` (`town_dept_id`),
  27. KEY `idx_village_dept_id` (`village_dept_id`)
  28. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='有无畜户数据填报';