SELECT CONCAT(#{agentId}, '-', 'ZH', LPAD(COUNT(1) + 1, 4, '0'))
FROM tb_displace_audit
WHERE agent_id = #{agentId}
INSERT INTO tb_displace_audit(id, agent_id, agent_name, displace_id, idea_price, pub_time, audit_time, journalist_name, journalist_tel, audit_status, state, sale_id, others_desc, first_pic_url,is_good,storage)
VALUES(#{id}, #{agentId}, #{agentName}, #{displaceId}, #{ideaPrice}, #{pubTime}, #{auditTime}, #{joumalistName}, #{joumalistTel}, #{auditStatus}, #{state}, #{saleId}, #{othersDesc}, #{firstPicUrl}, #{is_good}, #{storage})
UPDATE tb_displace_audit
SET agent_id = #{agentId},
agent_name = #{agentName},
idea_price = #{ideaPrice},
journalist_name = #{joumalistName},
journalist_tel = #{joumalistTel},
audit_status = #{auditStatus},
state = #{state},
sale_id = #{saleId},
storage = #{storage},
is_good = #{is_good},
first_pic_url = #{firstPicUrl}
WHERE id = #{id}
UPDATE tb_displace_audit SET end_time = #{endTime} WHERE id = #{id}