{
  "properties": {},
  "id": "b649d79d-2507-50c5-b71b-46fdfd231ebc",
  "script": null,
  "groupId": "25a971ba-6a80-5bb8-88f2-a0d53c183824",
  "name": "分页查询",
  "createTime": 1778891835481,
  "updateTime": null,
  "lock": null,
  "createBy": null,
  "updateBy": null,
  "path": "/page",
  "method": "POST",
  "parameters": [],
  "options": [],
  "requestBody": null,
  "headers": [],
  "paths": [],
  "responseBody": null,
  "description": null,
  "requestBodyDefinition": null,
  "responseBodyDefinition": null
}
================================
var assignedTo = body.assigned_to;
var categoryId = body.category_id;
var manufacturerId = body.manufacturer_id;
var supplierId = body.supplier_id;
var keyword = body.keyword;
var sql = """
select l.*,
    mf.name as manufacturer_name,
    c.name as category_name,
    s.name as supplier_name,
    u.nick_name as assigned_user_name
from itam_licenses l
left join itam_manufacturers mf on l.manufacturer_id = mf.id and mf.deleted = 0
left join itam_categories c on l.category_id = c.id and c.deleted = 0
left join itam_suppliers s on l.supplier_id = s.id and s.deleted = 0
left join sys_user u on l.assigned_to = u.id
where l.deleted = 0
<if test="keyword != null and keyword != ''">
    and (l.name like concat('%', #{keyword}, '%') or l.license_key like concat('%', #{keyword}, '%') or l.order_number like concat('%', #{keyword}, '%'))
</if>
<if test="categoryId != null">
    and l.category_id = #{categoryId}
</if>
<if test="manufacturerId != null">
    and l.manufacturer_id = #{manufacturerId}
</if>
<if test="supplierId != null">
    and l.supplier_id = #{supplierId}
</if>
<if test="assignedTo != null">
    and l.assigned_to = #{assignedTo}
</if>
order by l.create_time desc
""";
return db.page(sql);
