a.id AS "id",
a.user_id AS "user.id",
a.office_id AS "office.id",
a.area_id AS "area.id",
a.name AS "name",
a.sex AS "sex",
a.in_date AS "inDate",
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",
u2.name AS "user.name",
o3.name AS "office.name",
a4.name AS "area.name"
LEFT JOIN sys_user u2 ON u2.id = a.user_id
LEFT JOIN sys_office o3 ON o3.id = a.office_id
LEFT JOIN sys_area a4 ON a4.id = a.area_id
INSERT INTO test_data(
id,
user_id,
office_id,
area_id,
name,
sex,
in_date,
create_by,
create_date,
update_by,
update_date,
remarks,
del_flag
) VALUES (
#{id},
#{user.id},
#{office.id},
#{area.id},
#{name},
#{sex},
#{inDate},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{remarks},
#{delFlag}
)
UPDATE test_data SET
user_id = #{user.id},
office_id = #{office.id},
area_id = #{area.id},
name = #{name},
sex = #{sex},
in_date = #{inDate},
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks}
WHERE id = #{id}
UPDATE test_data SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id}