feat(printer): 支持上传裁剪参数并更新照片裁剪信息

- 在 AppPrinterController 中新增 crop 参数用于接收裁剪数据
- 修改 PrinterMapper 和 PrinterService 接口及实现,支持保存 crop 字段
- 更新 MemberPrintResp 模型以包含 crop 属性
-优化 Mapper XML 查询语句,统一使用 SELECT p.* 提高可读性
- 数据库更新语句中添加 crop 字段的赋值操作
This commit is contained in:
2025-10-27 16:59:31 +08:00
parent 2a662ae86d
commit f07d808f3d
6 changed files with 17 additions and 20 deletions

View File

@@ -38,23 +38,17 @@
WHERE p.scenic_id = #{scenicId} and p.status = 1
</select>
<select id="listRelation" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
SELECT p.id, p.scenic_id as scenicId, p.member_id as memberId,
p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
p.status, p.create_time as createTime, p.printer_id
SELECT p.*
FROM member_print p
WHERE p.member_id = #{memberId} AND p.scenic_id = #{scenicId} AND p.status = 0
</select>
<select id="getUserPhoto" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
SELECT p.id, p.scenic_id, p.member_id as memberId,
p.member_id, p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
p.status, p.create_time as createTime, p.printer_id
SELECT p.*
FROM member_print p
WHERE p.id = #{id} AND p.member_id = #{memberId} AND p.scenic_id = #{scenicId}
</select>
<select id="getUserPhotoByIds" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
SELECT p.id, p.scenic_id, p.member_id as memberId,
p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
p.status, p.create_time as createTime, p.printer_id
SELECT p.*
FROM member_print p
WHERE p.id IN
<foreach collection="ids" item="id" open="(" separator="," close=")">
@@ -62,9 +56,7 @@
</foreach>
</select>
<select id="listRelationByOrderId" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
SELECT p.id, p.scenic_id as scenicId, p.member_id as memberId,
p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
p.status, p.create_time as createTime, p.printer_id
SELECT p.*
FROM member_print p
WHERE p.id in (select order_item.goods_id from order_item where order_item.order_id = #{orderId} and order_item.goods_type = 3)
</select>
@@ -166,7 +158,7 @@
WHERE id = #{id} AND status = #{expectStatus}
</update>
<update id="setPhotoCropped">
UPDATE member_print SET crop_url = #{url}, update_time = NOW(), print_url = null WHERE id = #{id}
UPDATE member_print SET crop_url = #{url}, crop = #{crop}, update_time = NOW(), print_url = null WHERE id = #{id}
</update>
<update id="setPhotoQuantity">
UPDATE member_print SET quantity = #{quantity}, update_time = NOW() WHERE id = #{id}