-- 个人卡已绑卡数据	
	SELECT 
		lg.createTime 卡生成时间,
		lg.serialNumber 卡序号,
		lg.bindDate 绑卡时间,
		lc.wxMpOpenid 客户微信,
		lc.nick 客户昵称,
		lc.mobile 客户手机号,
		lcb.name 支行名称,
		lgs.name 商品名称,
		lgg.goodsNumber 商品数量
	FROM lpk_giftcard lg 
	LEFT JOIN lpk_customer lc ON lc.sid = lg.customerSid	
	LEFT JOIN lpk_customer_bank lcb ON lcb.sid = lc.customerBankSid
		LEFT JOIN lpk_giftbag_goods lgg ON lgg.giftbagSid=lg.giftbagSid 	
		LEFT JOIN lpk_goods lgs ON lgs.sid = lgg.goodsSid  	
	WHERE lg.customerSid IS NOT NULL AND lg.customerSid <> ''
	ORDER BY lg.serialNumber
	
-- 个人卡未绑卡数据
	SELECT 
		lg.createTime 卡生成时间,
		lg.serialNumber 卡序号,
		lgs.name 商品名称,
		lgg.goodsNumber 商品数量
	FROM lpk_giftcard lg 
		LEFT JOIN lpk_giftbag_goods lgg ON lgg.giftbagSid=lg.giftbagSid 	
		LEFT JOIN lpk_goods lgs ON lgs.sid = lgg.goodsSid  	
	WHERE (lg.customerSid IS NULL OR lg.customerSid = '') 
	ORDER BY lg.serialNumber



-- 企业卡已绑卡数据
	SELECT 
		ec.createTime 卡生成时间,
		ec.serialNumber 卡序号,
		ec.bindDate 绑卡时间,
		lc.wxMpOpenid 客户微信,
		lc.nick 客户昵称,
		lc.mobile 客户手机号,
		lcb.name 支行名称,
		lgs.name 商品名称,
		lgg.goodsNumber 商品数量
	FROM emp_card ec 
	LEFT JOIN lpk_customer lc ON lc.sid = ec.customerSid	
	LEFT JOIN lpk_customer_bank lcb ON lcb.sid = lc.customerBankSid
		LEFT JOIN lpk_giftbag_goods lgg ON lgg.giftbagSid=ec.giftbagSid 	
		LEFT JOIN lpk_goods lgs ON lgs.sid = lgg.goodsSid  	
	WHERE (ec.customerSid IS NOT NULL AND ec.customerSid <> '') 
	ORDER BY ec.serialNumber
	
-- 企业卡未绑卡数据
	SELECT 
		ec.createTime 卡生成时间,
		ec.serialNumber 卡序号,
		lgs.name 商品名称,
		lgg.goodsNumber 商品数量
	FROM emp_card ec 
		LEFT JOIN lpk_giftbag_goods lgg ON lgg.giftbagSid=ec.giftbagSid 	
		LEFT JOIN lpk_goods lgs ON lgs.sid = lgg.goodsSid  	
	WHERE (ec.customerSid IS NULL OR ec.customerSid = '') 
	ORDER BY ec.serialNumber