insert into business_car_black_white(
black_white,operate,car_num,start_time,end_time,community_id,b_id,bw_id
) values (
#{blackWhite},#{operate},#{carNum},#{startTime},#{endTime},#{communityId},#{bId},#{bwId}
)
insert into car_black_white(
black_white,car_num,start_time,status_cd,end_time,community_id,b_id,bw_id
) select t.black_white,t.car_num,t.start_time,'0',t.end_time,t.community_id,t.b_id,t.bw_id from
business_car_black_white t where 1=1
and t.black_white= #{blackWhite}
and t.operate= 'ADD'
and t.car_num= #{carNum}
and t.start_time= #{startTime}
and t.end_time= #{endTime}
and t.community_id= #{communityId}
and t.b_id= #{bId}
and t.bw_id= #{bwId}
update car_black_white t set t.status_cd = #{statusCd}
,t.b_id = #{newBId}
, t.black_white= #{blackWhite}
, t.car_num= #{carNum}
, t.start_time= #{startTime}
, t.end_time= #{endTime}
, t.community_id= #{communityId}
where 1=1
and t.b_id= #{bId}
and t.bw_id= #{bwId}