63 lines
2.2 KiB
XML
63 lines
2.2 KiB
XML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
<mapper namespace="com.hcy.common.mapper.category.GoodsCategoryMapper">
|
||
|
<!-- 通用查询映射结果 -->
|
||
|
<resultMap id="BaseResultMap" type="com.hcy.common.entity.category.GoodsCategory">
|
||
|
<!-- <id column="id" property="id"/>
|
||
|
<result column="create_id" property="createId"/>
|
||
|
<result column="create_time" property="createTime"/>
|
||
|
<result column="update_id" property="updateId"/>
|
||
|
<result column="update_time" property="updateTime"/>
|
||
|
<result column="company_id" property="companyId"/>
|
||
|
<result column="account_id" property="accountId"/>
|
||
|
<result column="account_chart_id" property="accountChartId"/>
|
||
|
<result column="is_add_next_level" property="isAddNextLevel"/>
|
||
|
<result column="is_reallocate" property="isReallocate"/>
|
||
|
<result column="tenant_id" property="tenantId"/>-->
|
||
|
</resultMap>
|
||
|
|
||
|
<select id="listByIds" resultType="com.hcy.common.entity.category.GoodsCategory">
|
||
|
select id,
|
||
|
name,
|
||
|
pid,
|
||
|
level,
|
||
|
image,
|
||
|
sort,
|
||
|
is_show as isShow,
|
||
|
is_recommend as isRecommed,
|
||
|
create_time as createTime,
|
||
|
update_time as updateTime,
|
||
|
delete_time as deleteTime,
|
||
|
is_delete as isDelete
|
||
|
from la_goods_category
|
||
|
<where>
|
||
|
<if test="ids != null and ids.size() != 0">
|
||
|
id in
|
||
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
||
|
#{id}
|
||
|
</foreach>
|
||
|
</if>
|
||
|
</where>
|
||
|
</select>
|
||
|
|
||
|
<select id="getCouponCorrelationGoodsCategory" resultType="com.hcy.common.entity.category.GoodsCategory">
|
||
|
SELECT
|
||
|
*
|
||
|
FROM
|
||
|
la_goods_category
|
||
|
WHERE
|
||
|
is_delete = 0
|
||
|
AND is_show = 1
|
||
|
AND id IN (
|
||
|
SELECT
|
||
|
goods_cat_id
|
||
|
FROM
|
||
|
la_goods_category_coupon
|
||
|
WHERE
|
||
|
is_delete = 0
|
||
|
AND coupon_id = #{couponId})
|
||
|
</select>
|
||
|
|
||
|
|
||
|
</mapper>
|