| | |
| | | pi.`catalogue_id`, |
| | | CONCAT(c.`number`, ' ', c.`mess`) AS catalogue_name, |
| | | pi.`company_id`, |
| | | pi.`item_id`, |
| | | i.item_name, |
| | | sc.`name` as company_name, |
| | | pi.`number`, |
| | | pi.`erdact`, |
| | |
| | | pi.`update_time` |
| | | FROM |
| | | product_item pi |
| | | LEFT JOIN sys_company sc on pi.company_id = sc.id |
| | | left join catalogue c on pi.catalogue_id = c.id |
| | | LEFT JOIN sys_company sc on pi.company_id = sc.id |
| | | left join catalogue c on pi.catalogue_id = c.id |
| | | LEFT JOIN item i ON pi.item_id = i.id |
| | | LEFT JOIN item_user iu ON i.id = iu.item_id |
| | | WHERE |
| | | pi.del_flag = 1 and pi.type = #{type} |
| | | <if test="companyId!=null and companyId!=''"> |
| | | and pi.company_id =#{companyId} |
| | | </if> |
| | | <if test="userId!=null"> |
| | | and iu.user_id = #{userId} |
| | | </if> |
| | | <if test="itemId!=null"> |
| | | and pi.item_id = #{itemId} |
| | | </if> |
| | | <if test="catalogueId!=null and catalogueId!=''"> |
| | | and pi.catalogue_id = #{catalogueId} |
| | | </if> |
| | | GROUP BY |
| | | pi.id |
| | | ORDER BY |
| | | pi.create_time ASC |
| | | </select> |