a.id AS "id",
a.start AS "start.id",
a.end AS "end.id",
a.price AS "price",
a.test_data_main AS "testDataMain.id",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.remarks AS "remarks",
a.del_flag AS "delFlag",
start.name AS "start.name",
end.name AS "end.name"
LEFT JOIN test_data_main b ON b.id = a.test_data_main
LEFT JOIN sys_area start ON start.id = a.start
LEFT JOIN sys_area end ON end.id = a.end
INSERT INTO test_data_child2(
start,
end,
price,
test_data_main,
create_by,
create_date,
update_by,
update_date,
remarks,
del_flag
) VALUES (
#{start.id},
#{end.id},
#{price},
#{testDataMain.id},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{remarks},
#{delFlag}
)
UPDATE test_data_child2 SET
start = #{start.id},
end = #{end.id},
price = #{price},
test_data_main = #{testDataMain.id},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
WHERE id = #{id}
DELETE FROM test_data_child2
WHERE id = #{id}
WHERE test_data_main = #{testDataMain.id}
UPDATE test_data_child2 SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id}
WHERE test_data_main = #{testDataMain.id}