a.id AS "id",
a.name AS "name",
a.closingtype AS "closingtype",
a.endtime AS "endtime",
a.month AS "month",
a.starttime AS "starttime",
a.state AS "state",
a.year AS "year",
a.create_by AS "createBy",
a.create_date AS "createDate",
a.update_by AS "updateBy",
a.update_date AS "updateDate",
a.remarks AS "remarks",
a.del_flag AS "delFlag",
a.site_id AS "siteId",
a.customer_id AS "customerId",
case when a.closingtype = 1 then "月结" else "年结" end closingTypeName,
case when a.state = 0 then "未结账" else "已结账" end stateName
INSERT INTO pay_base_closingaccountinfo(
name,
closingtype,
endtime,
month,
starttime,
state,
year,
create_by,
create_date,
update_by,
update_date,
remarks,
del_flag,
site_id,
customer_id
) VALUES (
#{baseClosingAccountInfoDto.name},
#{baseClosingAccountInfoDto.closingType},
#{baseClosingAccountInfoDto.endTime},
#{baseClosingAccountInfoDto.month},
#{baseClosingAccountInfoDto.startTime},
#{baseClosingAccountInfoDto.state},
#{baseClosingAccountInfoDto.year},
#{baseClosingAccountInfoDto.createBy},
#{baseClosingAccountInfoDto.createDate},
#{baseClosingAccountInfoDto.updateBy},
#{baseClosingAccountInfoDto.updateDate},
#{baseClosingAccountInfoDto.remarks},
#{baseClosingAccountInfoDto.delFlag},
#{baseClosingAccountInfoDto.siteId},
#{baseClosingAccountInfoDto.customerId}
)
UPDATE pay_base_closingaccountinfo SET
name = #{baseClosingAccountInfoDto.name},
closingtype = #{baseClosingAccountInfoDto.closingType},
endtime = #{baseClosingAccountInfoDto.endTime},
month = #{baseClosingAccountInfoDto.month},
starttime = #{baseClosingAccountInfoDto.startTime},
state = #{baseClosingAccountInfoDto.state},
year = #{baseClosingAccountInfoDto.year},
update_by = #{baseClosingAccountInfoDto.updateBy},
update_date = #{baseClosingAccountInfoDto.updateDate},
remarks = #{baseClosingAccountInfoDto.remarks}
WHERE id = #{baseClosingAccountInfoDto.id}