A.oc_id,
A.grid_id,
A.grid_code,
A.grid_title,
A.grid_level,
A.grid_desc,
A.status,
A.group_id,
B.group_name,
A.position_id,
C.position_name,
A.account_id,
D.account_name,
IFNULL(E.checklist_num, 0) AS checklist_num
INSERT INTO ent_grid
oc_id,
grid_id,
grid_code,
grid_title,
grid_level,
status,
grid_desc,
group_id,
position_id,
account_id,
created_by,
created_at,
#{ocId ,jdbcType=BIGINT},
#{gridId ,jdbcType=BIGINT},
#{gridCode ,jdbcType=VARCHAR},
#{gridTitle ,jdbcType=VARCHAR},
#{gridLevel ,jdbcType=BIGINT},
#{status ,jdbcType=BIGINT},
#{gridDesc ,jdbcType=VARCHAR},
#{groupId ,jdbcType=BIGINT},
#{positionId ,jdbcType=BIGINT},
#{accountId ,jdbcType=BIGINT},
#{createdBy ,jdbcType=BIGINT},
#{createdAt ,jdbcType=TIMESTAMP},
UPDATE ent_grid
grid_title = #{gridTitle, jdbcType=VARCHAR},
grid_level = #{gridLevel ,jdbcType=BIGINT},
grid_desc = #{gridDesc, jdbcType=VARCHAR},
status = #{status ,jdbcType=BIGINT},
group_id = #{groupId ,jdbcType=BIGINT},
position_id = #{positionId ,jdbcType=BIGINT},
account_id = #{accountId ,jdbcType=BIGINT},
updated_by = #{updatedBy ,jdbcType=BIGINT},
updated_at = #{updatedAt ,jdbcType=TIMESTAMP},
layer_id = #{layerId ,jdbcType=BIGINT},
WHERE 1 = 1
AND oc_id = #{ocId ,jdbcType=BIGINT}
AND grid_id = #{gridId ,jdbcType=BIGINT}
UPDATE ent_grid
deleted_flag = #{deletedFlag, jdbcType=BIGINT},
deleted_at = #{deletedAt, jdbcType=TIMESTAMP},
deleted_by = #{deletedBy,jdbcType=BIGINT},
WHERE 1 = 1
AND oc_id = #{ocId ,jdbcType=BIGINT}
AND grid_id = #{gridId ,jdbcType=BIGINT}
AND oc_id = #{ocId ,jdbcType=BIGINT}