|
|
|
@ -6,23 +6,25 @@ |
|
|
|
<select id="pageProductByOperator" |
|
|
|
resultType="com.qniao.dam.api.query.product.user.response.UserPageProductByOperatorVo"> |
|
|
|
select |
|
|
|
dp.id as productId, |
|
|
|
dps.id as productSpecId, |
|
|
|
dp.product_type, |
|
|
|
dp.main_category, |
|
|
|
dp.sub_category, |
|
|
|
dp.product_title, |
|
|
|
dp.product_desc, |
|
|
|
dp.detail_desc, |
|
|
|
dp.`status`, |
|
|
|
dps.unit_original_price, |
|
|
|
dps.unit_selling_price, |
|
|
|
dpst1.unit as productSpecUnit, |
|
|
|
dpst2.`value` as validityPeriodValue |
|
|
|
dp.id as productId, |
|
|
|
dps.id as productSpecId, |
|
|
|
dp.product_type, |
|
|
|
dp.main_category, |
|
|
|
dp.sub_category, |
|
|
|
dp.product_title, |
|
|
|
dp.product_desc, |
|
|
|
dp.detail_desc, |
|
|
|
dp.`status`, |
|
|
|
dps.unit_original_price, |
|
|
|
dps.unit_selling_price, |
|
|
|
dpst1.unit as productSpecUnit, |
|
|
|
dpst2.`value` as validityPeriodValue |
|
|
|
from da_product as dp |
|
|
|
LEFT JOIN da_product_spec as dps on dps.is_delete=0 and dps.product_id=dp.id |
|
|
|
LEFT JOIN da_product_spec_term as dpst1 on dpst1.is_delete=0 and dpst1.product_spec_id =dps.id and dpst1.`name`=1 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and dpst2.`name`=3 |
|
|
|
LEFT JOIN da_product_spec as dps on dps.is_delete=0 and dps.product_id=dp.id |
|
|
|
LEFT JOIN da_product_spec_term as dpst1 on dpst1.is_delete=0 and dpst1.product_spec_id =dps.id and |
|
|
|
dpst1.`name`=1 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and |
|
|
|
dpst2.`name`=3 |
|
|
|
where dp.is_delete=0 |
|
|
|
<if test="queryParam.manageEnable != null"> |
|
|
|
AND dp.manage_enable = #{queryParam.manageEnable} |
|
|
|
@ -62,72 +64,82 @@ |
|
|
|
dpst4.`value` as dailyUseLimitValue |
|
|
|
from da_product as dp |
|
|
|
LEFT JOIN da_product_spec as dps on dps.is_delete=0 and dps.product_id=dp.id |
|
|
|
LEFT JOIN da_product_spec_term as dpst1 on dpst1.is_delete=0 and dpst1.product_spec_id =dps.id and dpst1.`name`=1 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and dpst2.`name`=3 |
|
|
|
LEFT JOIN da_product_spec_term as dpst3 on dpst3.is_delete=0 and dpst3.product_spec_id =dps.id and dpst3.`name`=2 |
|
|
|
LEFT JOIN da_product_spec_term as dpst4 on dpst4.is_delete=0 and dpst4.product_spec_id =dps.id and dpst4.`name`=4 |
|
|
|
LEFT JOIN da_product_spec_term as dpst1 on dpst1.is_delete=0 and dpst1.product_spec_id =dps.id and |
|
|
|
dpst1.`name`=1 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and |
|
|
|
dpst2.`name`=3 |
|
|
|
LEFT JOIN da_product_spec_term as dpst3 on dpst3.is_delete=0 and dpst3.product_spec_id =dps.id and |
|
|
|
dpst3.`name`=2 |
|
|
|
LEFT JOIN da_product_spec_term as dpst4 on dpst4.is_delete=0 and dpst4.product_spec_id =dps.id and |
|
|
|
dpst4.`name`=4 |
|
|
|
where dp.is_delete=0 and dp.`status`=1 and dp.product_type=2 |
|
|
|
<if test="queryParam.subCategory != null"> |
|
|
|
AND dp.sub_category = #{queryParam.subCategory} |
|
|
|
</if> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectProductByCustomerList" resultType="com.qniao.dam.api.query.product.user.response.UserPageProductByCustomerExtendVo"> |
|
|
|
<select id="selectProductByCustomerList" |
|
|
|
resultType="com.qniao.dam.api.query.product.user.response.UserPageProductByCustomerExtendVo"> |
|
|
|
|
|
|
|
SELECT |
|
|
|
1 groupType, |
|
|
|
a.id, |
|
|
|
ap.product_id as productId, |
|
|
|
ap.product_spec_id as productSpecId, |
|
|
|
a.activity_name productName, |
|
|
|
p.main_category, |
|
|
|
p.sub_category, |
|
|
|
p.product_title, |
|
|
|
p.product_desc, |
|
|
|
p.detail_desc, |
|
|
|
ap.activity_unit_original_price unit_original_price, |
|
|
|
ap.activity_unit_selling_price unit_selling_price, |
|
|
|
dpst1.unit as productSpecUnit, |
|
|
|
dpst2.`value` as validityPeriodValue, |
|
|
|
dpst3.`value` as purchaseTimeValue, |
|
|
|
dpst4.`value` as dailyUseLimitValue |
|
|
|
1 groupType, |
|
|
|
a.id, |
|
|
|
ap.product_id as productId, |
|
|
|
ap.product_spec_id as productSpecId, |
|
|
|
a.activity_name productName, |
|
|
|
p.main_category, |
|
|
|
p.sub_category, |
|
|
|
p.product_title, |
|
|
|
p.product_desc, |
|
|
|
p.detail_desc, |
|
|
|
ap.activity_unit_original_price unit_original_price, |
|
|
|
ap.activity_unit_selling_price unit_selling_price, |
|
|
|
dpst1.unit as productSpecUnit, |
|
|
|
dpst2.`value` as validityPeriodValue, |
|
|
|
dpst3.`value` as purchaseTimeValue, |
|
|
|
dpst4.`value` as dailyUseLimitValue |
|
|
|
FROM |
|
|
|
da_activity a |
|
|
|
LEFT JOIN da_activity_product ap ON a.id = ap.activity_id AND ap.is_delete = 0 |
|
|
|
LEFT JOIN da_product p ON ap.product_id = p.id AND p.is_delete = 0 |
|
|
|
LEFT JOIN da_product_spec ps ON ps.id = ap.product_spec_id AND ps.product_id = ap.product_id AND ps.is_delete = 0 |
|
|
|
LEFT JOIN da_product_spec_term as dpst1 on dpst1.is_delete=0 and dpst1.product_spec_id =ps.id and dpst1.`name`=1 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =ps.id and dpst2.`name`=3 |
|
|
|
LEFT JOIN da_product_spec_term as dpst3 on dpst3.is_delete=0 and dpst3.product_spec_id =ps.id and dpst3.`name`=2 |
|
|
|
LEFT JOIN da_product_spec_term as dpst4 on dpst4.is_delete=0 and dpst4.product_spec_id =ps.id and dpst4.`name`=4 |
|
|
|
da_activity a |
|
|
|
LEFT JOIN da_activity_product ap ON a.id = ap.activity_id AND ap.is_delete = 0 |
|
|
|
LEFT JOIN da_product p ON ap.product_id = p.id AND p.is_delete = 0 |
|
|
|
LEFT JOIN da_product_spec ps ON ps.id = ap.product_spec_id AND ps.product_id = ap.product_id AND ps.is_delete = |
|
|
|
0 |
|
|
|
LEFT JOIN da_product_spec_term as dpst1 on dpst1.is_delete=0 and dpst1.product_spec_id =ps.id and dpst1.`name`=1 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =ps.id and dpst2.`name`=3 |
|
|
|
LEFT JOIN da_product_spec_term as dpst3 on dpst3.is_delete=0 and dpst3.product_spec_id =ps.id and dpst3.`name`=2 |
|
|
|
LEFT JOIN da_product_spec_term as dpst4 on dpst4.is_delete=0 and dpst4.product_spec_id =ps.id and dpst4.`name`=4 |
|
|
|
WHERE a.is_delete = 0 AND a.status = 1 AND a.start_time <= NOW() AND a.end_time >= NOW() AND a.display = 0 |
|
|
|
<if test="id != null and id != ''"> |
|
|
|
AND a.id = #{id} |
|
|
|
</if> |
|
|
|
UNION |
|
|
|
select |
|
|
|
0 groupType, |
|
|
|
dp.id, |
|
|
|
dp.id as productId, |
|
|
|
dps.id as productSpecId, |
|
|
|
'' productName, |
|
|
|
dp.main_category, |
|
|
|
dp.sub_category, |
|
|
|
dp.product_title, |
|
|
|
dp.product_desc, |
|
|
|
dp.detail_desc, |
|
|
|
dps.unit_original_price, |
|
|
|
dps.unit_selling_price, |
|
|
|
dpst1.unit as productSpecUnit, |
|
|
|
dpst2.`value` as validityPeriodValue, |
|
|
|
dpst3.`value` as purchaseTimeValue, |
|
|
|
dpst4.`value` as dailyUseLimitValue |
|
|
|
0 groupType, |
|
|
|
dp.id, |
|
|
|
dp.id as productId, |
|
|
|
dps.id as productSpecId, |
|
|
|
'' productName, |
|
|
|
dp.main_category, |
|
|
|
dp.sub_category, |
|
|
|
dp.product_title, |
|
|
|
dp.product_desc, |
|
|
|
dp.detail_desc, |
|
|
|
dps.unit_original_price, |
|
|
|
dps.unit_selling_price, |
|
|
|
dpst1.unit as productSpecUnit, |
|
|
|
dpst2.`value` as validityPeriodValue, |
|
|
|
dpst3.`value` as purchaseTimeValue, |
|
|
|
dpst4.`value` as dailyUseLimitValue |
|
|
|
from da_product as dp |
|
|
|
LEFT JOIN da_product_spec as dps on dps.is_delete=0 and dps.product_id=dp.id |
|
|
|
LEFT JOIN da_product_spec_term as dpst1 on dpst1.is_delete=0 and dpst1.product_spec_id =dps.id and dpst1.`name`=1 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and dpst2.`name`=3 |
|
|
|
LEFT JOIN da_product_spec_term as dpst3 on dpst3.is_delete=0 and dpst3.product_spec_id =dps.id and dpst3.`name`=2 |
|
|
|
LEFT JOIN da_product_spec_term as dpst4 on dpst4.is_delete=0 and dpst4.product_spec_id =dps.id and dpst4.`name`=4 |
|
|
|
LEFT JOIN da_product_spec as dps on dps.is_delete=0 and dps.product_id=dp.id |
|
|
|
LEFT JOIN da_product_spec_term as dpst1 on dpst1.is_delete=0 and dpst1.product_spec_id =dps.id and |
|
|
|
dpst1.`name`=1 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and |
|
|
|
dpst2.`name`=3 |
|
|
|
LEFT JOIN da_product_spec_term as dpst3 on dpst3.is_delete=0 and dpst3.product_spec_id =dps.id and |
|
|
|
dpst3.`name`=2 |
|
|
|
LEFT JOIN da_product_spec_term as dpst4 on dpst4.is_delete=0 and dpst4.product_spec_id =dps.id and |
|
|
|
dpst4.`name`=4 |
|
|
|
where dp.is_delete=0 and dp.`status`=1 and dp.product_type=2 AND dp.display = 0 |
|
|
|
<if test="id != null and id != ''"> |
|
|
|
AND dp.id = #{id} |
|
|
|
@ -149,7 +161,8 @@ |
|
|
|
dpst2.`value` as validityPeriodDays |
|
|
|
from da_product as dp |
|
|
|
LEFT JOIN da_product_spec as dps on dps.is_delete=0 and dps.product_id=dp.id |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and dpst2.`name`=3 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and |
|
|
|
dpst2.`name`=3 |
|
|
|
where dp.is_delete=0 and dp.`status`=1 and dp.product_type=3 |
|
|
|
<if test="queryParam.subCategory != null"> |
|
|
|
AND dp.sub_category = #{queryParam.subCategory} |
|
|
|
@ -172,12 +185,38 @@ |
|
|
|
dpst2.`value` as validityPeriodDays |
|
|
|
from da_product as dp |
|
|
|
LEFT JOIN da_product_spec as dps on dps.is_delete=0 and dps.product_id=dp.id |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and dpst2.`name`=3 |
|
|
|
LEFT JOIN da_product_spec_term as dpst2 on dpst2.is_delete=0 and dpst2.product_spec_id =dps.id and |
|
|
|
dpst2.`name`=3 |
|
|
|
where dp.is_delete=0 and dp.`status`=1 and dp.product_type=4 |
|
|
|
<if test="queryParam.subCategory != null"> |
|
|
|
AND dp.sub_category = #{queryParam.subCategory} |
|
|
|
</if> |
|
|
|
order by dp.sub_category desc |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="listVirtualCurrencyProduct" |
|
|
|
resultType="com.qniao.dam.api.query.product.user.response.UserVirtualCurrencyVo"> |
|
|
|
select |
|
|
|
dp.id as productId, |
|
|
|
dps.id as productSpecId, |
|
|
|
dp.main_category, |
|
|
|
dp.sub_category, |
|
|
|
dp.product_title, |
|
|
|
dp.product_desc, |
|
|
|
dp.detail_desc, |
|
|
|
dps.unit_original_price, |
|
|
|
dps.unit_selling_price, |
|
|
|
dpst3.`value` as purchaseTimeValue |
|
|
|
from da_product as dp |
|
|
|
LEFT JOIN da_product_spec as dps on dps.is_delete=0 and dps.product_id=dp.id |
|
|
|
LEFT JOIN da_product_spec_term as dpst3 on dpst3.is_delete=0 and dpst3.product_spec_id =dps.id and |
|
|
|
dpst3.`name`=2 |
|
|
|
where dp.is_delete=0 and dp.`status`=1 and dp.sub_category=2001 |
|
|
|
<if test="queryParam.operatingSystem != null"> |
|
|
|
AND dp.operating_system = #{queryParam.operatingSystem} |
|
|
|
</if> |
|
|
|
order by dps.unit_original_price asc |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |
|
|
|
|