APlusProductMapper.xml 2.28 KB
Newer Older
1 2 3 4
<?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="cn.kk.spring_simple_operation.mapper.APlusProductMapper">

kk committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
	<select id="getSuperiorSkuList" resultType="string">
		SELECT relative_sku sku   from sync_product_audit where sku in
		<foreach item="sku" collection="list" open="(" separator="," close=")">
			#{sku}
		</foreach>
		and relative_sku != '' and product_type != 2
		UNION
		select comb_parent_sku sku from sync_product_audit where sku in
		<foreach item="sku" collection="list" open="(" separator="," close=")">
			#{sku}
		</foreach>
		and comb_parent_sku != '' and product_type = 2
	</select>
	<select id="getRelatedProduct" resultType="String">
		(SELECT sku from sync_product_audit where sku in
		<foreach item="sku" collection="list" open="(" separator="," close=")">
			#{sku}
		</foreach>
		)
		UNION
		(SELECT sku from sync_product_audit where relative_sku in
		<foreach item="sku" collection="list" open="(" separator="," close=")">
			#{sku}
		</foreach>
		)
		UNION
		(SELECT sku from sync_product_audit where eu_product_sku in
		<foreach item="sku" collection="list" open="(" separator="," close=")">
			#{sku}
		</foreach>
		)
		UNION
		(SELECT sku from sync_product_audit where comb_parent_sku in
		<foreach item="sku" collection="list" open="(" separator="," close=")">
			#{sku}
		</foreach>
		)
		UNION
		(SELECT sku from sync_product_publish where is_delete = 0 and  raw_sku in
		<foreach item="sku" collection="list" open="(" separator="," close=")">
			#{sku}
		</foreach>
		)
	</select>
	<select id="getPublishInfoByIds" resultType="cn.kk.spring_simple_operation.model.vo.PublishInfoVo">
		SELECT
			soos.account_nick_name account,
			app.sku,
			app.site,
			soos.account_manager manager,
			app.is_upload_backstage,
			if(app.a_plus_publish_plat_status = 1, '已发布', '未发布') status
		FROM
			a_plus_product app
				LEFT JOIN sync_product_publish_category sppc ON sppc.sku = app.sku
				AND sppc.site = app.site
				LEFT JOIN sync_other_operate_staff soos ON soos.account_nick_name = sppc.account
		WHERE
			app.id IN
			<foreach item="id" collection="idList" open="(" separator="," close=")">
				#{id}
			</foreach>
		group by app.id
		order by app.sku
	</select>
70
</mapper>