球杆商品关联项名称

This commit is contained in:
杨旭 2025-04-14 22:46:40 +08:00
parent 544cb4b3ff
commit 5352019d63
2 changed files with 45 additions and 9 deletions

View File

@ -70,4 +70,19 @@ public class CueProductVO extends BaseVO implements Serializable {
*/
@Schema(description = "状态0-禁用1-启用")
private Integer productStatus;
/**
* 关联的品牌名称
*/
@Schema(description = "关联的品牌名称")
private String brandName;
/**
* 关联的系列名称
*/
@Schema(description = "关联的系列名称")
private String seriesName;
/**
* 关联的球杆类型名称
*/
@Schema(description = "关联的球杆类型名称")
private String typeName;
}

View File

@ -17,6 +17,9 @@
<result property="productStatus" column="product_status"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="brandName" column="brand_name"/>
<result property="seriesName" column="series_name"/>
<result property="typeName" column="type_name"/>
</resultMap>
<sql id="Vo_Column_List">
@ -25,30 +28,48 @@
<select id="list" resultMap="cueProductVOMap">
SELECT
<include refid="Vo_Column_List" />
cp.product_id,
cp.brand_id,
cp.series_id,
cp.type_id,
cp.product_name,
cp.product_description,
cp.product_images,
cp.product_price,
cp.product_seq,
cp.product_status,
cp.deleted,
cp.create_time,
cp.update_time,
cb.brand_name,
cs.series_name,
ct.type_name
FROM
cue_product
cue_product AS cp
LEFT JOIN cue_brand AS cb ON cp.brand_id = cb.brand_id
LEFT JOIN cue_series AS cs ON cp.series_id = cs.series_id
LEFT JOIN cue_type AS ct ON cp.type_id = ct.type_id
<where>
deleted = 0
<if test="dto.productName != null and dto.productName != ''">
AND product_name LIKE CONCAT('%', #{dto.productName}, '%')
AND cp.product_name LIKE CONCAT('%', #{dto.productName}, '%')
</if>
<if test="dto.productStatus != null">
AND product_status = #{dto.productStatus}
AND cp.product_status = #{dto.productStatus}
</if>
<if test="dto.brandId != null">
AND brand_id = #{dto.brandId}
AND cp.brand_id = #{dto.brandId}
</if>
<if test="dto.typeId != null">
AND type_id = #{dto.typeId}
AND cp.type_id = #{dto.typeId}
</if>
<if test="dto.seriesId != null">
AND series_id = #{dto.seriesId}
AND cp.series_id = #{dto.seriesId}
</if>
</where>
ORDER BY
product_seq ASC,
product_id DESC
cp.product_seq ASC,
cp.product_id DESC
</select>
<select id="getById" resultMap="cueProductVOMap">