begin new project
This commit is contained in:
25
src/main/resources/mapper/book/ActivityDao.xml
Normal file
25
src/main/resources/mapper/book/ActivityDao.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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.peanut.modules.common.dao.ActivityDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.ActivityEntity" id="activityMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="activityName" column="activity_name" />
|
||||
<result property="activityType" column="activity_type" />
|
||||
<result property="activityManner" column="activity_manner" />
|
||||
<result property="activityContent" column="activity_content" />
|
||||
<result property="point" column="point" />
|
||||
<result property="validity" column="validity" />
|
||||
<result property="beginTime" column="begin_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="activityUrl" column="activity_url" />
|
||||
<result property="currentState" column="current_state" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
22
src/main/resources/mapper/book/AuthorDao.xml
Normal file
22
src/main/resources/mapper/book/AuthorDao.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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.peanut.modules.common.dao.AuthorDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.AuthorEntity" id="authorMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="authorName" column="author_name"/>
|
||||
<result property="sex" column="sex"/>
|
||||
<result property="age" column="age"/>
|
||||
<result property="introduction" column="introduction"/>
|
||||
<result property="tel" column="tel"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
20
src/main/resources/mapper/book/BookBrowseRecordsDao.xml
Normal file
20
src/main/resources/mapper/book/BookBrowseRecordsDao.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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.peanut.modules.common.dao.BookBrowseRecordsDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookBrowseRecordsEntity" id="bookBrowseRecordsMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="bookId" column="book_id"/>
|
||||
<result property="bookName" column="book_name"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="images" column="images"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
18
src/main/resources/mapper/book/BookBuyConfigDao.xml
Normal file
18
src/main/resources/mapper/book/BookBuyConfigDao.xml
Normal file
@@ -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="com.peanut.modules.common.dao.BookBuyConfigDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookBuyConfigEntity" id="bookBuyConfigMap">
|
||||
<result property="priceTypeId" column="price_type_id"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="qudao" column="qudao"/>
|
||||
<result property="realMoney" column="real_money"/>
|
||||
<result property="money" column="money"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="month" column="month"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
20
src/main/resources/mapper/book/BookCategoryDao.xml
Normal file
20
src/main/resources/mapper/book/BookCategoryDao.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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.peanut.modules.book.dao.BookClockinCommentDao">
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookCategoryEntity" id="categoryEntity">
|
||||
<result property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="bookCid" column="book_cid"/>
|
||||
<result property="bookLevel" column="book_level"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="bookCount" column="book_count"/>
|
||||
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
23
src/main/resources/mapper/book/BookChapterContentDao.xml
Normal file
23
src/main/resources/mapper/book/BookChapterContentDao.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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.peanut.modules.common.dao.BookChapterContentDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookChapterContentEntity" id="bookChapterContentMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="bookId" column="book_id"/>
|
||||
<result property="bookChatperId" column="book_chatper_id"/>
|
||||
<result property="number" column="number"/>
|
||||
<result property="level" column="level"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="voices" column="voices"/>
|
||||
<result property="otherContent" column="other_content"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
20
src/main/resources/mapper/book/BookChapterDao.xml
Normal file
20
src/main/resources/mapper/book/BookChapterDao.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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.peanut.modules.common.dao.BookChapterDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookChapterEntity" id="bookChapterMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="bookId" column="book_id"/>
|
||||
<result property="chapter" column="chapter"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="voices" column="voices"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
63
src/main/resources/mapper/book/BookDao.xml
Normal file
63
src/main/resources/mapper/book/BookDao.xml
Normal file
@@ -0,0 +1,63 @@
|
||||
<?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.peanut.modules.common.dao.BookDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookEntity" id="bookMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="authorId" column="author_id"/>
|
||||
<result property="description" column="description"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="price" column="price"/>
|
||||
<result property="salePrice" column="sale_price"/>
|
||||
<result property="istop" column="istop"/>
|
||||
<result property="isSale" column="is_sale"/>
|
||||
<result property="isVip" column="isVip"/>
|
||||
<result property="freeChapterCount" column="free_chapter_count"/>
|
||||
<result property="publisherId" column="publisher_id"/>
|
||||
<result property="images" column="images"/>
|
||||
<result property="imagesList" column="images_list"/>
|
||||
<result property="pid" column="pid"/>
|
||||
<result property="chapterStatus" column="chapter_status"/>
|
||||
<result property="contentStatus" column="content_status"/>
|
||||
<result property="voicesStatus" column="voices_status"/>
|
||||
<result property="level" column="level"/>
|
||||
<result property="state" column="state"/>
|
||||
<result property="novel" column="novel"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="splits" column="splits"/>
|
||||
<result property="canListen" column="can_listen"/>
|
||||
<result property="clockIn" column="clock_in"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryBookInOther" resultType="com.peanut.modules.common.entity.BookEntity">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
book
|
||||
WHERE
|
||||
FIND_IN_SET(
|
||||
( SELECT id FROM publisher WHERE
|
||||
<if test="publisherName != null and publisherName != ''">
|
||||
publisher_name LIKE concat('%', #{ publisherName } , '%')
|
||||
</if>
|
||||
),
|
||||
publisher_id)
|
||||
and
|
||||
FIND_IN_SET(
|
||||
( SELECT id FROM author WHERE
|
||||
<if test="authorName != null and authorName != ''">
|
||||
author_name LIKE concat('%', #{ authorName } , '%')
|
||||
</if>
|
||||
),
|
||||
publisher_id)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
26
src/main/resources/mapper/book/BookForumArticlesDao.xml
Normal file
26
src/main/resources/mapper/book/BookForumArticlesDao.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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.peanut.modules.common.dao.BookForumArticlesDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookForumArticlesEntity" id="forumarticlesMap">
|
||||
<result property="id" column="id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="userid" column="userid" />
|
||||
<result property="content" column="content" />
|
||||
<result property="image" column="image" />
|
||||
<result property="imagelist" column="imagelist" />
|
||||
<result property="bookid" column="bookid" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="contlike" column="contlike" />
|
||||
<result property="delflag" column="del_flag" />
|
||||
<result property="author" column="author" />
|
||||
<result property="publishername" column="publishername" />
|
||||
<result property="bookdesc" column="bookdesc" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
23
src/main/resources/mapper/book/BookForumCommentDao.xml
Normal file
23
src/main/resources/mapper/book/BookForumCommentDao.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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.peanut.modules.common.dao.BookForumCommentDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookForumCommentEntity" id="ForumCommentMap">
|
||||
|
||||
|
||||
|
||||
<result property="id" column="id" />
|
||||
<result property="bfaid" column="bfa_id" />
|
||||
<result property="userid" column="userid" />
|
||||
<result property="content" column="content" />
|
||||
<result property="image" column="image" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="delflag" column="del_flag" />
|
||||
<result property="bookid" column="book_id" />
|
||||
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
34
src/main/resources/mapper/book/BookMedicalRecordsDao.xml
Normal file
34
src/main/resources/mapper/book/BookMedicalRecordsDao.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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.peanut.modules.common.dao.BookMedicalRecordsDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookMedicalRecordsEntity" id="bookMedicalRecordsMap">
|
||||
<result property="medicalRecordsId" column="medical_records_id"/>
|
||||
<result property="bookId" column="book_id"/>
|
||||
<result property="title" column="title"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getBooks" parameterType="int" resultType="com.peanut.modules.common.entity.BookEntity">
|
||||
select b.* from book_medical_records bmr
|
||||
left join book b on bmr.book_id = b.id
|
||||
where bmr.book_id not in (select book_id from user_ebook_buy where user_id = #{userId})
|
||||
and bmr.del_flag = 0 and b.del_flag = 0 and b.state = 1
|
||||
GROUP BY bmr.book_id
|
||||
limit #{page},#{limit}
|
||||
</select>
|
||||
|
||||
<select id="getCount" parameterType="int" resultType="int">
|
||||
select count(*) from (
|
||||
select distinct book_id from book_medical_records bmr
|
||||
left join book b on bmr.book_id = b.id
|
||||
where bmr.book_id not in (select book_id from user_ebook_buy where user_id = #{userId})
|
||||
and bmr.del_flag = 0 and b.del_flag = 0 and b.state = 1) t
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
31
src/main/resources/mapper/book/BookReadRateDao.xml
Normal file
31
src/main/resources/mapper/book/BookReadRateDao.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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.peanut.modules.common.dao.BookReadRateDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookReadRateEntity" id="bookReadRateMap">
|
||||
<result property="id" column="id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="bookId" column="book_id" />
|
||||
<result property="chapterId" column="chapter_id" />
|
||||
<result property="chapterName" column="chapter_name" />
|
||||
<result property="contentId" column="content_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="sort" column="sort" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="domDep" column="del_dep" />
|
||||
<result property="domValue" column="del_value" />
|
||||
<result property="domVmCount" column="del_vm_count" />
|
||||
<result property="domId" column="dom_id" />
|
||||
<result property="bottomGap" column="bottom_gap" />
|
||||
<result property="heightGap" column="height_gap" />
|
||||
<result property="leftGap" column="left_gap" />
|
||||
<result property="rightGap" column="right_gap" />
|
||||
<result property="topGap" column="top_gap" />
|
||||
<result property="widthGap" column="width_gap" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
19
src/main/resources/mapper/book/BookShelfDao.xml
Normal file
19
src/main/resources/mapper/book/BookShelfDao.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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.peanut.modules.common.dao.BookShelfDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BookShelfEntity" id="bookShelfMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="bookId" column="book_id"/>
|
||||
<result property="bookName" column="book_name"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
232
src/main/resources/mapper/book/BuyOrderDao.xml
Normal file
232
src/main/resources/mapper/book/BuyOrderDao.xml
Normal file
@@ -0,0 +1,232 @@
|
||||
<?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.peanut.modules.common.dao.BuyOrderDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BuyOrder" id="buyOrderMap">
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="orderSn" column="order_sn"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="shippingUser" column="shipping_user"/>
|
||||
<result property="province" column="province"/>
|
||||
<result property="city" column="city"/>
|
||||
<result property="district" column="district"/>
|
||||
<result property="address" column="address"/>
|
||||
<result property="paymentMethod" column="payment_method"/>
|
||||
<result property="orderMoney" column="order_money"/>
|
||||
<result property="districtMoney" column="district_money"/>
|
||||
<result property="realMoney" column="real_money"/>
|
||||
<result property="shippingMoney" column="shipping_money"/>
|
||||
<result property="shippingCompName" column="shipping_comp_name"/>
|
||||
<result property="shippingSn" column="shipping_sn"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="shippingTime" column="shipping_time"/>
|
||||
<result property="orderStatus" column="order_status"/>
|
||||
<result property="successTime" column="success_time"/>
|
||||
<result property="couponId" column="coupon_id"/>
|
||||
<result property="couponName" column="coupon_name"/>
|
||||
<result property="userPhone" column="user_phone"/>
|
||||
<result property="orderType" column="order_type"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="expNo" column="exp_no"/>
|
||||
<result property="isSend" column="is_send"/>
|
||||
<result property="addressId" column="address_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="orderCode" column="order_code"/>
|
||||
<result property="paymentDate" column="payment_date"/>
|
||||
|
||||
|
||||
<collection property="products" ofType="com.peanut.modules.common.entity.BuyOrderDetail">
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="productPrice" column="product_price"/>
|
||||
<result property="weight" column="weight"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!-- <resultMap id="OrderDetailResult" type="com.peanut.modules.book.entity.BuyOrderDetail">-->
|
||||
|
||||
<!-- </resultMap>-->
|
||||
<select id="getPhysicalBuyOrderTotal" resultType="map">
|
||||
select payType,count(1) count,SUM(price) totalPrice from (
|
||||
select q.*,pzo.trade_no zfbOrder
|
||||
from (
|
||||
select t.createTime,t.name,t.tel,t.orderSn,t.orderStatus,t.payType,t.orderPrice,
|
||||
t.orderPrice-(select IF(SUM(if(sp2.activity_price<sp2.price,sp2.activity_price,sp2.price)) is NULL,0,SUM(if(sp2.activity_price<sp2.price,sp2.activity_price,sp2.price))) from shop_product sp2 where sp2.goods_type = '05' and sp2.product_id in (GROUP_CONCAT(sp.product_id SEPARATOR ','))) price,
|
||||
GROUP_CONCAT(sp.product_name SEPARATOR ', ') productName,t.remark
|
||||
from (
|
||||
select bo.order_id,DATE_FORMAT(bo.create_time,'%Y-%m-%d %H:%i:%s') createTime,u.name,if(u.tel is null,if(u.email is null,'',u.email),u.tel) tel,bo.order_sn orderSn,
|
||||
IF(bo.payment_method=1,'微信',IF(bo.payment_method=2,'支付宝',IF(bo.payment_method=4,'天医币','0'))) payType,
|
||||
IF(bo.order_status = 4,'已删除',IF(bo.order_status = 3,'已完成',IF(bo.order_status = 2,'已发货','已付款'))) orderStatus,bo.real_money orderPrice,if(bo.remark like '%退%',bo.remark,'') remark
|
||||
from buy_order bo
|
||||
left join user u on u.id = bo.user_id
|
||||
left join buy_order_product bop on bop.order_id = bo.order_id
|
||||
left join shop_product sp on sp.product_id = bop.product_id
|
||||
where u.id not in (select id from user where tester_flag = 1)
|
||||
and bo.order_status in (1,2,3,4) and sp.goods_type != '05' and bo.real_money > 0
|
||||
<if test="orderType != null and orderType!= ''">
|
||||
<if test="orderType == 'lsorder' ">
|
||||
and (bo.payment_method = '1' or (bo.payment_method = '2' and bo.order_id >= 37867))
|
||||
and bo.order_type = 'lsorder'
|
||||
</if>
|
||||
<if test="orderType == 'order' ">
|
||||
and (bo.order_type = 'order'
|
||||
or (bo.order_type = 'lsorder' and bo.payment_method = '4')
|
||||
or (bo.order_type = 'lsorder' and bo.payment_method = '2' and bo.order_id < 37867))
|
||||
</if>
|
||||
</if>
|
||||
and DATE_FORMAT(bo.create_time,'%Y-%m') = SUBSTR(#{date},1,7)
|
||||
group by bo.order_sn
|
||||
) t
|
||||
left join buy_order_product bop on bop.order_id = t.order_id
|
||||
left join shop_product sp on sp.product_id = bop.product_id
|
||||
group by t.orderSn
|
||||
) q
|
||||
left join pay_zfb_order pzo on pzo.relevanceOid = q.orderSn and pzo.trade_no is not null
|
||||
) s
|
||||
group by payType
|
||||
</select>
|
||||
|
||||
<select id="exportPhysicalBuyOrderInfo" resultType="map">
|
||||
select q.*,pzo.trade_no zfbOrder
|
||||
from (
|
||||
select t.createTime,t.name,t.tel,t.orderSn,t.orderStatus,t.payType,t.orderPrice,
|
||||
t.orderPrice-(select IF(SUM(if(sp2.activity_price<sp2.price,sp2.activity_price,sp2.price)) is NULL,0,SUM(if(sp2.activity_price<sp2.price,sp2.activity_price,sp2.price))) from shop_product sp2 where sp2.goods_type = '05' and sp2.product_id in (GROUP_CONCAT(sp.product_id SEPARATOR ','))) price,
|
||||
GROUP_CONCAT(sp.product_name SEPARATOR ', ') productName,IF(count(1)=1,bop.quantity,'') quantity,t.remark
|
||||
from (
|
||||
select bo.order_id,DATE_FORMAT(bo.create_time,'%Y-%m-%d %H:%i:%s') createTime,u.name,if(u.tel is null,if(u.email is null,'',u.email),u.tel) tel,bo.order_sn orderSn,
|
||||
IF(bo.payment_method=1,'微信',IF(bo.payment_method=2,'支付宝',IF(bo.payment_method=4,'天医币','0'))) payType,
|
||||
IF(bo.order_status = 4,'已删除',IF(bo.order_status = 3,'已完成',IF(bo.order_status = 2,'已发货','已付款'))) orderStatus,bo.real_money orderPrice,if(bo.remark like '%退%',bo.remark,'') remark
|
||||
from buy_order bo
|
||||
left join user u on u.id = bo.user_id
|
||||
left join buy_order_product bop on bop.order_id = bo.order_id
|
||||
left join shop_product sp on sp.product_id = bop.product_id
|
||||
where u.id not in (select id from user where tester_flag = 1)
|
||||
and bo.order_status in (1,2,3,4) and sp.goods_type != '05' and bo.real_money > 0
|
||||
<if test="orderType != null and orderType!= ''">
|
||||
<if test="orderType == 'lsorder' ">
|
||||
and (bo.payment_method = '1' or (bo.payment_method = '2' and bo.order_id >37867))
|
||||
and bo.order_type = 'lsorder'
|
||||
</if>
|
||||
<if test="orderType == 'order' ">
|
||||
and (bo.order_type = 'order'
|
||||
or (bo.order_type = 'lsorder' and bo.payment_method = '4')
|
||||
or (bo.order_type = 'lsorder' and bo.payment_method = '2' and bo.order_id < 37867))
|
||||
</if>
|
||||
</if>
|
||||
and DATE_FORMAT(bo.create_time,'%Y-%m') = SUBSTR(#{date},1,7)
|
||||
group by bo.order_sn
|
||||
) t
|
||||
left join buy_order_product bop on bop.order_id = t.order_id
|
||||
left join shop_product sp on sp.product_id = bop.product_id
|
||||
group by t.orderSn
|
||||
) q
|
||||
left join pay_zfb_order pzo on pzo.relevanceOid = q.orderSn and pzo.trade_no is not null
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryListByOrderIds" resultType="com.peanut.modules.common.entity.BuyOrder">
|
||||
select
|
||||
*,
|
||||
buy_order_detail.order_id,
|
||||
buy_order_detail.product_name,
|
||||
buy_order_detail.quantity,
|
||||
buy_order_detail.product_price,
|
||||
buy_order_detail.weight,
|
||||
buy_order_detail.remark
|
||||
from buy_order
|
||||
left join buy_order_detail on buy_order.order_id = buy_order_detail.order_id
|
||||
where buy_order.order_id in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
and del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="orderStatusNum" resultType="com.peanut.modules.common.entity.BuyOrder">
|
||||
select *,count(*) as statusNum
|
||||
from buy_order
|
||||
where
|
||||
user_id = #{userId}
|
||||
and del_flag = 0
|
||||
and order_status in (0,1,2,3)
|
||||
group by
|
||||
order_status
|
||||
|
||||
</select>
|
||||
|
||||
<select id="orderListCount" resultType="int" parameterType="com.peanut.modules.book.vo.request.BuyOrderListRequestVo">
|
||||
select count(1) from (
|
||||
select b.*
|
||||
from buy_order b
|
||||
<if test="productName != null and productName!= ''">left join buy_order_product p on b.order_id = p.order_id
|
||||
left join
|
||||
shop_product s on s.product_id = p.product_id
|
||||
</if>
|
||||
<where>
|
||||
<if test="searchKeyWord != null and searchKeyWord!= ''">
|
||||
and (b.order_sn like concat('%',concat(#{searchKeyWord},'%'))
|
||||
or b.shipping_user like concat('%',concat(#{searchKeyWord},'%'))
|
||||
or b.user_phone like concat('%',concat(#{searchKeyWord},'%')))
|
||||
</if>
|
||||
<if test="productName != null and productName!= ''">
|
||||
and (s.product_name like concat('%',concat(#{productName},'%')))
|
||||
</if>
|
||||
<if test="orderStatus != null and orderStatus!= ''">
|
||||
and b.order_status = #{orderStatus}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
and b.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and b.create_time <= #{endTime}
|
||||
</if>
|
||||
and b.order_type = 'order'
|
||||
and b.del_flag = 0
|
||||
</where>
|
||||
<if test="productName != null and productName!= ''">
|
||||
group by b.order_id
|
||||
</if>
|
||||
) t
|
||||
</select>
|
||||
|
||||
<select id="orderList" resultType="com.peanut.modules.common.entity.BuyOrder"
|
||||
parameterType="com.peanut.modules.book.vo.request.BuyOrderListRequestVo" resultMap="buyOrderMap">
|
||||
select b.*
|
||||
from buy_order b
|
||||
<if test="productName != null and productName!= ''">
|
||||
left join buy_order_product p on b.order_id = p.order_id
|
||||
left join shop_product s on s.product_id = p.product_id
|
||||
</if>
|
||||
<where>
|
||||
<if test="searchKeyWord != null and searchKeyWord!= ''">
|
||||
and (b.order_sn like concat('%',concat(#{searchKeyWord},'%'))
|
||||
or b.shipping_user like concat('%',concat(#{searchKeyWord},'%'))
|
||||
or b.user_phone like concat('%',concat(#{searchKeyWord},'%')))
|
||||
</if>
|
||||
<if test="productName != null and productName!= ''">
|
||||
and (s.product_name like concat('%',concat(#{productName},'%')))
|
||||
</if>
|
||||
<if test="orderStatus != null and orderStatus!= ''">
|
||||
and b.order_status = #{orderStatus}
|
||||
</if>
|
||||
<if test="startTime != null">
|
||||
and b.create_time >= #{startTime}
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
and b.create_time <= #{endTime}
|
||||
</if>
|
||||
and b.order_type = 'order'
|
||||
and b.del_flag = 0
|
||||
</where>
|
||||
<if test="productName != null and productName!= ''">
|
||||
group by b.order_id
|
||||
</if>
|
||||
order by b.create_time desc
|
||||
limit #{index},#{pageSize}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
43
src/main/resources/mapper/book/BuyOrderDetailDao.xml
Normal file
43
src/main/resources/mapper/book/BuyOrderDetailDao.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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.peanut.modules.common.dao.BuyOrderDetailDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.BuyOrderDetail" id="buyOrderDetailMap">
|
||||
<result property="allOrderId" column="all_order_id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="productPrice" column="product_price" />
|
||||
<result property="weight" column="weight" />
|
||||
<result property="productType" column="product_type" />
|
||||
<result property="creatTime" column="creat_time" />
|
||||
<result property="shippingSn" column="shipping_sn" />
|
||||
<result property="orderStatus" column="order_status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="addressId" column="address_id" />
|
||||
<result property="fmsHtml" column="fms_html" />
|
||||
<result property="shipperCode" column="shipper_code" />
|
||||
<result property="shipperName" column="shipper_name" />
|
||||
<result property="isPrint" column="is_print" />
|
||||
<result property="productUrl" column="product_url" />
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="queryListByOrderIds" resultType="com.peanut.modules.common.entity.BuyOrderDetail">
|
||||
select
|
||||
*
|
||||
from buy_order_detail
|
||||
where buy_order_detail.order_id in
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
16
src/main/resources/mapper/book/CityDao.xml
Normal file
16
src/main/resources/mapper/book/CityDao.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?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.peanut.modules.common.dao.CityDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.City" id="cityMap">
|
||||
<result property="cityId" column="city_id"/>
|
||||
<result property="provId" column="prov_id"/>
|
||||
<result property="cityName" column="city_name"/>
|
||||
<result property="createDate" column="create_date"/>
|
||||
<result property="regionCode" column="region_code"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
16
src/main/resources/mapper/book/CountyDao.xml
Normal file
16
src/main/resources/mapper/book/CountyDao.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?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.peanut.modules.common.dao.CountyDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.County" id="countyMap">
|
||||
<result property="countyId" column="county_id"/>
|
||||
<result property="cityId" column="city_id"/>
|
||||
<result property="countyName" column="county_name"/>
|
||||
<result property="createDate" column="create_date"/>
|
||||
<result property="regionCode" column="region_code"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
13
src/main/resources/mapper/book/ExpressCompanyDao.xml
Normal file
13
src/main/resources/mapper/book/ExpressCompanyDao.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?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.peanut.modules.common.dao.ExpressCompanyDao">
|
||||
<select id="getExpressCompanyList" resultType="com.peanut.modules.book.vo.ExpressCompanyVo">
|
||||
select name as expressName, code as expressCode
|
||||
from express_company
|
||||
</select>
|
||||
<select id="getExpressComList" resultType="com.peanut.modules.common.vo.ExpressCompanyCommonVo">
|
||||
select name as expressName, code as expressCode
|
||||
from express_company
|
||||
</select>
|
||||
</mapper>
|
||||
6
src/main/resources/mapper/book/ExpressFeeDao.xml
Normal file
6
src/main/resources/mapper/book/ExpressFeeDao.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?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.peanut.modules.common.dao.ExpressFeeDao">
|
||||
|
||||
</mapper>
|
||||
10
src/main/resources/mapper/book/ExpressOrderDao.xml
Normal file
10
src/main/resources/mapper/book/ExpressOrderDao.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?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.peanut.modules.common.dao.ExpressOrderDao">
|
||||
<insert id="insertNewExpressOrder" keyProperty="id" parameterType="com.peanut.modules.common.entity.ExpressFee"
|
||||
useGeneratedKeys="true">
|
||||
insert into express_order(user_id, user_address_id, express_fee, create_time, total_weight)
|
||||
values (#{userId}, #{userAddressId}, #{expressFee}, #{createTime}, #{totalWeight})
|
||||
</insert>
|
||||
</mapper>
|
||||
94
src/main/resources/mapper/book/MyUserDao.xml
Normal file
94
src/main/resources/mapper/book/MyUserDao.xml
Normal file
@@ -0,0 +1,94 @@
|
||||
<?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.peanut.modules.common.dao.MyUserDao">
|
||||
|
||||
<select id="getUserCountFor30Day" resultType="map">
|
||||
select ucvl.user_id
|
||||
from user_course_video_log ucvl
|
||||
left join user u on u.id = ucvl.user_id
|
||||
where ucvl.del_flag = 0 and u.tester_flag = 0
|
||||
and DATE_FORMAT(ucvl.create_time,'%Y-%m-%d') > DATE_ADD(CURRENT_DATE,INTERVAL -30 day)
|
||||
group by ucvl.user_id
|
||||
having SUM(ucvl.duration) >= 300
|
||||
union
|
||||
select bo.user_id
|
||||
from buy_order bo
|
||||
left join user u on u.id = bo.user_id
|
||||
where bo.del_flag = 0 and bo.order_status = 3 and u.tester_flag = 0
|
||||
and DATE_FORMAT(bo.create_time,'%Y-%m-%d') > DATE_ADD(CURRENT_DATE,INTERVAL -30 day)
|
||||
group by bo.user_id
|
||||
</select>
|
||||
|
||||
<select id="getUserStatistics" resultType="map">
|
||||
select u.id,u.name,IF(u.tel is NULL,u.email,u.tel) tel,DATE_FORMAT(u.create_time,'%Y-%m-%d') createTime,last_login_city loginCity,
|
||||
IF(come=0,'疯子读书',IF(come=1,'众妙之门',IF(come=2,'吴门医述',IF(come=3,'心灵空间',IF(come=4,'太湖云医','未知'))))) come,
|
||||
social_identity socialIdentity,
|
||||
CONCAT(IF(ucon.score is NULL,'',CONCAT(' ',ucon.score)),IF(miu.count>0 and ucerZhongyi.count>0 and ucerZhenjiu.count>0,' 太湖云医',IF(miu.count>0 and ucerZhongyi.count>0,' 太湖云医1',IF(miu.count>0 and ucerZhenjiu.count>0,' 太湖云医2',IF(ucerZhongyi.count>0 and ucerZhenjiu.count>0,' 国际中医师 国际针灸师',IF(ucerZhongyi.count>0,' 国际中医师',IF(ucerZhenjiu.count>0,' 国际针灸师',''))))))) identity,
|
||||
u.peanut_coin point,u.jf,IF(nowUv.type is NULL,'',nowUv.type) nowVip,
|
||||
IF(beforUv.type is NULL,'',beforUv.type) beforVip,
|
||||
IF(IF(ucbl.count is NULL,0,ucbl.count)>1,'是','否') ucbl,
|
||||
IF(IF(ubo.count is NULL,0,ubo.count)>2,'是','否') ubo,
|
||||
IF(ucer.count is NULL,0,ucer.count) ucerCount,
|
||||
DATE_FORMAT(u.last_login_time,'%Y-%m-%d %H:%i:%s') loginTime,
|
||||
u.last_login_machine loginMachine,
|
||||
IF(u.sex=0,'女',if(u.sex=1,'男','未知')) sex,
|
||||
IF(ucvl.p is NULL,0,FLOOR(ucvl.p/60)) nowWatch,
|
||||
IF(ucvl7.p is NULL,0,FLOOR(ucvl7.p/60/60)) 7Watch,
|
||||
IF(ucvlTotal.p is NULL,0,FLOOR(ucvlTotal.p/60/60)) totalWatch
|
||||
from user u
|
||||
left join (select count(1) count,user_id from medicaldes_inherit mi left join medicaldes_inherit_relation mir on mir.inherit_id = mi.id where mi.del_flag = 0 and mir.del_flag = 0 and mir.type_id = 1 group by mi.user_id) miu on miu.user_id = u.id
|
||||
left join (select user_id,IF(SUM(score)>=500,'七星',IF(SUM(score)>=300,'六星',IF(SUM(score)>=150,'五星',IF(SUM(score)>=135,'四星半',IF(SUM(score)>=120,'四星',IF(SUM(score)>=105,'三星半',IF(SUM(score)>=90,'三星',IF(SUM(score)>=75,'二星半',IF(SUM(score)>=60,'二星',IF(SUM(score)>=45,'一星半',IF(SUM(score)>=30,'一星',IF(SUM(score)>=15,'半星','')))))))))))) score from user_contribution where del_flag = 0 group by user_id) ucon on ucon.user_id = u.id
|
||||
left join (select GROUP_CONCAT(IF(FIND_IN_SET('中医学', types)>0 AND FIND_IN_SET('针灸学', types)>0 AND FIND_IN_SET('肿瘤学', types)>0 AND FIND_IN_SET('中西汇通学', types)>0,'医学超级',IF(FIND_IN_SET('国学', types)>0 AND FIND_IN_SET('心理学', types)>0 ,'国学心理学超级',types))) type,user_id
|
||||
from(
|
||||
select GROUP_CONCAT(IF(type=4,'中医学',IF(type=5,'针灸学',IF(type=6,'肿瘤学',IF(type=7,'国学',IF(type=8,'心理学','中西汇通学')))))) types,user_id
|
||||
from user_vip where del_flag = 0 and state = 0
|
||||
group by user_id,start_time,end_time
|
||||
) t group by user_id) nowUv on nowUv.user_id = u.id
|
||||
left join (select GROUP_CONCAT(IF(FIND_IN_SET('中医学', types)>0 AND FIND_IN_SET('针灸学', types)>0 AND FIND_IN_SET('肿瘤学', types)>0 AND FIND_IN_SET('中西汇通学', types)>0,'医学超级',IF(FIND_IN_SET('国学', types)>0 AND FIND_IN_SET('心理学', types)>0 ,'国学心理学超级',types))) type,user_id
|
||||
from(
|
||||
select GROUP_CONCAT(IF(type=4,'中医学',IF(type=5,'针灸学',IF(type=6,'肿瘤学',IF(type=7,'国学',IF(type=8,'心理学','中西汇通学')))))) types,user_id
|
||||
from user_vip where del_flag = 0 and state = 1
|
||||
group by user_id,start_time,end_time
|
||||
) t group by user_id) beforUv on beforUv.user_id = u.id
|
||||
left join (select count(1) count,user_id from user_course_buy_log ucbl where del_flag = 0 and pay_type != '免费' group by user_id) ucbl on ucbl.user_id = u.id
|
||||
left join (select count(1) count,user_id from buy_order where del_flag = 0 and order_status in (1,2,3,4) group by user_id) ubo on ubo.user_id = u.id
|
||||
left join (select count(1) count,user_id from user_certificate where del_flag =0 and label_id = 13 group by user_id) ucerZhongyi on ucerZhongyi.user_id = u.id
|
||||
left join (select count(1) count,user_id from user_certificate where del_flag =0 and label_id = 19 group by user_id) ucerZhenjiu on ucerZhenjiu.user_id = u.id
|
||||
left join (select count(1) count,user_id from user_certificate where del_flag =0 and label_id in (5,6,8) group by user_id) ucer on ucer.user_id = u.id
|
||||
left join (select SUM(duration) p,user_id from user_course_video_log where del_flag=0 and create_time like CONCAT('%',CURRENT_DATE,'%') group by user_id) ucvl on ucvl.user_id = u.id
|
||||
left join (select SUM(duration) p,user_id from user_course_video_log where del_flag=0 and create_time > DATE_ADD(CURRENT_DATE,INTERVAL -6 day) group by user_id) ucvl7 on ucvl7.user_id = u.id
|
||||
left join (select SUM(duration) p,user_id from user_course_video_log where del_flag=0 group by user_id) ucvlTotal on ucvlTotal.user_id = u.id
|
||||
where u.del_flag = 0 and u.tester_flag = 0
|
||||
<if test="date !=null and date != ''">
|
||||
<choose>
|
||||
<when test="date.length() == 4">
|
||||
and DATE_FORMAT(u.create_time,'%Y') = #{date}
|
||||
</when>
|
||||
<when test="date.length() == 7">
|
||||
and DATE_FORMAT(u.last_login_time,'%Y-%m') = #{date}
|
||||
</when>
|
||||
<when test="date.length() == 10">
|
||||
and DATE_FORMAT(u.last_login_time,'%Y-%m-%d') = #{date}
|
||||
</when>
|
||||
</choose>
|
||||
</if>
|
||||
order by createTime desc
|
||||
<if test="limit !=null and limit != ''">
|
||||
limit #{offset},#{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getUserRegisterStayInfo" resultType="map">
|
||||
select *,ROUND(nextDay/count,2) nextRate,ROUND(7Day/count,2) 7Rate,ROUND(30Day/count,2) 30Rate
|
||||
from (
|
||||
select DATE_FORMAT(create_time,'%Y-%m-%d') dayTime,count(1) count,
|
||||
SUM(create_next_login) nextDay,SUM(create_seven_login) 7Day,SUM(create_thirty_login) 30Day
|
||||
from user u
|
||||
where del_flag = 0 and tester_flag = 0 and DATE_FORMAT(create_time,'%Y-%m') = #{date}
|
||||
group by dayTime
|
||||
) t
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
32
src/main/resources/mapper/book/OrderCartDao.xml
Normal file
32
src/main/resources/mapper/book/OrderCartDao.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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.peanut.modules.common.dao.OrderCartDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.OrderCartEntity" id="orderCartMap">
|
||||
<result property="cartId" column="cart_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="productAmount" column="product_amount"/>
|
||||
<result property="price" column="price"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="productBook" column="product_book"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="getDeteleOrderCart" resultType="com.peanut.modules.common.entity.OrderCartEntity">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`order_cart`
|
||||
WHERE
|
||||
product_id = #{productId}
|
||||
AND user_id = #{userId}
|
||||
AND del_flag = -1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
33
src/main/resources/mapper/book/PayIOSOrderDao.xml
Normal file
33
src/main/resources/mapper/book/PayIOSOrderDao.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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.peanut.modules.common.dao.PayIOSOrderDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.pay.IOSPay.model.entities.IosPayOrderEntity" id="PayIOSOrderMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="orderID" column="orderid"/>
|
||||
<result property="productID" column="productID"/>
|
||||
<result property="customerOid" column="customerOid"/>
|
||||
<result property="authToken" column="authToken"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="orderStatus" column="order_status"/>
|
||||
<result property="money" column="money"/>
|
||||
<result property="point" column="point"/>
|
||||
<result property="jf" column="jf"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="closeOrder" column="close_order"/>
|
||||
<result property="rechargeAmount" column="recharge_Amount"/>
|
||||
<result property="rechargeChannel" column="recharge_Channel"/>
|
||||
<result property="realAmount" column="realAmount"/>
|
||||
<result property="rechargeStatus" column="recharge_Status"/>
|
||||
<result property="successTime" column="successTime"/>
|
||||
<result property="body" column="body"/>
|
||||
<result property="subject" column="subject"/>
|
||||
<result property="relevanceoid" column="relevanceoid"/>
|
||||
<result property="buyerPayAmount" column="buyerPay_Amount"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
22
src/main/resources/mapper/book/PayPaymentOrderDao.xml
Normal file
22
src/main/resources/mapper/book/PayPaymentOrderDao.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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.peanut.modules.common.dao.PayPaymentOrderDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.PayPaymentOrderEntity" id="payPaymentOrderMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="rechargeAmount" column="recharge_amount"/>
|
||||
<result property="rechargeChannel" column="recharge_channel"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="realAmount" column="real_amount"/>
|
||||
<result property="rechargeStatus" column="recharge_status"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="successTime" column="success_time"/>
|
||||
<result property="userName" column="user_name"/>
|
||||
<result property="tel" column="tel"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
24
src/main/resources/mapper/book/PayWechatOrderDao.xml
Normal file
24
src/main/resources/mapper/book/PayWechatOrderDao.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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.peanut.modules.common.dao.PayWechatOrderDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.PayWechatOrderEntity" id="payWechatOrderMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="prepayId" column="prepay_id"/>
|
||||
<result property="customerId" column="customer_id"/>
|
||||
<result property="orderSn" column="order_sn"/>
|
||||
<result property="totalAmount" column="total_amount"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="systemLog" column="system_log"/>
|
||||
<result property="payType" column="pay_type"/>
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="buyOrderId" column="buy_order_id"/>
|
||||
<result property="endtime" column="endtime"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
45
src/main/resources/mapper/book/PayZfbOrderDao.xml
Normal file
45
src/main/resources/mapper/book/PayZfbOrderDao.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?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.peanut.modules.common.dao.PayZfbOrderDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.PayZfbOrderEntity" id="payZfbOrderMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="customerid" column="customerId"/>
|
||||
<result property="outTradeNo" column="out_trade_no"/>
|
||||
<result property="tradeNo" column="trade_no"/>
|
||||
<result property="notifyTime" column="notify_time"/>
|
||||
<result property="notifyType" column="notify_type"/>
|
||||
<result property="notifyId" column="notify_id"/>
|
||||
<result property="appId" column="app_id"/>
|
||||
<result property="authAppId" column="auth_app_id"/>
|
||||
<result property="charset" column="charset"/>
|
||||
<result property="version" column="version"/>
|
||||
<result property="signType" column="sign_type"/>
|
||||
<result property="sign" column="sign"/>
|
||||
<result property="outBizNo" column="out_biz_no"/>
|
||||
<result property="buyerId" column="buyer_id"/>
|
||||
<result property="buyerLogonId" column="buyer_logon_id"/>
|
||||
<result property="sellerId" column="seller_id"/>
|
||||
<result property="sellerEmail" column="seller_email"/>
|
||||
<result property="tradeStatus" column="trade_status"/>
|
||||
<result property="totalAmount" column="total_amount"/>
|
||||
<result property="receiptAmount" column="receipt_amount"/>
|
||||
<result property="invoiceAmount" column="invoice_amount"/>
|
||||
<result property="buyerPayAmount" column="buyer_pay_amount"/>
|
||||
<result property="pointAmount" column="point_amount"/>
|
||||
<result property="refundFee" column="refund_fee"/>
|
||||
<result property="subject" column="subject"/>
|
||||
<result property="body" column="body"/>
|
||||
<result property="gmtCreate" column="gmt_create"/>
|
||||
<result property="gmtPayment" column="gmt_payment"/>
|
||||
<result property="gmtRefund" column="gmt_refund"/>
|
||||
<result property="gmtClose" column="gmt_close"/>
|
||||
<result property="fundBillList" column="fund_bill_list"/>
|
||||
<result property="voucherDetailList" column="voucher_detail_list"/>
|
||||
<result property="relevanceoid" column="relevanceOid"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
15
src/main/resources/mapper/book/ProvinceDao.xml
Normal file
15
src/main/resources/mapper/book/ProvinceDao.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?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.peanut.modules.common.dao.ProvinceDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.Province" id="provinceMap">
|
||||
<result property="provId" column="prov_id"/>
|
||||
<result property="provName" column="prov_name"/>
|
||||
<result property="createDate" column="create_date"/>
|
||||
<result property="regionCode" column="region_code"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
18
src/main/resources/mapper/book/PublisherDao.xml
Normal file
18
src/main/resources/mapper/book/PublisherDao.xml
Normal file
@@ -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="com.peanut.modules.common.dao.PublisherDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.Publisher" id="publisherMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="publisherName" column="publisher_name"/>
|
||||
<result property="introduction" column="introduction"/>
|
||||
<result property="tel" column="tel"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
19
src/main/resources/mapper/book/SeckillProdRelationDao.xml
Normal file
19
src/main/resources/mapper/book/SeckillProdRelationDao.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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.peanut.modules.common.dao.SeckillProdRelationDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.SeckillProdRelationEntity" id="seckillProdRelationMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="promotionId" column="promotion_id"/>
|
||||
<result property="promotionSeckillId" column="promotion_seckill_id"/>
|
||||
<result property="prodId" column="prod_id"/>
|
||||
<result property="seckillPrice" column="seckill_price"/>
|
||||
<result property="seckillCount" column="seckill_count"/>
|
||||
<result property="seckillLimit" column="seckill_limit"/>
|
||||
<result property="seckillSort" column="seckill_sort"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
21
src/main/resources/mapper/book/ShopCategoryDao.xml
Normal file
21
src/main/resources/mapper/book/ShopCategoryDao.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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.peanut.modules.common.dao.ShopCategoryDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.ShopCategoryEntity" id="shopCategoryMap">
|
||||
<result property="catId" column="cat_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="parentCid" column="parent_cid"/>
|
||||
<result property="catLevel" column="cat_level"/>
|
||||
<result property="showStatus" column="show_status"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="icon" column="icon"/>
|
||||
<result property="productUnit" column="product_unit"/>
|
||||
<result property="productCount" column="product_count"/>
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
26
src/main/resources/mapper/book/ShopProductBookDao.xml
Normal file
26
src/main/resources/mapper/book/ShopProductBookDao.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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.peanut.modules.common.dao.ShopProductBookDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.ShopProductBookEntity" id="ProductBookMap">
|
||||
<result property="id" column="id"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="bookId" column="book_id"/>
|
||||
<result property="bookIds" column="book_ids"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getOrderBookId" parameterType="string" resultType="int">
|
||||
SELECT spb.book_id
|
||||
FROM shop_product_book spb
|
||||
LEFT JOIN buy_order_product bod ON spb.product_id = bod.product_id
|
||||
LEFT JOIN buy_order bo ON bo.order_id = bod.order_id
|
||||
WHERE bo.order_sn = #{orderSn}
|
||||
AND spb.del_flag != -1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
60
src/main/resources/mapper/book/ShopProductDao.xml
Normal file
60
src/main/resources/mapper/book/ShopProductDao.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?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.peanut.modules.common.dao.ShopProductDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.ShopProduct" id="shopProductMap">
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="productName" column="product_name"/>
|
||||
<result property="price" column="price"/>
|
||||
<result property="weight" column="weight"/>
|
||||
<result property="publishStatus" column="publish_status"/>
|
||||
<result property="productDetails" column="product_details"/>
|
||||
<result property="productPid" column="product_pid"/>
|
||||
<result property="productType" column="product_type"/>
|
||||
<result property="productStock" column="product_stock"/>
|
||||
<result property="productImages" column="product_images"/>
|
||||
<result property="productImageList" column="product_image_list"/>
|
||||
<result property="productSalesVolume" column="product_sales_volume"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="sort" column="sort"/>
|
||||
<result property="author" column="author"/>
|
||||
<result property="publisher" column=" publisher"/>
|
||||
<result property="pubDate" column="pub_date"/>
|
||||
<result property="format" column="format"/>
|
||||
<result property="pageNum" column="page_num"/>
|
||||
<result property="quality" column="quality"/>
|
||||
<result property="sumSales" column="sum_sales"/>
|
||||
<result property="goodsType" column="goods_type"/>
|
||||
<result property="goodsTypeCode" column="goods_type_code"/>
|
||||
<result property="activityPrice" column="activity_price"/>
|
||||
<result property="isFreeMail" column="is_free_mail"/>
|
||||
<result property="bookId" column="book_ids"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="appGetCategoryList" resultType="com.peanut.modules.common.entity.ShopProduct">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`shop_product` a
|
||||
LEFT JOIN shop_category b ON a.product_pid = b.cat_id
|
||||
<where>
|
||||
<if test="catId != null and catId != ''">
|
||||
b.cat_id = #{catId}
|
||||
</if>
|
||||
</where>
|
||||
order by a.sort desc
|
||||
</select>
|
||||
|
||||
<select id="getTotalWeight" parameterType="list" resultType="java.lang.Integer">
|
||||
select sum(weight) from shop_product where product_id in
|
||||
<foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
17
src/main/resources/mapper/book/ShopProductLabelDao.xml
Normal file
17
src/main/resources/mapper/book/ShopProductLabelDao.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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.peanut.modules.common.dao.ShopProductLabelDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.ShopProductLabelEntity" id="ProductLabelMap">
|
||||
<result property="splId" column="spl_id"/>
|
||||
<result property="labelName" column="label_name"/>
|
||||
<result property="ctime" column="ctime"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
17
src/main/resources/mapper/book/ShopProductToLabelDao.xml
Normal file
17
src/main/resources/mapper/book/ShopProductToLabelDao.xml
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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.peanut.modules.common.dao.ShopProductToLabelDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.ShopProductToLabelEntity" id="ProductToLabelMap">
|
||||
<result property="ptlId" column="ptl_id"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
<result property="splId" column="spl_id"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
16
src/main/resources/mapper/book/ShopSeckillDao.xml
Normal file
16
src/main/resources/mapper/book/ShopSeckillDao.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?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.peanut.modules.common.dao.ShopSeckillDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.ShopSeckillEntity" id="shopSeckillMap">
|
||||
<result property="seckillId" column="seckill_id"/>
|
||||
<result property="nam" column="nam"/>
|
||||
<result property="startTime" column="start_time"/>
|
||||
<result property="endTime" column="end_time"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
80
src/main/resources/mapper/book/TransactionDetailsDao.xml
Normal file
80
src/main/resources/mapper/book/TransactionDetailsDao.xml
Normal file
@@ -0,0 +1,80 @@
|
||||
<?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.peanut.modules.common.dao.TransactionDetailsDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.TransactionDetailsEntity" id="transactionDetailsMap">
|
||||
<result property="transactionId" column="transaction_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="orderType" column="order_type"/>
|
||||
<result property="changeAmount" column="change_amount"/>
|
||||
<result property="relationId" column="relation_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="userBalance" column="user_balance"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="userName" column="user_name"/>
|
||||
<result property="tel" column="tel"/>
|
||||
<result property="note" column="note"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getUserSurplusPeanutCoin" resultType="map">
|
||||
select SUM(IF(camount is NULL,peanut_coin,peanut_coin-camount)) surplusPeanutCoin
|
||||
from user u
|
||||
left join (select user_id userId,SUM(change_amount) camount from transaction_details where create_time > #{date} group by userId) t on t.userId = u.id
|
||||
where u.del_flag = 0 and u.id not in (select id from user where tester_flag = 1)
|
||||
</select>
|
||||
<select id="getTransactionDetailsTotal" resultType="map">
|
||||
select type,payMethod,goodsType,SUM(changeAmount) amount
|
||||
from (
|
||||
select q.*,pzo.trade_no zfbOrder
|
||||
from (
|
||||
select t.*,
|
||||
IF(IF(GROUP_CONCAT(sp.product_name SEPARATOR ',') is NULL,IF(bo.order_type='vip',vbc.title,bo.remark),GROUP_CONCAT(sp.product_name SEPARATOR ',')) is NULL,'',IF((GROUP_CONCAT(sp.goods_type SEPARATOR ',') like '%,05%') or (GROUP_CONCAT(sp.goods_type SEPARATOR ',') like '05,'),'实物、课程',IF(GROUP_CONCAT(sp.goods_type SEPARATOR ',')='05','课程',IF(bo.order_type='relearn','课程',IF(bo.order_type='trainingClass','培训班',IF(bo.order_type='vip','VIP','实物')))))) goodsType,
|
||||
IF(IF(GROUP_CONCAT(sp.product_name SEPARATOR ',') is NULL,IF(bo.order_type='vip',vbc.title,bo.remark),GROUP_CONCAT(sp.product_name SEPARATOR ',')) is NULL,'',IF(GROUP_CONCAT(sp.product_name SEPARATOR ',') is NULL,IF(bo.order_type='vip',vbc.title,bo.remark),GROUP_CONCAT(sp.product_name SEPARATOR ','))) productName
|
||||
from (
|
||||
select td.transaction_id id,DATE_FORMAT(td.create_time,'%Y-%m-%d %H:%i:%s') createTime,u.name,if(u.tel is null,if(u.email is null,'',u.email),u.tel) tel
|
||||
,td.order_type type,td.pay_method payMethod,td.pay_no payNo
|
||||
,td.change_amount changeAmount,IF(td.note is NULL,'',td.note) note
|
||||
from transaction_details td
|
||||
left join user u on u.id = td.user_id
|
||||
where DATE_FORMAT(td.create_time,'%Y-%m') = SUBSTR(#{date},1,7)
|
||||
and td.user_id not in (select id from user where tester_flag = 1)
|
||||
) t
|
||||
left join buy_order bo on bo.order_sn = t.payNo
|
||||
left join buy_order_product bop on bop.order_id = bo.order_id
|
||||
left join shop_product sp on sp.product_id = bop.product_id
|
||||
left join vip_buy_config vbc on vbc.id = bo.vip_buy_config_id
|
||||
group by t.id
|
||||
order by t.createTime
|
||||
) q
|
||||
left join pay_zfb_order pzo on pzo.relevanceOid = q.payNo and pzo.trade_no is not null
|
||||
) s
|
||||
group by type,payMethod,goodsType
|
||||
</select>
|
||||
<select id="getTransactionDetailsInfo" resultType="map">
|
||||
select q.*,pzo.trade_no zfbOrder
|
||||
from (
|
||||
select t.*,
|
||||
IF(IF(GROUP_CONCAT(sp.product_name SEPARATOR ',') is NULL,IF(bo.order_type='vip',vbc.title,bo.remark),GROUP_CONCAT(sp.product_name SEPARATOR ',')) is NULL,'',IF((GROUP_CONCAT(sp.goods_type SEPARATOR ',') like '%,05%') or (GROUP_CONCAT(sp.goods_type SEPARATOR ',') like '05,'),'实物、课程',IF(GROUP_CONCAT(sp.goods_type SEPARATOR ',')='05','课程',IF(bo.order_type='relearn','课程',IF(bo.order_type='trainingClass','培训班',IF(bo.order_type='vip','VIP','实物')))))) goodsType,
|
||||
IF(IF(GROUP_CONCAT(sp.product_name SEPARATOR ',') is NULL,IF(bo.order_type='vip',vbc.title,bo.remark),GROUP_CONCAT(sp.product_name SEPARATOR ',')) is NULL,'',IF(GROUP_CONCAT(sp.product_name SEPARATOR ',') is NULL,IF(bo.order_type='vip',vbc.title,bo.remark),GROUP_CONCAT(sp.product_name SEPARATOR ','))) productName
|
||||
from (
|
||||
select td.transaction_id id,DATE_FORMAT(td.create_time,'%Y-%m-%d %H:%i:%s') createTime,u.name,if(u.tel is null,if(u.email is null,'',u.email),u.tel) tel
|
||||
,td.order_type type,td.pay_method payMethod,td.pay_no payNo
|
||||
,td.change_amount changeAmount,IF(td.note is NULL,'',td.note) note
|
||||
from transaction_details td
|
||||
left join user u on u.id = td.user_id
|
||||
where DATE_FORMAT(td.create_time,'%Y-%m') = SUBSTR(#{date},1,7)
|
||||
and td.user_id not in (select id from user where tester_flag = 1)
|
||||
) t
|
||||
left join buy_order bo on bo.order_sn = t.payNo
|
||||
left join buy_order_product bop on bop.order_id = bo.order_id
|
||||
left join shop_product sp on sp.product_id = bop.product_id
|
||||
left join vip_buy_config vbc on vbc.id = bo.vip_buy_config_id
|
||||
group by t.id
|
||||
order by t.createTime
|
||||
) q
|
||||
left join pay_zfb_order pzo on pzo.relevanceOid = q.payNo and pzo.trade_no is not null
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
23
src/main/resources/mapper/book/UserAddressDao.xml
Normal file
23
src/main/resources/mapper/book/UserAddressDao.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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.peanut.modules.common.dao.UserAddressDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.UserAddress" id="userAddressMap">
|
||||
<result property="addressid" column="addressId"/>
|
||||
<result property="userid" column="userId"/>
|
||||
<result property="username" column="userName"/>
|
||||
<result property="userphone" column="userPhone"/>
|
||||
<result property="areaidpath" column="areaIdPath"/>
|
||||
<result property="areaid" column="areaId"/>
|
||||
<result property="useraddress" column="userAddress"/>
|
||||
<result property="areaidpathtext" column="areaIdPathText"/>
|
||||
<result property="isdefault" column="isDefault"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
24
src/main/resources/mapper/book/UserEbookBuyDao.xml
Normal file
24
src/main/resources/mapper/book/UserEbookBuyDao.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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.peanut.modules.common.dao.UserEbookBuyDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.UserEbookBuyEntity" id="userEbookBuyMap">
|
||||
<result property="buyId" column="buy_id"/>
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="bookId" column="book_id"/>
|
||||
<result property="bookName" column="book_name"/>
|
||||
<result property="payType" column="pay_type"/>
|
||||
<result property="payTime" column="pay_time"/>
|
||||
<result property="payStatus" column="pay_status"/>
|
||||
<result property="image" column="image"/>
|
||||
<result property="author" column="author"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getUserBookId" parameterType="int" resultType="int">
|
||||
SELECT book_id
|
||||
FROM user_ebook_buy
|
||||
WHERE user_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
21
src/main/resources/mapper/book/UserFeedbackDao.xml
Normal file
21
src/main/resources/mapper/book/UserFeedbackDao.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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.peanut.modules.common.dao.UserFeedbackDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.UserFeedbackEntity" id="UserFeedbackMap">
|
||||
<result property="id" column="oid"/>
|
||||
<result property="userId" column="userId"/>
|
||||
<result property="fuid" column="fu_id"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="rid" column="r_id"/>
|
||||
<result property="delFlag" column="delFlag"/>
|
||||
<result property="ordersn" column="ordersn"/>
|
||||
<result property="create_date" column="create_date"/>
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
21
src/main/resources/mapper/book/UserFollowUpDao.xml
Normal file
21
src/main/resources/mapper/book/UserFollowUpDao.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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.peanut.modules.common.dao.UserFollowUpDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.UserFollowUpEntity" id="UserFollowUpMap">
|
||||
<result property="id" column="oid"/>
|
||||
<result property="userId" column="userId"/>
|
||||
<result property="oid" column="oid"/>
|
||||
<result property="conTent" column="conTent"/>
|
||||
<result property="images" column="images"/>
|
||||
<result property="delflag" column="delflag"/>
|
||||
<result property="bookid" column="bookid"/>
|
||||
<result property="createDate" column="create_date"/>
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
21
src/main/resources/mapper/book/UserRecordDao.xml
Normal file
21
src/main/resources/mapper/book/UserRecordDao.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?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.peanut.modules.common.dao.UserRecordDao">
|
||||
|
||||
<!-- 可根据自己的需求,是否要使用 -->
|
||||
<resultMap type="com.peanut.modules.common.entity.UserRecord" id="UserRecordMap">
|
||||
<result property="id" column="oid"/>
|
||||
<result property="createDate" column="createDate"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="content" column="content"/>
|
||||
<result property="userid" column="userid"/>
|
||||
<result property="images" column="images"/>
|
||||
<result property="orderCode" column="orderCode"/>
|
||||
<result property="orderSn" column="orderSn"/>
|
||||
<result property="starLevel" column="starLevel"/>
|
||||
<result property="productId" column="product_id"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user