CREATE TABLE IF NOT EXISTS `org_enterprise` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`enterprise_id` char(36) DEFAULT NULL COMMENT '主键',
`enterprise_name` varchar(255) DEFAULT NULL COMMENT '名称',
`enterprise_type_id` char(36) DEFAULT NULL COMMENT '类型ID',
`enterprise_type_name` varchar(255) DEFAULT NULL COMMENT '类型名称',
`enterprise_address` varchar(255) DEFAULT NULL COMMENT '地址',
`enterprise_tel` varchar(255) DEFAULT NULL COMMENT '联系方式',
`business_reg_no` varchar(255) DEFAULT NULL COMMENT '组织机构代码',
`business_license` varchar(255) DEFAULT NULL COMMENT '营业执照',
`business_license_start_date` varchar(10) DEFAULT NULL COMMENT '营业执照开始时间',
`business_license_end_date` varchar(10) DEFAULT NULL COMMENT '营业执照结束时间',
`total_person` int(11) DEFAULT NULL COMMENT '员工数',
`legal_person_id_card_code` char(36) DEFAULT NULL COMMENT '法人证件代码',
`legal_person_id_card_code_name` varchar(255) DEFAULT NULL COMMENT '法人证件代码名称',
`legal_person_id_card` varchar(255) DEFAULT NULL COMMENT '法人证件号码',
`legal_person_name` varchar(255) DEFAULT NULL COMMENT '法人姓名',
`legal_person_phone` varchar(255) DEFAULT NULL COMMENT '法人联系方式',
`legal_person_id_card_front` varchar(255) DEFAULT NULL COMMENT '法人证件正面',
`legal_person_id_card_back` varchar(255) DEFAULT NULL COMMENT '法人证件背面',
`security_person_name` varchar(255) DEFAULT NULL COMMENT '治保负责人姓名',
`security_person_phone` varchar(255) DEFAULT NULL COMMENT '治保负责人联系方式',
`master_name` varchar(255) DEFAULT NULL COMMENT '负责人姓名',
`master_phone` varchar(255) DEFAULT NULL COMMENT '负责人联系方式',
`master_id_card` varchar(255) DEFAULT NULL COMMENT '负责人身份证号码',
`master_id_card_front` varchar(255) DEFAULT NULL COMMENT '负责人身份证正面',
`master_id_card_back` varchar(255) DEFAULT NULL COMMENT '负责人身份证背面',
`is_danger` int(1) DEFAULT '0' COMMENT '是否危化企业',
`hidden_danger_type_id` char(36) DEFAULT NULL COMMENT '安全隐患类型ID',
`hidden_danger_type_name` varchar(255) DEFAULT NULL COMMENT '安全隐患类型名称',
`degree_of_concern_id` char(36) DEFAULT NULL COMMENT '关注度ID',
`degree_of_concern_name` varchar(255) DEFAULT NULL COMMENT '关注度名称',
`can_establish_party_org` int(1) DEFAULT '0' COMMENT '是否具备建立中共党组织条件',
`has_party_org` int(1) DEFAULT '0' COMMENT '是否有党组织',
`party_org_total_person` int(11) DEFAULT NULL COMMENT '中共党员数量',
`has_labour_union` int(1) DEFAULT '0' COMMENT '是否有工会',
`labour_union_total_person` int(11) DEFAULT NULL COMMENT '工会会员数量',
`has_communist_youth_league` int(1) DEFAULT '0' COMMENT '是否有共青团',
`communist_youth_league_total_person` int(11) DEFAULT NULL COMMENT '共青团团员数量',
`has_women_federation` int(1) DEFAULT '0' COMMENT '是否有妇联',
`women_total_person` int(11) DEFAULT NULL COMMENT '妇女数量',
`enterprise_lng` varchar(255) DEFAULT NULL COMMENT '企业经度',
`enterprise_lat` varchar(255) DEFAULT NULL COMMENT '企业纬度',
`area_code` varchar(255) DEFAULT NULL COMMENT '地区编码',
`area_name` varchar(255) DEFAULT NULL COMMENT '地区名称',
`grid_code` varchar(255) DEFAULT NULL COMMENT '网格编码',
`grid_name` varchar(255) DEFAULT NULL COMMENT '网格名称',
`is_log_off` int(1) DEFAULT '0' COMMENT '是否注销',
`remarks` varchar(255) DEFAULT NULL COMMENT '备注',
`facade_photos` varchar(255) DEFAULT NULL COMMENT '门面照片',
`workplace_photos` varchar(255) DEFAULT NULL COMMENT '工作场所照片',
`gmt_create` datetime DEFAULT NULL COMMENT '创建时间',
`creator` char(36) DEFAULT NULL COMMENT '创建人',
`gmt_modified` datetime DEFAULT NULL COMMENT '修改时间',
`modifier` char(36) DEFAULT NULL COMMENT '修改人',
`is_delete` int(1) DEFAULT '0' COMMENT '是否删除',
PRIMARY KEY (`id`),
UNIQUE KEY `enterprise_id` (`enterprise_id`),
UNIQUE KEY `business_reg_no` (`business_reg_no`),
KEY `area_code` (`area_code`),
KEY `grid_code` (`grid_code`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='非公有制经济组织';
INSERT INTO org_enterprise(
enterprise_id,
enterprise_name,
enterprise_type_id,
enterprise_type_name,
enterprise_address,
enterprise_tel,
business_reg_no,
business_license,
business_license_start_date,
business_license_end_date,
total_person,
legal_person_id_card_code,
legal_person_id_card_code_name,
legal_person_id_card,
legal_person_name,
legal_person_phone,
legal_person_id_card_front,
legal_person_id_card_back,
security_person_name,
security_person_phone,
master_name,
master_phone,
master_id_card,
master_id_card_front,
master_id_card_back,
is_danger,
hidden_danger_type_id,
hidden_danger_type_name,
degree_of_concern_id,
degree_of_concern_name,
can_establish_party_org,
has_party_org,
party_org_total_person,
has_labour_union,
labour_union_total_person,
has_communist_youth_league,
communist_youth_league_total_person,
has_women_federation,
women_total_person,
enterprise_lng,
enterprise_lat,
area_code,
area_name,
grid_code,
grid_name,
is_log_off,
remarks,
facade_photos,
workplace_photos,
gmt_create,
creator,
gmt_modified,
modifier,
is_delete
) VALUES(
#{enterpriseId},
#{enterpriseName},
#{enterpriseTypeId},
#{enterpriseTypeName},
#{enterpriseAddress},
#{enterpriseTel},
#{businessRegNo},
#{businessLicense},
#{businessLicenseStartDate},
#{businessLicenseEndDate},
#{totalPerson},
#{legalPersonIdCardCode},
#{legalPersonIdCardCodeName},
#{legalPersonIdCard},
#{legalPersonName},
#{legalPersonPhone},
#{legalPersonIdCardFront},
#{legalPersonIdCardBack},
#{securityPersonName},
#{securityPersonPhone},
#{masterName},
#{masterPhone},
#{masterIdCard},
#{masterIdCardFront},
#{masterIdCardBack},
#{isDanger},
#{hiddenDangerTypeId},
#{hiddenDangerTypeName},
#{degreeOfConcernId},
#{degreeOfConcernName},
#{canEstablishPartyOrg},
#{hasPartyOrg},
#{partyOrgTotalPerson},
#{hasLabourUnion},
#{labourUnionTotalPerson},
#{hasCommunistYouthLeague},
#{communistYouthLeagueTotalPerson},
#{hasWomenFederation},
#{womenTotalPerson},
#{enterpriseLng},
#{enterpriseLat},
#{areaCode},
#{areaName},
#{gridCode},
#{gridName},
#{isLogOff},
#{remarks},
#{facadePhotos},
#{workplacePhotos},
#{gmtCreate},
#{creator},
#{gmtModified},
#{modifier},
#{isDelete}
)
UPDATE
org_enterprise
SET
gmt_modified = #{gmtModified},
modifier = #{modifier},
is_delete = 1
WHERE
enterprise_id IN
#{enterpriseIds[${index}]}
DELETE FROM
org_enterprise
WHERE
enterprise_id IN
#{enterpriseIds[${index}]}
UPDATE
org_enterprise
SET
enterprise_name = #{enterpriseName},
enterprise_type_id = #{enterpriseTypeId},
enterprise_type_name = #{enterpriseTypeName},
enterprise_address = #{enterpriseAddress},
enterprise_tel = #{enterpriseTel},
business_reg_no = #{businessRegNo},
business_license = #{businessLicense},
business_license_start_date = #{businessLicenseStartDate},
business_license_end_date = #{businessLicenseEndDate},
total_person = #{totalPerson},
legal_person_id_card_code = #{legalPersonIdCardCode},
legal_person_id_card_code_name = #{legalPersonIdCardCodeName},
legal_person_id_card = #{legalPersonIdCard},
legal_person_name = #{legalPersonName},
legal_person_phone = #{legalPersonPhone},
legal_person_id_card_front = #{legalPersonIdCardFront},
legal_person_id_card_back = #{legalPersonIdCardBack},
security_person_name = #{securityPersonName},
security_person_phone = #{securityPersonPhone},
master_name = #{masterName},
master_phone = #{masterPhone},
master_id_card = #{masterIdCard},
master_id_card_front = #{masterIdCardFront},
master_id_card_back = #{masterIdCardBack},
is_danger = #{isDanger},
hidden_danger_type_id = #{hiddenDangerTypeId},
hidden_danger_type_name = #{hiddenDangerTypeName},
degree_of_concern_id = #{degreeOfConcernId},
degree_of_concern_name = #{degreeOfConcernName},
can_establish_party_org = #{canEstablishPartyOrg},
has_party_org = #{hasPartyOrg},
party_org_total_person = #{partyOrgTotalPerson},
has_labour_union = #{hasLabourUnion},
labour_union_total_person = #{labourUnionTotalPerson},
has_communist_youth_league = #{hasCommunistYouthLeague},
communist_youth_league_total_person = #{communistYouthLeagueTotalPerson},
has_women_federation = #{hasWomenFederation},
women_total_person = #{womenTotalPerson},
enterprise_lng = #{enterpriseLng},
enterprise_lat = #{enterpriseLat},
area_code = #{areaCode},
area_name = #{areaName},
grid_code = #{gridCode},
grid_name = #{gridName},
is_log_off = #{isLogOff},
remarks = #{remarks},
facade_photos = #{facadePhotos},
workplace_photos = #{workplacePhotos},
gmt_modified = #{gmtModified},
modifier = #{modifier}
WHERE
enterprise_id = #{enterpriseId}