INSERT INTO mall_category (parent_id, name, code, sort_order, active)
VALUES (#{parentId}, #{name}, #{code}, COALESCE(#{sortOrder},0), COALESCE(#{active},TRUE))
UPDATE mall_category SET parent_id=#{parentId}, name=#{name}, code=#{code},
sort_order=COALESCE(#{sortOrder},sort_order), active=COALESCE(#{active},active) WHERE id=#{id}
DELETE FROM mall_category WHERE id=#{id}