insert into business_building_owner(
operate,sex,name,link,remark,owner_id,b_id,user_id,age,member_id,owner_type_cd,community_id,id_card,state
) values (
#{operate},#{sex},#{name},#{link},#{remark},#{ownerId},#{bId},#{userId},#{age},#{memberId},#{ownerTypeCd},#{communityId},#{idCard},#{state}
)
select t.operate,t.sex,t.name,t.link,t.remark,t.owner_id,t.owner_id ownerId,t.b_id,t.b_id bId,
t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,
t.owner_type_cd ownerTypeCd,t.community_id,t.community_id communityId,
t.id_card, t.id_card idCard,t.state
from business_building_owner t
where 1 =1
and t.operate= #{operate}
and t.sex= #{sex}
and t.name = #{name}
and t.link= #{link}
and t.remark= #{remark}
and t.owner_id= #{ownerId}
and t.community_id= #{communityId}
and t.id_card = #{idCard}
and t.b_id= #{bId}
and t.user_id= #{userId}
and t.age= #{age}
and t.state= #{state}
and t.member_id= #{memberId}
and t.owner_type_cd= #{ownerTypeCd}
insert into building_owner(
sex,name,link,status_cd,remark,owner_id,b_id,user_id,age,member_id,owner_type_cd,community_id,id_card,state
) select t.sex,t.name,t.link,'0',t.remark,t.owner_id,t.b_id,t.user_id,t.age,t.member_id,t.owner_type_cd,
t.community_id communityId,t.id_card,state
from business_building_owner t where 1=1
and t.operate= 'ADD'
and t.sex= #{sex}
and t.name= #{name}
and t.link= #{link}
and t.remark= #{remark}
and t.owner_id= #{ownerId}
and t.community_id= #{communityId}
and t.id_card = #{idCard}
and t.b_id= #{bId}
and t.user_id= #{userId}
and t.age= #{age}
and t.member_id= #{memberId}
and t.owner_type_cd= #{ownerTypeCd}
and t.state= #{state}
select t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,
t.owner_id,t.owner_id ownerId,t.b_id,t.b_id bId,
t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,
t.owner_type_cd ownerTypeCd,t.create_time createTime,t.community_id,
t.community_id communityId,t.id_card, t.id_card idCard,t.state,td.name ownerTypeName
, borr.room_id roomId
from building_owner t,t_dict td
,building_owner_room_rel borr
,building_owner_room_rel borr
where 1 = 1
and t.owner_id = borr.owner_id
and borr.status_cd = t.status_cd
and borr.room_id = #{roomId}
and t.owner_id = borr.owner_id
and borr.status_cd = t.status_cd
and borr.room_id in
#{item}
and td.table_name = 'building_owner'
and td.`table_columns` = 'owner_type_cd'
and td.status_cd = t.owner_type_cd
and t.sex= #{sex}
and t.name = #{name}
and t.link= #{link}
and t.status_cd= #{statusCd}
and t.remark= #{remark}
and t.owner_id= #{ownerId}
and t.community_id= #{communityId}
and t.id_card = #{idCard}
and t.b_id= #{bId}
and t.user_id= #{userId}
and t.age= #{age}
and t.state= #{state}
and t.member_id= #{memberId}
and t.owner_id in
#{item}
and t.owner_type_cd= #{ownerTypeCd}
and t.owner_type_cd in
#{item}
order by t.create_time desc
limit #{page}, #{row}
select count(1) count
from building_owner t
,building_owner_room_rel borr
,building_owner_room_rel borr
where 1 =1
and t.owner_id = borr.owner_id
and borr.status_cd = '0'
and borr.room_id = #{roomId}
and t.owner_id = borr.owner_id
and borr.status_cd = '0'
and borr.room_id in
#{item}
and t.sex= #{sex}
and t.name like concat('%',#{name},'%')
and t.link= #{link}
and t.status_cd= #{statusCd}
and t.remark= #{remark}
and t.owner_id= #{ownerId}
and t.community_id= #{communityId}
and t.id_card = #{idCard}
and t.b_id= #{bId}
and t.user_id= #{userId}
and t.age= #{age}
and t.state= #{state}
and t.member_id= #{memberId}
and t.owner_id in
#{item}
and t.owner_type_cd= #{ownerTypeCd}
update building_owner t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.sex= #{sex}
, t.name= #{name}
, t.link= #{link}
, t.remark= #{remark}
, t.owner_id= #{ownerId}
, t.user_id= #{userId}
, t.age= #{age}
, t.state= #{state}
, t.id_card = #{idCard}
where 1=1
and t.b_id= #{bId}
and t.community_id= #{communityId}
and t.member_id= #{memberId}
select count(1) count
FROM building_owner t
where 1=1
and t.sex= #{sex}
and t.name like concat('%',#{name},'%')
and t.link= #{link}
and t.status_cd= #{statusCd}
and t.remark= #{remark}
and t.owner_id= #{ownerId}
and t.community_id= #{communityId}
and t.id_card = #{idCard}
and t.b_id= #{bId}
and t.user_id= #{userId}
and t.age= #{age}
and t.state= #{state}
and t.member_id= #{memberId}
and t.owner_type_cd= #{ownerTypeCd}
select count(1) count
FROM building_owner t
WHERE
t.`status_cd` = '0'
and t.sex= #{sex}
and t.name like concat('%',#{name},'%')
and t.link= #{link}
and t.status_cd= #{statusCd}
and t.remark= #{remark}
and t.owner_id= #{ownerId}
and t.community_id= #{communityId}
and t.id_card = #{idCard}
and t.b_id= #{bId}
and t.user_id= #{userId}
and t.age= #{age}
and t.member_id= #{memberId}
and t.owner_type_cd= #{ownerTypeCd}
select t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,t.owner_id,t.owner_id ownerId,t.b_id,t.b_id
bId,
t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,
t.owner_type_cd,t.owner_type_cd ownerTypeCd,t.community_id,
t.community_id communityId,t.id_card, t.id_card idCard
FROM building_owner t
WHERE
t.`status_cd` = '0'
and t.sex= #{sex}
and t.name like concat('%',#{name},'%')
and t.link= #{link}
and t.status_cd= #{statusCd}
and t.remark= #{remark}
and t.owner_id= #{ownerId}
and t.community_id= #{communityId}
and t.id_card = #{idCard}
and t.b_id= #{bId}
and t.user_id= #{userId}
and t.age= #{age}
and t.member_id= #{memberId}
and t.owner_id in
#{item}
and t.owner_type_cd= #{ownerTypeCd}
limit #{page}, #{row}
select
COUNT(1) count
from
building_owner o
left join building_owner_room_rel orr on o.owner_id = orr.owner_id and orr.status_cd = '0'
where o.status_cd = '0'
and o.owner_type_cd = '1001'
and o.community_id = #{communityId}
and orr.rel_id is null
SELECT t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,t.owner_id,t.owner_id ownerId,t.b_id,t.b_id
bId,
t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,t.owner_type_cd,t.owner_type_cd ownerTypeCd,
r.`room_id` roomId,r.`room_num` roomNum,t.community_id,t.community_id communityId,t.id_card, t.id_card idCard
FROM building_room r,building_owner_room_rel orr,building_owner t
WHERE r.`room_id` = orr.`room_id`
AND orr.`owner_id` = t.`owner_id`
AND r.`room_id` = #{roomId}
and r.room_id in
#{item}
and t.community_id= #{communityId}
and t.owner_type_cd = '1001'
AND r.`status_cd` = '0'
AND orr.`status_cd` = '0'
AND t.`status_cd` = '0'
select ps.num,ps.ps_id psId,t.sex,t.name,t.link,t.status_cd,t.status_cd statusCd,t.remark,t.owner_id,t.owner_id
ownerId,t.b_id,t.b_id bId,
t.user_id,t.user_id userId,t.age,t.member_id,t.member_id memberId,
t.owner_type_cd,t.owner_type_cd ownerTypeCd,t.id_card, t.id_card idCard
from p_parking_space ps , owner_car oc,building_owner t
where ps.ps_id = oc.ps_id
and oc.owner_id = t.owner_id
AND oc.`status_cd` = '0'
AND ps.`status_cd` = '0'
and oc.car_type_cd='1001'
AND t.`status_cd` = '0'
and ps.ps_id in
#{item}
AND ps.`ps_id` = #{psId}
SELECT
bo.owner_id ownerId,
bo.`name`,
bo.link,
t.start_time startTime,
t.end_time endTime,
t.create_time createTime,
t.room_id roomId
FROM
business_building_owner_room_rel t
INNER JOIN building_owner bo ON t.owner_id = bo.owner_id AND bo.status_cd = '0' AND bo.community_id = #{communityId}
WHERE
t.operate = 'ADD'
AND t.room_id = #{roomId}
ORDER BY
t.create_time DESC
limit #{page}, #{row}
select
COUNT(1) count
from business_building_owner_room_rel t
inner join building_owner bo on t.owner_id = bo.owner_id and bo.status_cd = '0' and bo.community_id = #{communityId}
where t.operate = 'ADD'
and t.room_id = #{roomId}
order by t.create_time desc