update
enterprise
set
dlcompanycode = #{dlcompanycode},
infoupdatebyname = #{infoupdatebyname},
infoupdateby = #{infoupdateby},
infoupdatetime = #{infoupdatetime},
deviceid = null
where id = #{id}
update enterprise
set loginvalidflag = #{flag}
where id = #{id}
update enterprise
set validflag = 0
where id = #{id}
select e.*,
#{params.leagalrepresentative} legalrepresentative,
#{params.informationofficer} informationofficer,
#{params.mainprincipal} mainprincipal,
#{params.securityofficer} securityofficer
from enterprise e
where e.validflag = 1
and e.enterprisenumber = #{params.enterprisenumber}
and e.province = #{params.province}
and e.city = #{params.city}
and e.district = #{params.district}
and e.street = #{params.street}
and e.committee = #{params.committee}
and e.safetysupervision = #{params.safetySupervision}
and e.economicIndustry = #{params.economicIndustry}
and e.validendtime > now()
and e.validendtime <= now()
and e.loginvalidflag = 1
or e.loginvalidflag is null
and e.loginvalidflag = 0
and e.province = #{params.filterProvince}
and e.city = #{params.filterCity}
and e.district = #{params.filterDistrict}
and e.street = #{params.filterStreet}
and e.committee = #{params.filterCommittee}
and e.enterprisename like concat("%",#{params.enterprisename},"%")
select es.*
from enterprisestaff es
where belongid = #{eid}
and type =#{type}
select id,
enterprisename,
enterprisenumber,
province,
city,
district,
street,
committee
from enterprise
where validflag = 1
and enterprisename like concat("%",#{params.enterprisename},"%")
and safetysupervision = #{params.safetysupervision}
and province = #{params.province}
and city = #{params.city}
and district = #{params.district}
and street = #{params.street}
SELECT
enterprise.id,
enterprise.safetysupervision,
enterprise.enterprisenumber,
enterprise.enterprisename,
enterprise.officeaddress,
enterprise.securitysupervisory,
enterprise.officephone,
mainprincipal.`name` as mainperson,
safety.`name` as safety
FROM
enterprise
LEFT JOIN enterprisestaff as mainprincipal ON enterprise.id = mainprincipal.belongid and mainprincipal.type = '主要负责人'
LEFT JOIN enterprisestaff as safety ON enterprise.id = safety.belongid and safety.type = '安全负责人'
WHERE
enterprise.validflag = '1'
and enterprise.enterprisenumber = #{enterprisenumber}
LIMIT 1
SELECT IFNULL(a.salenum,0) salenum,IFNULL(b.storagenum,0) storagenum
from
(
SELECT count(0) salenum,so.companynumber
from
saleorder as so
left join saleorderdetail as sod on sod.ordercode = so.code
where so.companynumber= #{enterprisenumber}
and so.createdat > #{starttime}
) as a
LEFT JOIN
(SELECT sum(eo.num) storagenum,eo.companynumber
from entryorder as eo
where eo.companynumber= #{enterprisenumber}
and eo.entrydate > #{starttime}
) as b
on a.companynumber = b.companynumber
select
e.enterprisename,
e.enterprisenumber,
e.safetysupervision,
IFNULL(e.economicindustry,'') economicindustry,
IFNULL(e.officeaddress,'') officeaddress,
IFNULL(e.officephone,'') officephone,
IFNULL(e.latitude,'') latitude,
IFNULL(e.longitude,'') longitude
from enterprise as e
e.validflag = 1
and e.city = #{city}
select
e.city,
count(0) num
from enterprise as e
where e.province = #{province}
GROUP BY e.city
select
e.enterprisename,
e.enterprisenumber,
e.securitysupervisory,
e.safetysupervision,
ifnull(e.province,'') province,
ifnull(e.city,'') city,
ifnull(e.district,'') district,
ifnull(e.street,'') street,
ifnull(e.committee,'') committee,
date_format(e.validstarttime,'%Y-%m-%d') validstarttime,
date_format(e.validendtime,'%Y-%m-%d') validendtime,
e.insurancecontractnumber,
e.insureamount,
date_format(e.insurestarttime,'%Y-%m-%d') insurestarttime,
date_format(e.insureendtime,'%Y-%m-%d') insureendtime ,
e.insurancecompany,
e.personnumber,
e.employeenumber,
case e.ispaysafetyinsurance when null then '' when 1 then '是' when 0 then '否' end ispaysafetyinsurance,
case e.ismajorhazard when null then '' when 1 then '有' when 0 then '无' end ismajorhazard,
ifnull(standardization.level,'') level
from enterprise as e
left join enterprisestandardization as standardization on standardization.enterpriseid = e.id and standardization.validflag = 1
where e.validflag = 1
and e.enterprisenumber = #{params.enterprisenumber}
and e.province = #{params.province}
and e.city = #{params.city}
and e.district = #{params.district}
and e.street = #{params.street}
and e.committee = #{params.committee}
and e.safetysupervision = #{params.safetySupervision}
and e.economicIndustry = #{params.economicIndustry}
and e.validendtime > now()
and e.validendtime < now()
and e.province = #{params.filterProvince}
and e.city = #{params.filterCity}
and e.district = #{params.filterDistrict}
and e.street = #{params.filterStreet}
and e.committee = #{params.filterCommittee}
and e.enterprisename like concat("%",#{params.enterprisename},"%")
group by e.id
select count(0)
from enterprise as e
where e.safetysupervision != #{safetysupervision}
and validflag = 1
select
e.id,
e.enterprisename,
e.enterprisenumber
from enterprise as e
e.enterprisestatus = "ON"
and e.validflag = 1
and (e.enterprisenumber = #{params.enterprisenumber}
or e.enterprisenumber = #{item}
)
and e.enterprisename like concat("%",#{params.enterprisename},"%")
and e.parententerprisename like concat("%",#{params.parententerprisename},"%")
and e.safetysupervision = #{params.safetysupervision}
and e.province = #{params.filterProvince}
and e.city = #{params.filterCity}
and e.district = #{params.filterDistrict}
and e.street = #{params.filterStreet}
and e.committee = #{params.filterCommittee}
select count(0)
from enterprise as e
e.validflag = 1
and e.officeaddress is null
and (e.enterprisestatus = 'ON' or e.enterprisestatus is null)
and e.province = #{params.province}
and e.city = #{params.city}
and e.district = #{params.district}
and e.street = #{params.street}
and e.committee = #{params.committee}
select
e.enterprisename,
e.enterprisenumber
from enterprise as e
where e.validflag = 1
and e.province = #{params.province}
and e.city = #{params.city}
and e.district = #{params.district}
and e.street = #{params.street}
and e.committee = #{params.committee}
and e.safetysupervision = #{params.safetysupervision}
and e.safetysupervision != #{params.safetysupervision}
select
e.id,
e.enterprisename,
e.enterprisenumber,
e.province,
e.city,
e.district,
e.street,
e.committee
from enterprise as e
e.validflag = 1
and (e.enterprisestatus = 'ON' or e.enterprisestatus is null)
and e.officeaddress is null
and e.province = #{params.province}
and e.city = #{params.city}
and e.district = #{params.district}
and e.street = #{params.street}
and e.committee = #{params.committee}
and e.province = #{params.filterProvince}
and e.city = #{params.filterCity}
and e.district = #{params.filterDistrict}
and e.street = #{params.filterStreet}
and e.committee = #{params.filterCommittee}
and e.enterprisename like concat("%",#{params.enterprisename},"%")
select count(0)
from enterprise as e
e.validflag = 1
and (e.enterprisestatus = 'ON' or e.enterprisestatus is null)
and (e.validendtime < now() or e.validendtime is null)
and e.province = #{params.province}
and e.city = #{params.city}
and e.district = #{params.district}
and e.street = #{params.street}
and e.committee = #{params.committee}
select
e.id,
e.enterprisename,
e.enterprisenumber,
e.province,
e.city,
e.district,
e.street,
e.committee,
e.validstarttime,
e.validendtime
from enterprise as e
e.validflag = 1
and (e.enterprisestatus = 'ON' or e.enterprisestatus is null)
and (e.validendtime < now() or e.validendtime is null)
and e.province = #{params.province}
and e.city = #{params.city}
and e.district = #{params.district}
and e.street = #{params.street}
and e.committee = #{params.committee}
and e.province = #{params.filterProvince}
and e.city = #{params.filterCity}
and e.district = #{params.filterDistrict}
and e.street = #{params.filterStreet}
and e.committee = #{params.filterCommittee}
and e.enterprisename like concat("%",#{params.enterprisename},"%")
order by e.validendtime desc
select
enterprise.id,
enterprise.enterprisename,
enterprise.enterprisenumber,
enterprise.province,
enterprise.city,
enterprise.district
from enterprise
1=1
and enterprise.validflag = 1
and enterprise.enterprisestatus = 'ON'
and enterprise.enterprisename like CONCAT('%',#{condition.name},'%')
and (enterprise.enterprisenumber =#{condition.operator}
or enterprise.enterprisenumber = #{item}
)
and enterprise.safetysupervision = #{condition.type}
and enterprise.province = #{condition.province}
and enterprise.city = #{condition.city}
and enterprise.district = #{condition.district}
and enterprise.street = #{condition.street}
and enterprise.committee = #{condition.community}
select
count(*)
from (
select
enterprise.id,
enterprise.enterprisename,
enterprise.enterprisenumber,
enterprise.province,
enterprise.city,
enterprise.district
from enterprise
1=1
and enterprise.validflag = 1
and enterprise.enterprisestatus = 'ON'
and enterprise.enterprisename like CONCAT('%',#{condition.name},'%')
and (enterprise.enterprisenumber =#{condition.operator}
or enterprise.enterprisenumber = #{item}
)
and enterprise.safetysupervision = #{condition.type}
and enterprise.province = #{condition.province}
and enterprise.city = #{condition.city}
and enterprise.district = #{condition.district}
and enterprise.street = #{condition.street}
and enterprise.committee = #{condition.community}
)temp
select e.id from enterprise e
1=1
and province = #{province}
and city = #{city}
and district = #{district}
and street = #{street}
and committee = #{committee}
select
e.id,
e.enterprisename,
e.enterprisenumber,
e.province,
e.city,
e.district,
e.street,
e.committee,
e.validstarttime,
e.validendtime
from enterprise as e
1=1
and e.province like #{province}
and e.city like #{city}
and e.district like #{district}
and e.street like #{street}
and e.committee like #{committee}
select
e.id,
e.enterprisename,
e.enterprisenumber,
e.province,
e.city,
e.district,
e.street,
e.committee,
e.validstarttime,
e.validendtime
from enterprise as e
where e.enterprisename like #{partten}