select id, competition_id, main_team_id, main_team_name, guest_team_id, guest_team_name, competition_time, DATE_FORMAT(competition_time,'%Y-%m-%d') as competitionDate, building_id, building_name, competition_address, competition_group, status, created_time, last_updated_time, created_by, modified_by, is_deleted, remark, main_team_score, guest_team_score, vs_type, batch_number from competition_team_vs_team
insert into competition_team_vs_team
competition_id,main_team_id,main_team_name,guest_team_id,guest_team_name,competition_time,building_id,building_name,competition_address,competition_group,status,created_time,last_updated_time,created_by,modified_by,is_deleted,remark,main_team_score,guest_team_score,vs_type,batch_number,#{competitionId},#{mainTeamId},#{mainTeamName},#{guestTeamId},#{guestTeamName},#{competitionTime},#{buildingId},#{buildingName},#{competitionAddress},#{competitionGroup},#{status},#{createdTime},#{lastUpdatedTime},#{createdBy},#{modifiedBy},#{isDeleted},#{remark},#{mainTeamScore},#{guestTeamScore},#{vsType},#{batchNumber},
update competition_team_vs_team
competition_id = #{competitionId},main_team_id = #{mainTeamId},main_team_name = #{mainTeamName},guest_team_id = #{guestTeamId},guest_team_name = #{guestTeamName},competition_time = #{competitionTime},building_id = #{buildingId},building_name = #{buildingName},competition_address = #{competitionAddress},competition_group = #{competitionGroup},status = #{status},created_time = #{createdTime},last_updated_time = #{lastUpdatedTime},created_by = #{createdBy},modified_by = #{modifiedBy},is_deleted = #{isDeleted},remark = #{remark},main_team_score = #{mainTeamScore},guest_team_score = #{guestTeamScore},vs_type = #{vsType},batch_number = #{batchNumber},
where id = #{id}
update competition_team_vs_team set is_deleted = 1
and competition_id = #{competitionId} and main_team_id = #{mainTeamId} and main_team_name like concat('%', #{mainTeamName}, '%') and guest_team_id = #{guestTeamId} and guest_team_name like concat('%', #{guestTeamName}, '%') and competition_time = #{competitionTime} and building_id = #{buildingId} and building_name like concat('%', #{buildingName}, '%') and competition_address = #{competitionAddress} and competition_group = #{competitionGroup} and status = #{status} and last_updated_time = #{lastUpdatedTime} and vs_type = #{vsType} and batch_number = #{batchNumber}
update competition_team_vs_team set status = 2 where status <> 2 and competition_time now()
delete from competition_team_vs_team where id = #{id}
delete from competition_team_vs_team where id in
#{id}