wlcb-smart-city-usercenter/src/main/resources/mybatis/mapper/enterprise/enterprise-mapper.xml

993 lines
42 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.com.tenlion.usercenter.dao.enterprise.IEnterpriseDao">
<resultMap id="enterpriseDTO" type="cn.com.tenlion.usercenter.pojo.dtos.enterprise.EnterpriseDTO">
<result column="enterprise_id" property="enterpriseId"/>
<result column="enterprise_name" property="enterpriseName"/>
<result column="enterprise_type_id" property="enterpriseTypeId"/>
<result column="enterprise_type_name" property="enterpriseTypeName"/>
<result column="enterprise_address" property="enterpriseAddress"/>
<result column="enterprise_tel" property="enterpriseTel"/>
<result column="business_reg_no" property="businessRegNo"/>
<result column="business_license" property="businessLicense"/>
<result column="business_license_start_date" property="businessLicenseStartDate"/>
<result column="business_license_end_date" property="businessLicenseEndDate"/>
<result column="total_person" property="totalPerson"/>
<result column="legal_person_id_card_code" property="legalPersonIdCardCode"/>
<result column="legal_person_id_card_code_name" property="legalPersonIdCardCodeName"/>
<result column="legal_person_id_card" property="legalPersonIdCard"/>
<result column="legal_person_name" property="legalPersonName"/>
<result column="legal_person_phone" property="legalPersonPhone"/>
<result column="legal_person_id_card_front" property="legalPersonIdCardFront"/>
<result column="legal_person_id_card_back" property="legalPersonIdCardBack"/>
<result column="security_person_name" property="securityPersonName"/>
<result column="security_person_phone" property="securityPersonPhone"/>
<result column="master_name" property="masterName"/>
<result column="master_phone" property="masterPhone"/>
<result column="master_id_card" property="masterIdCard"/>
<result column="master_id_card_front" property="masterIdCardFront"/>
<result column="master_id_card_back" property="masterIdCardBack"/>
<result column="is_danger" property="isDanger"/>
<result column="hidden_danger_type_id" property="hiddenDangerTypeId"/>
<result column="hidden_danger_type_name" property="hiddenDangerTypeName"/>
<result column="degree_of_concern_id" property="degreeOfConcernId"/>
<result column="degree_of_concern_name" property="degreeOfConcernName"/>
<result column="can_establish_party_org" property="canEstablishPartyOrg"/>
<result column="has_party_org" property="hasPartyOrg"/>
<result column="party_org_total_person" property="partyOrgTotalPerson"/>
<result column="has_labour_union" property="hasLabourUnion"/>
<result column="labour_union_total_person" property="labourUnionTotalPerson"/>
<result column="has_communist_youth_league" property="hasCommunistYouthLeague"/>
<result column="communist_youth_league_total_person" property="communistYouthLeagueTotalPerson"/>
<result column="has_women_federation" property="hasWomenFederation"/>
<result column="women_total_person" property="womenTotalPerson"/>
<result column="enterprise_lng" property="enterpriseLng"/>
<result column="enterprise_lat" property="enterpriseLat"/>
<result column="area_code" property="areaCode"/>
<result column="area_name" property="areaName"/>
<result column="grid_code" property="gridCode"/>
<result column="grid_name" property="gridName"/>
<result column="is_log_off" property="isLogOff"/>
<result column="remarks" property="remarks"/>
<result column="facade_photos" property="facadePhotos"/>
<result column="workplace_photos" property="workplacePhotos"/>
<result column="gmt_create" property="gmtCreate"/>
</resultMap>
<resultMap id="enterpriseBO" type="cn.com.tenlion.usercenter.pojo.bos.enterprise.EnterpriseBO">
<result column="enterprise_id" property="enterpriseId"/>
<result column="enterprise_name" property="enterpriseName"/>
<result column="enterprise_type_id" property="enterpriseTypeId"/>
<result column="enterprise_type_name" property="enterpriseTypeName"/>
<result column="enterprise_address" property="enterpriseAddress"/>
<result column="enterprise_tel" property="enterpriseTel"/>
<result column="business_reg_no" property="businessRegNo"/>
<result column="business_license" property="businessLicense"/>
<result column="business_license_start_date" property="businessLicenseStartDate"/>
<result column="business_license_end_date" property="businessLicenseEndDate"/>
<result column="total_person" property="totalPerson"/>
<result column="legal_person_id_card_code" property="legalPersonIdCardCode"/>
<result column="legal_person_id_card_code_name" property="legalPersonIdCardCodeName"/>
<result column="legal_person_id_card" property="legalPersonIdCard"/>
<result column="legal_person_name" property="legalPersonName"/>
<result column="legal_person_phone" property="legalPersonPhone"/>
<result column="legal_person_id_card_front" property="legalPersonIdCardFront"/>
<result column="legal_person_id_card_back" property="legalPersonIdCardBack"/>
<result column="security_person_name" property="securityPersonName"/>
<result column="security_person_phone" property="securityPersonPhone"/>
<result column="master_name" property="masterName"/>
<result column="master_phone" property="masterPhone"/>
<result column="master_id_card" property="masterIdCard"/>
<result column="master_id_card_front" property="masterIdCardFront"/>
<result column="master_id_card_back" property="masterIdCardBack"/>
<result column="is_danger" property="isDanger"/>
<result column="hidden_danger_type_id" property="hiddenDangerTypeId"/>
<result column="hidden_danger_type_name" property="hiddenDangerTypeName"/>
<result column="degree_of_concern_id" property="degreeOfConcernId"/>
<result column="degree_of_concern_name" property="degreeOfConcernName"/>
<result column="can_establish_party_org" property="canEstablishPartyOrg"/>
<result column="has_party_org" property="hasPartyOrg"/>
<result column="party_org_total_person" property="partyOrgTotalPerson"/>
<result column="has_labour_union" property="hasLabourUnion"/>
<result column="labour_union_total_person" property="labourUnionTotalPerson"/>
<result column="has_communist_youth_league" property="hasCommunistYouthLeague"/>
<result column="communist_youth_league_total_person" property="communistYouthLeagueTotalPerson"/>
<result column="has_women_federation" property="hasWomenFederation"/>
<result column="women_total_person" property="womenTotalPerson"/>
<result column="enterprise_lng" property="enterpriseLng"/>
<result column="enterprise_lat" property="enterpriseLat"/>
<result column="area_code" property="areaCode"/>
<result column="area_name" property="areaName"/>
<result column="grid_code" property="gridCode"/>
<result column="grid_name" property="gridName"/>
<result column="is_log_off" property="isLogOff"/>
<result column="remarks" property="remarks"/>
<result column="facade_photos" property="facadePhotos"/>
<result column="workplace_photos" property="workplacePhotos"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="modifier" property="modifier"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<resultMap id="enterprisePO" type="cn.com.tenlion.usercenter.pojo.pos.enterprise.EnterprisePO">
<result column="enterprise_id" property="enterpriseId"/>
<result column="enterprise_name" property="enterpriseName"/>
<result column="enterprise_type_id" property="enterpriseTypeId"/>
<result column="enterprise_type_name" property="enterpriseTypeName"/>
<result column="enterprise_address" property="enterpriseAddress"/>
<result column="enterprise_tel" property="enterpriseTel"/>
<result column="business_reg_no" property="businessRegNo"/>
<result column="business_license" property="businessLicense"/>
<result column="business_license_start_date" property="businessLicenseStartDate"/>
<result column="business_license_end_date" property="businessLicenseEndDate"/>
<result column="total_person" property="totalPerson"/>
<result column="legal_person_id_card_code" property="legalPersonIdCardCode"/>
<result column="legal_person_id_card_code_name" property="legalPersonIdCardCodeName"/>
<result column="legal_person_id_card" property="legalPersonIdCard"/>
<result column="legal_person_name" property="legalPersonName"/>
<result column="legal_person_phone" property="legalPersonPhone"/>
<result column="legal_person_id_card_front" property="legalPersonIdCardFront"/>
<result column="legal_person_id_card_back" property="legalPersonIdCardBack"/>
<result column="security_person_name" property="securityPersonName"/>
<result column="security_person_phone" property="securityPersonPhone"/>
<result column="master_name" property="masterName"/>
<result column="master_phone" property="masterPhone"/>
<result column="master_id_card" property="masterIdCard"/>
<result column="master_id_card_front" property="masterIdCardFront"/>
<result column="master_id_card_back" property="masterIdCardBack"/>
<result column="is_danger" property="isDanger"/>
<result column="hidden_danger_type_id" property="hiddenDangerTypeId"/>
<result column="hidden_danger_type_name" property="hiddenDangerTypeName"/>
<result column="degree_of_concern_id" property="degreeOfConcernId"/>
<result column="degree_of_concern_name" property="degreeOfConcernName"/>
<result column="can_establish_party_org" property="canEstablishPartyOrg"/>
<result column="has_party_org" property="hasPartyOrg"/>
<result column="party_org_total_person" property="partyOrgTotalPerson"/>
<result column="has_labour_union" property="hasLabourUnion"/>
<result column="labour_union_total_person" property="labourUnionTotalPerson"/>
<result column="has_communist_youth_league" property="hasCommunistYouthLeague"/>
<result column="communist_youth_league_total_person" property="communistYouthLeagueTotalPerson"/>
<result column="has_women_federation" property="hasWomenFederation"/>
<result column="women_total_person" property="womenTotalPerson"/>
<result column="enterprise_lng" property="enterpriseLng"/>
<result column="enterprise_lat" property="enterpriseLat"/>
<result column="area_code" property="areaCode"/>
<result column="area_name" property="areaName"/>
<result column="grid_code" property="gridCode"/>
<result column="grid_name" property="gridName"/>
<result column="is_log_off" property="isLogOff"/>
<result column="remarks" property="remarks"/>
<result column="facade_photos" property="facadePhotos"/>
<result column="workplace_photos" property="workplacePhotos"/>
<result column="gmt_create" property="gmtCreate"/>
<result column="creator" property="creator"/>
<result column="gmt_modified" property="gmtModified"/>
<result column="modifier" property="modifier"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<!-- 建表 -->
<update id="createTable">
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='非公有制经济组织';
</update>
<!-- 新增非公有制经济组织 -->
<insert id="save" parameterType="map">
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}
)
</insert>
<!-- 删除非公有制经济组织 -->
<update id="remove" parameterType="map">
UPDATE
org_enterprise
SET
gmt_modified = #{gmtModified},
modifier = #{modifier},
is_delete = 1
WHERE
enterprise_id IN
<foreach collection="enterpriseIds" index="index" open="(" separator="," close=")">
#{enterpriseIds[${index}]}
</foreach>
</update>
<!-- 删除非公有制经济组织(物理) -->
<update id="delete" parameterType="map">
DELETE FROM
org_enterprise
WHERE
enterprise_id IN
<foreach collection="enterpriseIds" index="index" open="(" separator="," close=")">
#{enterpriseIds[${index}]}
</foreach>
</update>
<!-- 修改非公有制经济组织 -->
<update id="update" parameterType="map">
UPDATE
org_enterprise
SET
<if test="enterpriseName != null and enterpriseName != ''">
enterprise_name = #{enterpriseName},
</if>
<if test="enterpriseTypeId != null and enterpriseTypeId != ''">
enterprise_type_id = #{enterpriseTypeId},
</if>
<if test="enterpriseTypeName != null">
enterprise_type_name = #{enterpriseTypeName},
</if>
<if test="enterpriseAddress != null">
enterprise_address = #{enterpriseAddress},
</if>
<if test="enterpriseTel != null">
enterprise_tel = #{enterpriseTel},
</if>
<if test="businessRegNo != null">
business_reg_no = #{businessRegNo},
</if>
<if test="businessLicense != null">
business_license = #{businessLicense},
</if>
<if test="businessLicenseStartDate != null">
business_license_start_date = #{businessLicenseStartDate},
</if>
<if test="businessLicenseEndDate != null">
business_license_end_date = #{businessLicenseEndDate},
</if>
<if test="totalPerson != null">
total_person = #{totalPerson},
</if>
<if test="legalPersonIdCardCode != null">
legal_person_id_card_code = #{legalPersonIdCardCode},
</if>
<if test="legalPersonIdCardCodeName != null">
legal_person_id_card_code_name = #{legalPersonIdCardCodeName},
</if>
<if test="legalPersonIdCard != null">
legal_person_id_card = #{legalPersonIdCard},
</if>
<if test="legalPersonName != null">
legal_person_name = #{legalPersonName},
</if>
<if test="legalPersonPhone != null">
legal_person_phone = #{legalPersonPhone},
</if>
<if test="legalPersonIdCardFront != null">
legal_person_id_card_front = #{legalPersonIdCardFront},
</if>
<if test="legalPersonIdCardBack != null">
legal_person_id_card_back = #{legalPersonIdCardBack},
</if>
<if test="securityPersonName != null">
security_person_name = #{securityPersonName},
</if>
<if test="securityPersonPhone != null">
security_person_phone = #{securityPersonPhone},
</if>
<if test="masterName != null">
master_name = #{masterName},
</if>
<if test="masterPhone != null">
master_phone = #{masterPhone},
</if>
<if test="masterIdCard != null">
master_id_card = #{masterIdCard},
</if>
<if test="masterIdCardFront != null">
master_id_card_front = #{masterIdCardFront},
</if>
<if test="masterIdCardBack != null">
master_id_card_back = #{masterIdCardBack},
</if>
<if test="isDanger != null">
is_danger = #{isDanger},
</if>
<if test="hiddenDangerTypeId != null">
hidden_danger_type_id = #{hiddenDangerTypeId},
</if>
<if test="hiddenDangerTypeName != null">
hidden_danger_type_name = #{hiddenDangerTypeName},
</if>
<if test="degreeOfConcernId != null">
degree_of_concern_id = #{degreeOfConcernId},
</if>
<if test="degreeOfConcernName != null">
degree_of_concern_name = #{degreeOfConcernName},
</if>
<if test="canEstablishPartyOrg != null">
can_establish_party_org = #{canEstablishPartyOrg},
</if>
<if test="hasPartyOrg != null">
has_party_org = #{hasPartyOrg},
</if>
<if test="partyOrgTotalPerson != null">
party_org_total_person = #{partyOrgTotalPerson},
</if>
<if test="hasLabourUnion != null">
has_labour_union = #{hasLabourUnion},
</if>
<if test="labourUnionTotalPerson != null">
labour_union_total_person = #{labourUnionTotalPerson},
</if>
<if test="hasCommunistYouthLeague != null">
has_communist_youth_league = #{hasCommunistYouthLeague},
</if>
<if test="communistYouthLeagueTotalPerson != null">
communist_youth_league_total_person = #{communistYouthLeagueTotalPerson},
</if>
<if test="hasWomenFederation != null">
has_women_federation = #{hasWomenFederation},
</if>
<if test="womenTotalPerson != null">
women_total_person = #{womenTotalPerson},
</if>
<if test="enterpriseLng != null and enterpriseLng != ''">
enterprise_lng = #{enterpriseLng},
</if>
<if test="enterpriseLat != null and enterpriseLat != ''">
enterprise_lat = #{enterpriseLat},
</if>
<if test="areaCode != null and areaCode != ''">
area_code = #{areaCode},
</if>
<if test="areaName != null and areaName != ''">
area_name = #{areaName},
</if>
<if test="gridCode != null and gridCode != ''">
grid_code = #{gridCode},
</if>
<if test="gridName != null and gridName != ''">
grid_name = #{gridName},
</if>
<if test="isLogOff != null">
is_log_off = #{isLogOff},
</if>
<if test="remarks != null">
remarks = #{remarks},
</if>
<if test="facadePhotos != null">
facade_photos = #{facadePhotos},
</if>
<if test="workplacePhotos != null">
workplace_photos = #{workplacePhotos},
</if>
gmt_modified = #{gmtModified},
modifier = #{modifier}
WHERE
enterprise_id = #{enterpriseId}
</update>
<!-- 非公有制经济组织详情 -->
<select id="get" parameterType="map" resultMap="enterpriseDTO">
SELECT
t1.enterprise_name,
t1.enterprise_type_id,
t1.enterprise_type_name,
t1.enterprise_address,
t1.enterprise_tel,
t1.business_reg_no,
t1.business_license,
t1.business_license_start_date,
t1.business_license_end_date,
t1.total_person,
t1.legal_person_id_card_code,
t1.legal_person_id_card_code_name,
t1.legal_person_id_card,
t1.legal_person_name,
t1.legal_person_phone,
t1.legal_person_id_card_front,
t1.legal_person_id_card_back,
t1.security_person_name,
t1.security_person_phone,
t1.master_name,
t1.master_phone,
t1.master_id_card,
t1.master_id_card_front,
t1.master_id_card_back,
t1.is_danger,
t1.hidden_danger_type_id,
t1.hidden_danger_type_name,
t1.degree_of_concern_id,
t1.degree_of_concern_name,
t1.can_establish_party_org,
t1.has_party_org,
t1.party_org_total_person,
t1.has_labour_union,
t1.labour_union_total_person,
t1.has_communist_youth_league,
t1.communist_youth_league_total_person,
t1.has_women_federation,
t1.women_total_person,
t1.enterprise_lng,
t1.enterprise_lat,
t1.area_code,
t1.area_name,
t1.grid_code,
t1.grid_name,
t1.is_log_off,
t1.remarks,
t1.facade_photos,
t1.workplace_photos,
t1.enterprise_id
FROM
org_enterprise t1
WHERE
t1.is_delete = 0
<if test="enterpriseId != null and enterpriseId != ''">
AND
t1.enterprise_id = #{enterpriseId}
</if>
</select>
<!-- 非公有制经济组织详情 -->
<select id="getBO" parameterType="map" resultMap="enterpriseBO">
SELECT
t1.enterprise_id,
t1.enterprise_name,
t1.enterprise_type_id,
t1.enterprise_type_name,
t1.enterprise_address,
t1.enterprise_tel,
t1.business_reg_no,
t1.business_license,
t1.business_license_start_date,
t1.business_license_end_date,
t1.total_person,
t1.legal_person_id_card_code,
t1.legal_person_id_card_code_name,
t1.legal_person_id_card,
t1.legal_person_name,
t1.legal_person_phone,
t1.legal_person_id_card_front,
t1.legal_person_id_card_back,
t1.security_person_name,
t1.security_person_phone,
t1.master_name,
t1.master_phone,
t1.master_id_card,
t1.master_id_card_front,
t1.master_id_card_back,
t1.is_danger,
t1.hidden_danger_type_id,
t1.hidden_danger_type_name,
t1.degree_of_concern_id,
t1.degree_of_concern_name,
t1.can_establish_party_org,
t1.has_party_org,
t1.party_org_total_person,
t1.has_labour_union,
t1.labour_union_total_person,
t1.has_communist_youth_league,
t1.communist_youth_league_total_person,
t1.has_women_federation,
t1.women_total_person,
t1.enterprise_lng,
t1.enterprise_lat,
t1.area_code,
t1.area_name,
t1.grid_code,
t1.grid_name,
t1.is_log_off,
t1.remarks,
t1.facade_photos,
t1.workplace_photos,
t1.gmt_create,
t1.creator,
t1.gmt_modified,
t1.modifier,
t1.is_delete
FROM
org_enterprise t1
WHERE
t1.is_delete = 0
<if test="enterpriseId != null and enterpriseId != ''">
AND
t1.enterprise_id = #{enterpriseId}
</if>
</select>
<!-- 非公有制经济组织详情 -->
<select id="getPO" parameterType="map" resultMap="enterprisePO">
SELECT
t1.enterprise_id,
t1.enterprise_name,
t1.enterprise_type_id,
t1.enterprise_type_name,
t1.enterprise_address,
t1.enterprise_tel,
t1.business_reg_no,
t1.business_license,
t1.business_license_start_date,
t1.business_license_end_date,
t1.total_person,
t1.legal_person_id_card_code,
t1.legal_person_id_card_code_name,
t1.legal_person_id_card,
t1.legal_person_name,
t1.legal_person_phone,
t1.legal_person_id_card_front,
t1.legal_person_id_card_back,
t1.security_person_name,
t1.security_person_phone,
t1.master_name,
t1.master_phone,
t1.master_id_card,
t1.master_id_card_front,
t1.master_id_card_back,
t1.is_danger,
t1.hidden_danger_type_id,
t1.hidden_danger_type_name,
t1.degree_of_concern_id,
t1.degree_of_concern_name,
t1.can_establish_party_org,
t1.has_party_org,
t1.party_org_total_person,
t1.has_labour_union,
t1.labour_union_total_person,
t1.has_communist_youth_league,
t1.communist_youth_league_total_person,
t1.has_women_federation,
t1.women_total_person,
t1.enterprise_lng,
t1.enterprise_lat,
t1.area_code,
t1.area_name,
t1.grid_code,
t1.grid_name,
t1.is_log_off,
t1.remarks,
t1.facade_photos,
t1.workplace_photos,
t1.gmt_create,
t1.creator,
t1.gmt_modified,
t1.modifier,
t1.is_delete
FROM
org_enterprise t1
WHERE
t1.is_delete = 0
<if test="enterpriseId != null and enterpriseId != ''">
AND
t1.enterprise_id = #{enterpriseId}
</if>
<if test="businessRegNo != null and businessRegNo != ''">
AND
t1.business_reg_no = #{businessRegNo}
</if>
</select>
<!-- 非公有制经济组织列表 -->
<select id="list" parameterType="map" resultMap="enterpriseDTO">
SELECT
t1.enterprise_id,
t1.enterprise_name,
t1.enterprise_type_id,
t1.enterprise_type_name,
t1.enterprise_address,
t1.enterprise_tel,
t1.business_reg_no,
t1.business_license,
t1.business_license_start_date,
t1.business_license_end_date,
t1.total_person,
t1.legal_person_id_card_code,
t1.legal_person_id_card_code_name,
t1.legal_person_id_card,
t1.legal_person_name,
t1.legal_person_phone,
t1.legal_person_id_card_front,
t1.legal_person_id_card_back,
t1.security_person_name,
t1.security_person_phone,
t1.master_name,
t1.master_phone,
t1.master_id_card,
t1.master_id_card_front,
t1.master_id_card_back,
t1.is_danger,
t1.hidden_danger_type_id,
t1.hidden_danger_type_name,
t1.degree_of_concern_id,
t1.degree_of_concern_name,
t1.can_establish_party_org,
t1.has_party_org,
t1.party_org_total_person,
t1.has_labour_union,
t1.labour_union_total_person,
t1.has_communist_youth_league,
t1.communist_youth_league_total_person,
t1.has_women_federation,
t1.women_total_person,
t1.enterprise_lng,
t1.enterprise_lat,
t1.area_code,
t1.area_name,
t1.grid_code,
t1.grid_name,
t1.is_log_off,
t1.remarks,
t1.facade_photos,
t1.workplace_photos,
t1.gmt_create,
1
FROM
org_enterprise t1
WHERE
t1.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
<!-- 这里添加其他条件 -->
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
<if test="enterpriseIds != null and enterpriseIds.size > 0">
AND
t1.enterprise_id IN
<foreach collection="enterpriseIds" index="index" open="(" separator="," close=")">
#{enterpriseIds[${index}]}
</foreach>
</if>
</select>
<!-- 非公有制经济组织列表 -->
<select id="listBO" parameterType="map" resultMap="enterpriseBO">
SELECT
t1.enterprise_id,
t1.enterprise_name,
t1.enterprise_type_id,
t1.enterprise_type_name,
t1.enterprise_address,
t1.enterprise_tel,
t1.business_reg_no,
t1.business_license,
t1.business_license_start_date,
t1.business_license_end_date,
t1.total_person,
t1.legal_person_id_card_code,
t1.legal_person_id_card_code_name,
t1.legal_person_id_card,
t1.legal_person_name,
t1.legal_person_phone,
t1.legal_person_id_card_front,
t1.legal_person_id_card_back,
t1.security_person_name,
t1.security_person_phone,
t1.master_name,
t1.master_phone,
t1.master_id_card,
t1.master_id_card_front,
t1.master_id_card_back,
t1.is_danger,
t1.hidden_danger_type_id,
t1.hidden_danger_type_name,
t1.degree_of_concern_id,
t1.degree_of_concern_name,
t1.can_establish_party_org,
t1.has_party_org,
t1.party_org_total_person,
t1.has_labour_union,
t1.labour_union_total_person,
t1.has_communist_youth_league,
t1.communist_youth_league_total_person,
t1.has_women_federation,
t1.women_total_person,
t1.enterprise_lng,
t1.enterprise_lat,
t1.area_code,
t1.area_name,
t1.grid_code,
t1.grid_name,
t1.is_log_off,
t1.remarks,
t1.facade_photos,
t1.workplace_photos,
t1.gmt_create,
t1.creator,
t1.gmt_modified,
t1.modifier,
t1.is_delete
FROM
org_enterprise t1
WHERE
t1.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
<!-- 这里添加其他条件 -->
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
<if test="enterpriseIds != null and enterpriseIds.size > 0">
AND
t1.enterprise_id IN
<foreach collection="enterpriseIds" index="index" open="(" separator="," close=")">
#{enterpriseIds[${index}]}
</foreach>
</if>
</select>
<!-- 非公有制经济组织列表 -->
<select id="listPO" parameterType="map" resultMap="enterprisePO">
SELECT
t1.enterprise_id,
t1.enterprise_name,
t1.enterprise_type_id,
t1.enterprise_type_name,
t1.enterprise_address,
t1.enterprise_tel,
t1.business_reg_no,
t1.business_license,
t1.business_license_start_date,
t1.business_license_end_date,
t1.total_person,
t1.legal_person_id_card_code,
t1.legal_person_id_card_code_name,
t1.legal_person_id_card,
t1.legal_person_name,
t1.legal_person_phone,
t1.legal_person_id_card_front,
t1.legal_person_id_card_back,
t1.security_person_name,
t1.security_person_phone,
t1.master_name,
t1.master_phone,
t1.master_id_card,
t1.master_id_card_front,
t1.master_id_card_back,
t1.is_danger,
t1.hidden_danger_type_id,
t1.hidden_danger_type_name,
t1.degree_of_concern_id,
t1.degree_of_concern_name,
t1.can_establish_party_org,
t1.has_party_org,
t1.party_org_total_person,
t1.has_labour_union,
t1.labour_union_total_person,
t1.has_communist_youth_league,
t1.communist_youth_league_total_person,
t1.has_women_federation,
t1.women_total_person,
t1.enterprise_lng,
t1.enterprise_lat,
t1.area_code,
t1.area_name,
t1.grid_code,
t1.grid_name,
t1.is_log_off,
t1.remarks,
t1.facade_photos,
t1.workplace_photos,
t1.gmt_create,
t1.creator,
t1.gmt_modified,
t1.modifier,
t1.is_delete
FROM
org_enterprise t1
WHERE
t1.is_delete = 0
<if test="keywords != null and keywords != ''">
AND (
<!-- 这里添加其他条件 -->
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ <= ]]> #{endTime}
</if>
<if test="enterpriseIds != null and enterpriseIds.size > 0">
AND
t1.enterprise_id IN
<foreach collection="enterpriseIds" index="index" open="(" separator="," close=")">
#{enterpriseIds[${index}]}
</foreach>
</if>
</select>
<!-- 非公有制经济组织统计 -->
<select id="count" parameterType="map" resultType="Integer">
SELECT
COUNT(*)
FROM
org_enterprise t1
WHERE
t1.is_delete = 0
</select>
</mapper>