更新系统
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.HyBasketMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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="org.dromara.mall.mapper.HyCodeOrderMapper">
|
||||
|
||||
<select id="promoterCountMonth" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.promoter_id as userId,c.`name` as userName,sum(o.num) as count FROM hy_code_order as o
|
||||
LEFT JOIN hy_promoter as c ON c.id = o.promoter_id
|
||||
WHERE o.del_flag = 1 AND o.`order_status` != 3 AND o.`type` = 2
|
||||
<if test="startDay != null and endDay != null">
|
||||
AND o.create_time BETWEEN #{startDay} and #{endDay}
|
||||
</if>
|
||||
GROUP BY o.promoter_id
|
||||
ORDER BY count DESC
|
||||
</select>
|
||||
|
||||
<select id="promoterSumMonth" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.promoter_id as userId,c.`name` as userName,sum(o.order_amount) as sum FROM hy_code_order as o
|
||||
LEFT JOIN hy_promoter as c ON c.id = o.promoter_id
|
||||
WHERE o.del_flag = 1 AND o.`order_status` != 3 AND o.`type` = 2
|
||||
<if test="startDay != null and endDay != null">
|
||||
AND o.create_time BETWEEN #{startDay} and #{endDay}
|
||||
</if>
|
||||
GROUP BY o.promoter_id
|
||||
ORDER BY sum DESC
|
||||
</select>
|
||||
|
||||
<select id="monthPerCodePer" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT
|
||||
`type`,
|
||||
max( `sum` ) AS `sum`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
sum(order_amount) AS `sum`,
|
||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) AS `type`
|
||||
FROM
|
||||
`hy_code_order` a
|
||||
WHERE
|
||||
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT(#{month}, '%Y%m' )
|
||||
AND del_flag = 1 AND `order_status` != 3 AND `type` = 2
|
||||
GROUP BY
|
||||
`type` UNION ALL
|
||||
SELECT
|
||||
0 AS `copunt`,
|
||||
@cdate := date_add( @cdate, INTERVAL - 1 DAY ) `type`
|
||||
FROM
|
||||
( SELECT @cdate := date_add( last_day(#{month}), INTERVAL + 1 DAY ) FROM `hy_code_order` ) t1
|
||||
WHERE
|
||||
@cdate > (
|
||||
date_add(#{month}, INTERVAL - DAY (#{month})+ 1 DAY ))
|
||||
) _tmpAllTable
|
||||
GROUP BY `type`
|
||||
ORDER BY `type`
|
||||
</select>
|
||||
|
||||
|
||||
<select id="yearPerCodePer" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
WITH RECURSIVE DateSeries AS (
|
||||
SELECT STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d') AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(click_date, INTERVAL 1 MONTH)
|
||||
FROM DateSeries
|
||||
WHERE click_date < DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
)
|
||||
SELECT
|
||||
CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) AS `type`,
|
||||
IFNULL(b.`sum`, 0) AS `sum`
|
||||
FROM
|
||||
DateSeries ds
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
sum(order_amount) AS `sum`,
|
||||
CONCAT(YEAR(create_time), '-', LPAD(MONTH(create_time), 2, '0')) AS mon
|
||||
FROM
|
||||
`hy_code_order`
|
||||
WHERE
|
||||
del_flag = 1 AND `order_status` != 3 AND `type` = 2
|
||||
AND create_time BETWEEN STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d')
|
||||
AND DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
GROUP BY
|
||||
mon
|
||||
) b ON CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) = b.mon
|
||||
ORDER BY
|
||||
ds.click_date;
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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="org.dromara.mall.mapper.HyCouponRecordMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,66 @@
|
||||
<?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="org.dromara.mall.mapper.HyMemberCodeMapper">
|
||||
|
||||
<select id="monthPerCode" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT
|
||||
`type`,
|
||||
max( `count` ) AS `num`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
count(1) AS `count`,
|
||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) AS `type`
|
||||
FROM
|
||||
`hy_member_code` a
|
||||
WHERE
|
||||
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT(#{month}, '%Y%m' )
|
||||
AND `status` in (0,1)
|
||||
GROUP BY
|
||||
`type` UNION ALL
|
||||
SELECT
|
||||
0 AS `copunt`,
|
||||
@cdate := date_add( @cdate, INTERVAL - 1 DAY ) `type`
|
||||
FROM
|
||||
( SELECT @cdate := date_add( last_day(#{month}), INTERVAL + 1 DAY ) FROM `hy_member_code` ) t1
|
||||
WHERE
|
||||
@cdate > (
|
||||
date_add(#{month}, INTERVAL - DAY (#{month})+ 1 DAY ))
|
||||
) _tmpAllTable
|
||||
GROUP BY `type`
|
||||
ORDER BY `type`
|
||||
</select>
|
||||
|
||||
<select id="yearPerCode" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
WITH RECURSIVE DateSeries AS (
|
||||
SELECT STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d') AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(click_date, INTERVAL 1 MONTH)
|
||||
FROM DateSeries
|
||||
WHERE click_date < DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
)
|
||||
SELECT
|
||||
CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) AS `type`,
|
||||
IFNULL(b.`sum`, 0) AS `sum`
|
||||
FROM
|
||||
DateSeries ds
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
COUNT(1) AS `sum`,
|
||||
CONCAT(YEAR(create_time), '-', LPAD(MONTH(create_time), 2, '0')) AS mon
|
||||
FROM
|
||||
`hy_member_code`
|
||||
WHERE
|
||||
`del_flag` = 1
|
||||
AND create_time BETWEEN STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d')
|
||||
AND DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
GROUP BY
|
||||
mon
|
||||
) b ON CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) = b.mon
|
||||
ORDER BY
|
||||
ds.click_date;
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,188 @@
|
||||
<?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="org.dromara.mall.mapper.HyOrderItemMapper">
|
||||
<select id="xcxUserCountMonth" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.user_id as userId,c.`real_name` as userName,count(1) as count FROM hy_order_item as o
|
||||
LEFT JOIN tz_user as c ON c.user_id = o.user_id
|
||||
WHERE o.del_flag = 1 AND o.`pay_state` != 1
|
||||
<if test="startDay != null and endDay != null">
|
||||
AND o.create_time BETWEEN #{startDay} and #{endDay}
|
||||
</if>
|
||||
GROUP BY o.user_id
|
||||
ORDER BY count DESC
|
||||
</select>
|
||||
|
||||
<select id="xcxUserSumMonth" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.user_id as userId,c.`real_name` as userName,sum(o.total) as sum FROM hy_order_item as o
|
||||
LEFT JOIN tz_user as c ON c.user_id = o.user_id
|
||||
WHERE o.del_flag = 1 AND o.`pay_state` != 1
|
||||
<if test="startDay != null and endDay != null">
|
||||
AND o.create_time BETWEEN #{startDay} and #{endDay}
|
||||
</if>
|
||||
GROUP BY o.user_id
|
||||
ORDER BY sum DESC
|
||||
</select>
|
||||
|
||||
<select id="factorySalesVolumeCount" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.tenant_id as userId,c.`company_name` as userName,count(1) as count FROM hy_order_item as o
|
||||
LEFT JOIN sys_tenant as c ON c.tenant_id = o.tenant_id
|
||||
WHERE o.del_flag = 1 AND o.`pay_state` != 1
|
||||
<if test="startDay != null and endDay != null">
|
||||
AND o.create_time BETWEEN #{startDay} and #{endDay}
|
||||
</if>
|
||||
<if test="tenantId != null and tenantId != '000000'">
|
||||
AND o.tenant_id = #{tenantId}
|
||||
</if>
|
||||
GROUP BY o.tenant_id
|
||||
ORDER BY count DESC
|
||||
</select>
|
||||
|
||||
<select id="factorySalesVolumeSum" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.tenant_id as userId,c.`company_name` as userName,sum(o.actual_total) as sum FROM hy_order_item as o
|
||||
LEFT JOIN sys_tenant as c ON c.tenant_id = o.tenant_id
|
||||
WHERE o.del_flag = 1 AND o.`pay_state` != 1
|
||||
<if test="startDay != null and endDay != null">
|
||||
AND o.create_time BETWEEN #{startDay} and #{endDay}
|
||||
</if>
|
||||
<if test="tenantId != null and tenantId != '000000'">
|
||||
AND o.tenant_id = #{tenantId}
|
||||
</if>
|
||||
GROUP BY o.tenant_id
|
||||
ORDER BY sum DESC
|
||||
</select>
|
||||
|
||||
<select id="monthPer" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT
|
||||
`type`,
|
||||
max( `sum` ) AS `sum`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
sum(total) AS `sum`,
|
||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) AS `type`
|
||||
FROM
|
||||
`hy_order_item` a
|
||||
WHERE
|
||||
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT(#{month}, '%Y%m' )
|
||||
AND del_flag = 1 AND `pay_state` != 1
|
||||
<if test="tenantId != null and tenantId != '000000'">
|
||||
AND tenant_id = #{tenantId}
|
||||
</if>
|
||||
GROUP BY
|
||||
`type` UNION ALL
|
||||
SELECT
|
||||
0 AS `copunt`,
|
||||
@cdate := date_add( @cdate, INTERVAL - 1 DAY ) `type`
|
||||
FROM
|
||||
( SELECT @cdate := date_add( last_day(#{month}), INTERVAL + 1 DAY ) FROM `hy_order_item` ) t1
|
||||
WHERE
|
||||
@cdate > (
|
||||
date_add(#{month}, INTERVAL - DAY (#{month})+ 1 DAY ))
|
||||
) _tmpAllTable
|
||||
GROUP BY `type`
|
||||
ORDER BY `type`
|
||||
</select>
|
||||
|
||||
|
||||
<select id="yearPer" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
WITH RECURSIVE DateSeries AS (
|
||||
SELECT STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d') AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(click_date, INTERVAL 1 MONTH)
|
||||
FROM DateSeries
|
||||
WHERE click_date < DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
)
|
||||
SELECT
|
||||
CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) AS `type`,
|
||||
IFNULL(b.`sum`, 0) AS `sum`
|
||||
FROM
|
||||
DateSeries ds
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
sum(total) AS `sum`,
|
||||
CONCAT(YEAR(create_time), '-', LPAD(MONTH(create_time), 2, '0')) AS mon
|
||||
FROM
|
||||
`hy_order_item`
|
||||
WHERE
|
||||
del_flag = 1 AND `pay_state` != 1
|
||||
AND create_time BETWEEN STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d')
|
||||
AND DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
<if test="tenantId != null and tenantId != '000000'">
|
||||
AND tenant_id = #{tenantId}
|
||||
</if>
|
||||
GROUP BY
|
||||
mon
|
||||
) b ON CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) = b.mon
|
||||
ORDER BY
|
||||
ds.click_date;
|
||||
</select>
|
||||
|
||||
|
||||
<select id="monthPerByZh" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT
|
||||
`type`,
|
||||
max( `sum` ) AS `sum`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
sum(actual_total) AS `sum`,
|
||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) AS `type`
|
||||
FROM
|
||||
`hy_order_item` a
|
||||
WHERE
|
||||
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT(#{month}, '%Y%m' )
|
||||
AND del_flag = 1 AND `pay_state` != 1
|
||||
<if test="tenantId != null and tenantId != '000000'">
|
||||
AND tenant_id = #{tenantId}
|
||||
</if>
|
||||
GROUP BY
|
||||
`type` UNION ALL
|
||||
SELECT
|
||||
0 AS `copunt`,
|
||||
@cdate := date_add( @cdate, INTERVAL - 1 DAY ) `type`
|
||||
FROM
|
||||
( SELECT @cdate := date_add( last_day(#{month}), INTERVAL + 1 DAY ) FROM `hy_order_item` ) t1
|
||||
WHERE
|
||||
@cdate > (
|
||||
date_add(#{month}, INTERVAL - DAY (#{month})+ 1 DAY ))
|
||||
) _tmpAllTable
|
||||
GROUP BY `type`
|
||||
ORDER BY `type`
|
||||
</select>
|
||||
|
||||
<select id="yearPerByZh" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
WITH RECURSIVE DateSeries AS (
|
||||
SELECT STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d') AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(click_date, INTERVAL 1 MONTH)
|
||||
FROM DateSeries
|
||||
WHERE click_date < DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
)
|
||||
SELECT
|
||||
CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) AS `type`,
|
||||
IFNULL(b.`sum`, 0) AS `sum`
|
||||
FROM
|
||||
DateSeries ds
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
sum(actual_total) AS `sum`,
|
||||
CONCAT(YEAR(create_time), '-', LPAD(MONTH(create_time), 2, '0')) AS mon
|
||||
FROM
|
||||
`hy_order_item`
|
||||
WHERE
|
||||
del_flag = 1 AND `pay_state` != 1
|
||||
AND create_time BETWEEN STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d')
|
||||
AND DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
<if test="tenantId != null and tenantId != '000000'">
|
||||
AND tenant_id = #{tenantId}
|
||||
</if>
|
||||
GROUP BY
|
||||
mon
|
||||
) b ON CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) = b.mon
|
||||
ORDER BY
|
||||
ds.click_date;
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.HyOrderMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.HyOrderPaymentMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.HyPromoterMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.HyPromoterRecordMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.HyUserRecordMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzAgreementMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzAreaMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzAttachFileMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzBankCardMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzBasketMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzBrandMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzCategoryBrandMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzCategoryMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzCategoryPropMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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="org.dromara.mall.mapper.TzCustomerMapper">
|
||||
|
||||
<select id="monthPerCustomer" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT date as `type`, MAX(checkin_count) AS num
|
||||
FROM (
|
||||
SELECT DATE_FORMAT(create_time, '%Y-%m-%d') AS date, COUNT(1) AS checkin_count
|
||||
FROM tz_customer
|
||||
WHERE create_time BETWEEN #{startDay} AND #{endDay} AND del_flag = 0
|
||||
GROUP BY create_time
|
||||
UNION ALL
|
||||
SELECT date AS date, 0 AS checkin_count
|
||||
FROM (
|
||||
SELECT @cdate := date_add(@cdate,interval - 1 day) AS date
|
||||
FROM (SELECT @cdate := date_add(last_day(curdate()),interval + 1 day) FROM tz_customer) t1
|
||||
WHERE @cdate > (date_add(curdate(),interval -day(curdate())+1 day))
|
||||
) t2
|
||||
WHERE date BETWEEN #{startDay} AND #{endDay}
|
||||
) t3
|
||||
GROUP BY date
|
||||
ORDER BY date
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzCustomerRecordMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzDeliveryMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzHotSearchMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzIndexImgMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzInvoiceApplyMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzInvoiceTitleMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzMessageMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzNoticeMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzOrderAllMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzOrderItemMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,168 @@
|
||||
<?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="org.dromara.mall.mapper.TzOrderMapper">
|
||||
|
||||
<select id="monthPer" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT
|
||||
`type`,
|
||||
max( `sum` ) AS `sum`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
sum(total) AS `sum`,
|
||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) AS `type`
|
||||
FROM
|
||||
`tz_order` a
|
||||
WHERE
|
||||
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT(#{month}, '%Y%m' )
|
||||
AND delete_status = 0 AND `status` != 7
|
||||
GROUP BY
|
||||
`type` UNION ALL
|
||||
SELECT
|
||||
0 AS `copunt`,
|
||||
@cdate := date_add( @cdate, INTERVAL - 1 DAY ) `type`
|
||||
FROM
|
||||
( SELECT @cdate := date_add( last_day(#{month}), INTERVAL + 1 DAY ) FROM `tz_order` ) t1
|
||||
WHERE
|
||||
@cdate > (
|
||||
date_add(#{month}, INTERVAL - DAY (#{month})+ 1 DAY ))
|
||||
) _tmpAllTable
|
||||
GROUP BY `type`
|
||||
ORDER BY `type`
|
||||
</select>
|
||||
|
||||
|
||||
<select id="monthArrivedPer" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT
|
||||
`type`,
|
||||
max( `sum` ) AS `sum`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
sum(pay_price) AS `sum`,
|
||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) AS `type`
|
||||
FROM
|
||||
`tz_order` a
|
||||
WHERE
|
||||
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT(#{month}, '%Y%m' )
|
||||
AND delete_status = 0 AND `status` != 7
|
||||
GROUP BY
|
||||
`type` UNION ALL
|
||||
SELECT
|
||||
0 AS `copunt`,
|
||||
@cdate := date_add( @cdate, INTERVAL - 1 DAY ) `type`
|
||||
FROM
|
||||
( SELECT @cdate := date_add( last_day(#{month}), INTERVAL + 1 DAY ) FROM `tz_order` ) t1
|
||||
WHERE
|
||||
@cdate > (
|
||||
date_add(#{month}, INTERVAL - DAY (#{month})+ 1 DAY ))
|
||||
) _tmpAllTable
|
||||
GROUP BY `type`
|
||||
ORDER BY `type`
|
||||
</select>
|
||||
|
||||
|
||||
<select id="yearPer" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT CONCAT(
|
||||
YEAR(click_date),
|
||||
'-',
|
||||
MONTH(click_date)) AS `type`,
|
||||
IFNULL(b.`sum`, 0) AS `sum`
|
||||
FROM (SELECT STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d') AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 1
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 2
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 3
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 4
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 5
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 6
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 7
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 8
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 9
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 10
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 11
|
||||
MONTH) AS click_date) a
|
||||
LEFT JOIN (SELECT sum(total) AS `sum`, CONCAT(YEAR(#{year}), '-', MONTH(#{year})) AS mon
|
||||
FROM `tz_order` where delete_status = 0 AND `status` != 7 AND create_time BETWEEN STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d')
|
||||
AND DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 31), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
GROUP BY mon) b ON CONCAT(YEAR(click_date),'-',MONTH(click_date)) = b.mon
|
||||
</select>
|
||||
|
||||
|
||||
<select id="yearArrivedPer" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT CONCAT(
|
||||
YEAR(click_date),
|
||||
'-',
|
||||
MONTH(click_date)) AS `type`,
|
||||
IFNULL(b.`sum`, 0) AS `sum`
|
||||
FROM (SELECT STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d') AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 1
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 2
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 3
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 4
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 5
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 6
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 7
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 8
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 9
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 10
|
||||
MONTH) AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d'), INTERVAL 11
|
||||
MONTH) AS click_date) a
|
||||
LEFT JOIN (SELECT sum(pay_price) AS `sum`, CONCAT(YEAR(#{year}), '-', MONTH(#{year})) AS mon
|
||||
FROM `tz_order` where delete_status = 0 AND `status` != 7 AND create_time BETWEEN STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 1), '%Y-%m-%d')
|
||||
AND DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', 1, '-', 31), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
GROUP BY mon) b ON CONCAT(YEAR(click_date),'-',MONTH(click_date)) = b.mon
|
||||
</select>
|
||||
|
||||
<select id="rankOrderAmount" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.user_id as userId,c.`name` as userName,sum(o.total) as sum FROM tz_order as o
|
||||
LEFT JOIN tz_customer as c ON c.id = o.user_id
|
||||
WHERE o.create_time BETWEEN #{startDay} and #{endDay} AND o.delete_status = 0 AND o.`status` != 7
|
||||
GROUP BY o.user_id
|
||||
ORDER BY sum DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzOrderReceiveMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzOrderRecordMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzOrderRefundMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzOrderSettlementMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzOrderShareMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzPickAddrMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzPictureAlbumMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdBrowseMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdCommMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdFavoriteMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,189 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdMapper">
|
||||
|
||||
<sql id="prodAndShopNameWithNoContent_SQL">
|
||||
p.prod_id,
|
||||
p.pic,
|
||||
p.prod_name,
|
||||
p.price,
|
||||
p.guiding_price,
|
||||
p.brief,
|
||||
p.video,
|
||||
p.factory_address,
|
||||
p.browse_num,
|
||||
p.collect_num,
|
||||
p.packing_rate,
|
||||
p.unit,
|
||||
p.is_floor,
|
||||
p.label
|
||||
</sql>
|
||||
|
||||
<select id="pageByCategoryId" resultType="org.dromara.mall.domain.vo.TzProdVo">
|
||||
select tp.*,tc.category_name from tz_prod tp
|
||||
left join tz_category tc on tp.category_id = tc.category_id
|
||||
where tp.status = 1
|
||||
<if test="categoryId != null">
|
||||
AND tp.category_id = #{categoryId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="pageByPutAwayTime" resultType="org.dromara.mall.domain.vo.TzProdVo">
|
||||
SELECT
|
||||
<include refid="prodAndShopNameWithNoContent_SQL"/>
|
||||
FROM tz_prod as p
|
||||
WHERE p.`status` = 1
|
||||
ORDER BY putaway_time DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="randomProdPage" resultType="org.dromara.mall.domain.vo.TzProdVo">
|
||||
SELECT
|
||||
<include refid="prodAndShopNameWithNoContent_SQL"/>
|
||||
FROM tz_prod as p
|
||||
WHERE p.`status` = 1
|
||||
ORDER BY RAND()
|
||||
</select>
|
||||
|
||||
|
||||
<select id="hotProdPage" resultType="org.dromara.mall.domain.vo.TzProdVo">
|
||||
SELECT
|
||||
<include refid="prodAndShopNameWithNoContent_SQL"/>
|
||||
FROM tz_prod as p
|
||||
WHERE p.`status` = 1
|
||||
ORDER BY collect_num DESC,browse_num DESC
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getSearchProdPageByProdName" resultType="org.dromara.mall.domain.vo.TzProdVo">
|
||||
select
|
||||
p.*
|
||||
from
|
||||
tz_prod p
|
||||
where
|
||||
p.`status` = 1
|
||||
<if test="categoryId != 0">
|
||||
and p.category_id = #{categoryId}
|
||||
</if>
|
||||
<if test="floor == 1">
|
||||
and p.is_floor = 1
|
||||
</if>
|
||||
<if test="prodName != null and prodName != ''">
|
||||
and p.prod_name like concat('%',#{prodName} ,'%')
|
||||
or
|
||||
p.prod_code like concat('%',#{prodName} ,'%')
|
||||
</if>
|
||||
|
||||
<if test="sort == 0">
|
||||
ORDER BY RAND()
|
||||
</if>
|
||||
<if test="sort == 1">
|
||||
ORDER BY p.price
|
||||
</if>
|
||||
<if test="sort == 2">
|
||||
ORDER BY p.browse_num desc
|
||||
</if>
|
||||
<if test="sort == 3">
|
||||
ORDER BY p.update_time desc
|
||||
</if>
|
||||
<if test="orderBy == 0">
|
||||
asc
|
||||
</if>
|
||||
<if test="orderBy == 1">
|
||||
desc
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="monthPerProd" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
SELECT
|
||||
`type`,
|
||||
max( `count` ) AS `num`
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
count(1) AS `count`,
|
||||
DATE_FORMAT( create_time, '%Y-%m-%d' ) AS `type`
|
||||
FROM
|
||||
`tz_prod` a
|
||||
WHERE
|
||||
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT(#{month}, '%Y%m' )
|
||||
AND `status` in (0,1)
|
||||
GROUP BY
|
||||
`type` UNION ALL
|
||||
SELECT
|
||||
0 AS `copunt`,
|
||||
@cdate := date_add( @cdate, INTERVAL - 1 DAY ) `type`
|
||||
FROM
|
||||
( SELECT @cdate := date_add( last_day(#{month}), INTERVAL + 1 DAY ) FROM `tz_prod` ) t1
|
||||
WHERE
|
||||
@cdate > (
|
||||
date_add(#{month}, INTERVAL - DAY (#{month})+ 1 DAY ))
|
||||
) _tmpAllTable
|
||||
GROUP BY `type`
|
||||
ORDER BY `type`
|
||||
</select>
|
||||
|
||||
|
||||
<select id="yearPerProd" resultType="org.dromara.mall.domain.vo.PerSumVo">
|
||||
WITH RECURSIVE DateSeries AS (
|
||||
SELECT STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d') AS click_date
|
||||
UNION ALL
|
||||
SELECT DATE_ADD(click_date, INTERVAL 1 MONTH)
|
||||
FROM DateSeries
|
||||
WHERE click_date < DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
)
|
||||
SELECT
|
||||
CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) AS `type`,
|
||||
IFNULL(b.`sum`, 0) AS `sum`
|
||||
FROM
|
||||
DateSeries ds
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
COUNT(1) AS `sum`,
|
||||
CONCAT(YEAR(create_time), '-', LPAD(MONTH(create_time), 2, '0')) AS mon
|
||||
FROM
|
||||
`tz_prod`
|
||||
WHERE
|
||||
`status` = 1
|
||||
AND create_time BETWEEN STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d')
|
||||
AND DATE_ADD(STR_TO_DATE(CONCAT(YEAR(#{year}), '-', '01', '-', '01'), '%Y-%m-%d'), INTERVAL 11 MONTH)
|
||||
GROUP BY
|
||||
mon
|
||||
) b ON CONCAT(YEAR(ds.click_date), '-', LPAD(MONTH(ds.click_date), 2, '0')) = b.mon
|
||||
ORDER BY
|
||||
ds.click_date;
|
||||
</select>
|
||||
|
||||
|
||||
<select id="prodSalesVolumeCount" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.prod_id as prodId,o.prod_code as prodCode,o.prod_name as prodName,count(1) as count FROM hy_order_item as o
|
||||
WHERE o.create_time BETWEEN #{startDay} and #{endDay} AND o.del_flag = 1 AND o.pay_state != 1
|
||||
<if test="tenantId != null and tenantId != '000000'">
|
||||
AND o.tenant_id = #{tenantId}
|
||||
</if>
|
||||
GROUP BY o.prod_id
|
||||
ORDER BY count DESC
|
||||
</select>
|
||||
|
||||
<select id="prodSalesVolumeSum" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.prod_id as prodId,o.prod_code as prodCode,o.prod_name as prodName,sum(o.total) as sum FROM hy_order_item as o
|
||||
WHERE o.create_time BETWEEN #{startDay} and #{endDay} AND o.del_flag = 1 AND o.pay_state != 1
|
||||
<if test="tenantId != null and tenantId != '000000'">
|
||||
AND o.tenant_id = #{tenantId}
|
||||
</if>
|
||||
GROUP BY o.prod_id
|
||||
ORDER BY sum DESC
|
||||
</select>
|
||||
|
||||
<select id="prodSalesVolumeSumByZh" resultType="org.dromara.mall.domain.vo.RankSumVo">
|
||||
SELECT o.prod_id as prodId,o.prod_code as prodCode,o.prod_name as prodName,sum(o.actual_total) as sum FROM hy_order_item as o
|
||||
WHERE o.create_time BETWEEN #{startDay} and #{endDay} AND o.del_flag = 1 AND o.pay_state != 1
|
||||
<if test="tenantId != null and tenantId != '000000'">
|
||||
AND o.tenant_id = #{tenantId}
|
||||
</if>
|
||||
GROUP BY o.prod_id
|
||||
ORDER BY sum DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdPropMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,18 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdPropValueMapper">
|
||||
|
||||
<insert id="insertPropValues">
|
||||
insert into tz_prod_prop_value (prop_id,prop_value) values
|
||||
<foreach collection="prodPropValues" item="prodPropValue" separator=",">
|
||||
(#{propId},#{prodPropValue.propValue})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByPropId">
|
||||
delete from tz_prod_prop_value where prop_id = #{propId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdRecordMapper">
|
||||
|
||||
<select id="deleteBySkuId">
|
||||
delete from tz_prod_record where sku_id = #{skuId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdRelationMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdTagMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdTagReferenceMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzProdWishlistMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzShopDetailMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?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="org.dromara.mall.mapper.TzSkuMapper">
|
||||
|
||||
<insert id="insertBatchList">
|
||||
INSERT INTO `tz_sku` (
|
||||
`prod_id`,`properties`,`ori_price`,`price`,`guiding_price`,`stocks`,sku_code,sku_factory_code,`actual_stocks`,
|
||||
`update_time`,`rec_time`,`party_code`,`model_id`, `pic`,
|
||||
`sku_name`,`prod_name`,`version`,`weight`,`volume`, `status`, `is_delete`
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="skuList" item="sku" separator=",">
|
||||
(
|
||||
#{prodId},#{sku.properties},#{sku.oriPrice},#{sku.price},#{sku.guidingPrice},#{sku.stocks},#{sku.skuCode},#{sku.skuFactoryCode},
|
||||
#{sku.actualStocks}, NOW(),NOW(),#{sku.partyCode},#{sku.modelId}, #{sku.pic},
|
||||
#{sku.skuName},#{sku.prodName},0,#{sku.weight},#{sku.volume}, #{sku.status},0
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByProdId">
|
||||
delete from tz_sku where prod_id = #{prodId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzSmsLogMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzTenantRecordMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzTranscityFreeMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzTranscityMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzTransfeeFreeMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzTransfeeMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzTransportMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzUserAddrMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzUserAddrOrderMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzUserAddressMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzUserCollectionMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzUserMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzUserSearchMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?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="org.dromara.mall.mapper.TzWithdrawRequestMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user