select card_id, card_no, nick_name, school_id, distribute_type, distribute_location, distribute_school_id, distribute_exam_type, grade_id, class_id, year, type, agent_id, password, status, is_pay, is_refund, is_settlement, is_used, is_send, close_id, open_id, remark, distribute_time, out_date, pay_time, active_time, refund_time, close_time, create_time, update_time from b_busi_cards
INSERT INTO b_busi_cards(
card_id, distribute_type, distribute_location, distribute_school_id, distribute_exam_type, year, agent_id, status, is_pay, is_refund, is_settlement,
close_id, open_id, distribute_time,
out_date, pay_time, refund_time, close_time, update_time
) VALUES
(#{item.cardId}, #{item.distributeType}, #{item.distributeLocation}, #{item.distributeSchoolId}, #{item.distributeExamType}, #{item.year}, #{item.agentId}, #{item.status},
#{item.isPay}, #{item.isRefund}, #{item.isSettlement}, #{item.closeId}, #{item.openId}, #{item.distributeTime},
#{item.outDate}, #{item.payTime}, #{item.refundTime}, #{item.closeTime}, #{item.updateTime})
ON DUPLICATE KEY UPDATE distribute_type = VALUES(distribute_type), distribute_location = VALUES(distribute_location), distribute_school_id = VALUES(distribute_school_id), distribute_exam_type = VALUES(distribute_exam_type), year = VALUES(year), agent_id = VALUES(agent_id),
status = VALUES(status), is_pay = VALUES(is_pay), is_refund = VALUES(is_refund), is_settlement = VALUES(is_settlement),
close_id = VALUES(close_id), open_id = VALUES(open_id), distribute_time = VALUES(distribute_time), out_date = VALUES(out_date),
pay_time = VALUES(pay_time), refund_time = VALUES(refund_time), close_time = VALUES(close_time), update_time = VALUES(update_time)
insert into b_busi_cards(type,card_no,password,create_time, update_time)
VALUES
(#{item.type},#{item.cardNo},#{item.password},#{item.createTime}, #{item.updateTime})
insert into b_busi_cards
card_no,
nick_name,
school_id,
distribute_type,
distribute_location,
distribute_school_id,
distribute_exam_type,
grade_id,
class_id,
year,
type,
agent_id,
password,
status,
is_pay,
is_refund,
is_settlement,
is_used,
is_send,
close_id,
open_id,
remark,
distribute_time,
out_date,
pay_time,
active_time,
refund_time,
close_time,
create_time,
update_time,
#{cardNo},
#{nickName},
#{schoolId},
#{distributeType},
#{distributeLocation},
#{distributeSchoolId},
#{distributeExamType},
#{gradeId},
#{classId},
#{year},
#{type},
#{agentId},
#{password},
#{status},
#{isPay},
#{isRefund},
#{isSettlement},
#{isUsed},
#{isSend},
#{closeId},
#{openId},
#{remark},
#{distributeTime},
#{outDate},
#{payTime},
#{activeTime},
#{refundTime},
#{closeTime},
#{createTime},
#{updateTime},
update b_busi_cards
card_no = #{cardNo},
nick_name = #{nickName},
school_id = #{schoolId},
distribute_type = #{distributeType},
distribute_location = #{distributeLocation},
distribute_school_id = #{distributeSchoolId},
distribute_exam_type = #{distributeExamType},
grade_id = #{gradeId},
class_id = #{classId},
year = #{year},
end_year = #{endYear},
type = #{type},
agent_id = #{agentId},
password = #{password},
status = #{status},
is_pay = #{isPay},
is_refund = #{isRefund},
is_settlement = #{isSettlement},
is_used = #{isUsed},
is_send = #{isSend},
close_id = #{closeId},
open_id = #{openId},
remark = #{remark},
distribute_time = #{distributeTime},
out_date = #{outDate},
pay_time = #{payTime},
active_time = #{activeTime},
refund_time = #{refundTime},
close_time = #{closeTime},
create_time = #{createTime},
update_time = #{updateTime},
where card_id = #{cardId}
update b_busi_cards
-- 已关卡的不能重新关闭
${params.custSet},
status = #{status},
pay_status = #{payStatus},
is_pay = #{isPay},
is_refund = #{isRefund},
close_id = #{closeId},
open_id = #{openId},
distribute_time = #{distributeTime},
out_date = #{outDate},
pay_time = #{payTime},
refund_time = #{refundTime},
close_time = #{closeTime},
out_date=DATE_ADD(out_date,INTERVAL #{days} day),
where card_id in
#{item}
${params.custWhere}
delete from b_busi_cards where card_id = #{cardId}
delete from b_busi_cards where card_id in
#{cardId}