更改配置

This commit is contained in:
lyf
2023-01-28 15:57:27 +08:00
parent e1ff6a0eb7
commit b017339f5f
1809 changed files with 32351 additions and 251 deletions

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.AccountMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.Account">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="idcardId" property="idCardId" />
<result column="bankCardId" property="bankCardId" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
<select id="selectMicroMbiAccountNum" resultType="java.lang.Integer">
SELECT count(DISTINCT mbi.userId) count FROM tb_pluss_merchant_base_info mbi
LEFT JOIN tb_pluss_account account ON account.userId = mbi.userId
LEFT JOIN tb_pluss_id_card ic ON account.userId = ic.userId AND account.idCardId = ic.id
LEFT JOIN tb_pluss_merchant_channel_status mcs ON mcs.merchantCode = mbi.merchantCode
WHERE merchantType = 1
AND mcs.`status` IN (3)
AND ic.certNo = #{certNo}
</select>
<select id="selectAccountNum" resultType="java.lang.Integer">
SELECT count(DISTINCT mbi.userId) count FROM tb_pluss_merchant_base_info mbi
LEFT JOIN tb_pluss_account account ON account.userId = mbi.userId
LEFT JOIN tb_pluss_id_card ic ON account.userId = ic.userId AND account.idCardId = ic.id
LEFT JOIN tb_pluss_merchant_channel_status mcs ON mcs.merchantCode = mbi.merchantCode
WHERE mcs.`status` IN (3, 7)
AND ic.certNo IN
<foreach collection="certNoList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
<select id="selectGroupMaps" resultType="java.util.Map">
SELECT count(1) count, ic.certName, ic.certNo FROM tb_pluss_merchant_base_info mbi
LEFT JOIN tb_pluss_id_card ic ON mbi.userId = ic.userId
LEFT JOIN tb_pluss_merchant_channel_status mcs ON mcs.merchantCode = mbi.merchantCode
WHERE merchantType = 1
AND ic.userType = 1
AND mcs.`status` IN (3, 4)
GROUP BY ic.certName, ic.certNo
</select>
<select id="selectYSAuditSmallCount" resultType="int">
SELECT count(DISTINCT a.userId) FROM tb_pluss_account a
LEFT JOIN tb_pluss_merchant_base_info mbi ON a.userId = mbi.userId
LEFT JOIN tb_pluss_merchant_channel_status mcs ON mbi.merchantCode = mcs.merchantCode
LEFT JOIN tb_pluss_id_card ic ON ic.id = a.idcardId
WHERE mcs.`status` IN (3, 7) AND mbi.merchantType = 1 AND mcs.channel = 4
AND ic.certNo = (
SELECT DISTINCT ic.certNo FROM tb_pluss_account a
LEFT JOIN tb_pluss_merchant_base_info mbi ON a.userId = mbi.userId
LEFT JOIN tb_pluss_merchant_channel_status mcs ON mbi.merchantCode = mcs.merchantCode
LEFT JOIN tb_pluss_id_card ic ON ic.id = a.idcardId
WHERE mbi.userId = #{userId}
)
</select>
<select id="selectMbiListByCertNo" resultType="cn.pluss.platform.entity.MerchantBaseInfo">
SELECT DISTINCT account.userId, mbi.merchantCode FROM tb_pluss_account account
LEFT JOIN tb_pluss_id_card ic ON account.userId = ic.userId AND account.idcardId = ic.id
LEFT JOIN tb_pluss_merchant_base_info mbi ON mbi.userId = account.userId
WHERE ic.certNo = #{certNo};
</select>
</mapper>

View File

@@ -0,0 +1,302 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.ActivityActivateMapper">
<insert id="saveActivityActivate" parameterType="cn.pluss.platform.entity.ActivityActivate">
insert into tb_pluss_activity_activate(userId,merchantCode,merchantName,giveMoney,storeId,storeName,name,createDt,posterUrl)VALUES(#{userId},#{merchantCode},#{merchantName},#{giveMoney},#{storeId},#{storeName},#{name},now(),#{posterUrl})
</insert>
<insert id="saveActivityActivateBatch">
insert into tb_pluss_activity_activate(userId,merchantCode,merchantName,giveMoney,storeId,storeName,name,createDt) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{userId},#{merchantCode},#{merchantName},#{giveMoney},#{storeId},#{storeName},#{name},#{createDt} )
</foreach>
</insert>
<select id="queryActivityActivate" parameterType="cn.pluss.platform.entity.ActivityActivate" resultType="cn.pluss.platform.entity.ActivityActivate">
SELECT * from tb_pluss_activity_activate
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
</select>
<select id="queryActivityActivateList" parameterType="cn.pluss.platform.entity.ActivityActivate" resultType="cn.pluss.platform.entity.ActivityActivate">
SELECT * from tb_pluss_activity_activate
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
</select>
<update id="updateActivityActivate" parameterType="cn.pluss.platform.entity.ActivityActivate" >
update tb_pluss_activity_activate
<set>
<if test="userId!= null">
userId = #{userId},
</if>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="merchantName!= null">
merchantName = #{merchantName},
</if>
<if test="giveMoney!= null">
giveMoney = #{giveMoney},
</if>
<if test="storeId!= null">
storeId = #{storeId},
</if>
<if test="storeName!= null">
storeName = #{storeName},
</if>
<if test="name!= null">
name = #{name},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="posterUrl!= null">
posterUrl = #{posterUrl}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteActivityActivate" parameterType="cn.pluss.platform.entity.ActivityActivate" >
DELETE FROM tb_pluss_activity_activate where id=#{id}
</delete>
<select id="queryActivityActivatePage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.ActivityActivate">
SELECT * from tb_pluss_activity_activate
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name Like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="posterUrl!= null">
and posterUrl = #{createDt}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryNoActivityActivatePage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.ActivityActivate">
SELECT * from tb_pluss_activity_activate
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name Like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="posterUrl!= null">
and posterUrl = #{createDt}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryActivityActivatePageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_activity_activate
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name Like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
</select>
<select id="queryNoActivityActivatePageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_activity_activate
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name Like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
</select>
<select id="getNewestActivityJoin" resultType="java.util.Map" parameterType="java.lang.String">
SELECT distinct a.id,a.createDt,a.giveMoney,a.rechargeMoney,a.type,a.reType,a.percent,a.timeType,a.startDt,a.endDt,a.storeId FROM (
(
SELECT id,createDt,giveMoney,rechargeMoney,3 'type',-1 AS 'reType',0 AS 'percent',timeType,startDt,endDt,storeId FROM tb_pluss_activity_recharge WHERE storeId = #{storeId} AND timeType = 0
)
UNION
(
SELECT id,createDt,giveMoney,rechargeMoney,3 'type',-1 AS 'reType',0 AS 'percent',timeType,startDt,endDt,storeId FROM tb_pluss_activity_recharge
WHERE storeId = #{storeId} AND timeType = 1 and DATE_FORMAT(startDt,'%Y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(NOW(),'%Y-%m-%d') AND DATE_FORMAT(endDt,'%Y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(NOW(),'%Y-%m-%d')
)
UNION
(
SELECT id,createDt,returnMoney AS 'giveMoney',comsumeMoney AS 'rechargeMoney', 2 'type', type AS 'reType',percent,timeType,startDt,endDt,storeId from tb_pluss_activity_consum_return WHERE storeId = #{storeId} and timeType = 0
)
UNION
(
SELECT id,createDt,returnMoney AS 'giveMoney',comsumeMoney AS 'rechargeMoney', 2 'type', type AS 'reType',percent,timeType,startDt,endDt,storeId from tb_pluss_activity_consum_return WHERE storeId = #{storeId} and timeType = 1 and DATE_FORMAT(startDt,'%Y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(NOW(),'%Y-%m-%d') AND DATE_FORMAT(endDt,'%Y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(NOW(),'%Y-%m-%d')
)
UNION
(
SELECT id,createDt,giveMoney, 0 'rechargeMoney',1 'type' , -1 AS 'reType' , 0 as 'percent', 0 as 'timeType', null as startDt,null as endDt,storeId FROM tb_pluss_activity_activate WHERE storeId = #{storeId}
)
) a ORDER BY a.createDt desc
</select>
</mapper>

View File

@@ -0,0 +1,428 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.ActivityConsumReturnMapper">
<insert id="saveActivityConsumReturn" parameterType="cn.pluss.platform.entity.ActivityConsumReturn">
insert into tb_pluss_activity_consum_return(userId,merchantCode,merchantName,storeId,storeName,name,createDt,type,comsumeMoney,returnMoney,percent,startDt,endDt,timeType,posterUrl)VALUES(#{userId},#{merchantCode},#{merchantName},#{storeId},#{storeName},#{name},now(),#{type},#{comsumeMoney},#{returnMoney},#{percent},#{startDt},#{endDt},#{timeType},#{posterUrl})
</insert>
<insert id="saveActivityConsumReturnBatch">
insert into tb_pluss_activity_consum_return(userId,merchantCode,merchantName,storeId,storeName,name,createDt,type,comsumeMoney,returnMoney,percent,startDt,endDt,timeType) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{userId},#{merchantCode},#{merchantName},#{storeId},#{storeName},#{name},#{createDt},#{type},#{comsumeMoney},#{returnMoney},#{percent},#{startDt},#{endDt},#{timeType} )
</foreach>
</insert>
<select id="queryActivityConsumReturn" parameterType="cn.pluss.platform.entity.ActivityConsumReturn" resultType="cn.pluss.platform.entity.ActivityConsumReturn">
SELECT * from tb_pluss_activity_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="comsumeMoney!= null">
and comsumeMoney = #{comsumeMoney}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="percent!= null">
and percent = #{percent}
</if>
<if test="startDt!= null">
and startDt = #{startDt}
</if>
<if test="endDt!= null">
and endDt = #{endDt}
</if>
<if test="timeType!= null">
and timeType = #{timeType}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
</select>
<select id="queryActivityConsumReturnList" parameterType="cn.pluss.platform.entity.ActivityConsumReturn" resultType="cn.pluss.platform.entity.ActivityConsumReturn">
SELECT * from tb_pluss_activity_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="comsumeMoney!= null">
and comsumeMoney = #{comsumeMoney}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="percent!= null">
and percent = #{percent}
</if>
<if test="startDt!= null">
and startDt = #{startDt}
</if>
<if test="endDt!= null">
and endDt = #{endDt}
</if>
<if test="timeType!= null">
and timeType = #{timeType}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
</select>
<update id="updateActivityConsumReturn" parameterType="cn.pluss.platform.entity.ActivityConsumReturn" >
update tb_pluss_activity_consum_return
<set>
startDt = #{startDt},
endDt = #{endDt},
<if test="userId!= null">
userId = #{userId},
</if>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="merchantName!= null">
merchantName = #{merchantName},
</if>
<if test="storeId!= null">
storeId = #{storeId},
</if>
<if test="storeName!= null">
storeName = #{storeName},
</if>
<if test="name!= null">
name = #{name},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="type!= null">
type = #{type},
</if>
<if test="comsumeMoney!= null">
comsumeMoney = #{comsumeMoney},
</if>
<if test="returnMoney!= null">
returnMoney = #{returnMoney},
</if>
<if test="percent!= null">
percent = #{percent},
</if>
<if test="timeType!= null">
timeType = #{timeType},
</if>
<if test="posterUrl!= null">
posterUrl = #{posterUrl}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteActivityConsumReturn" parameterType="cn.pluss.platform.entity.ActivityConsumReturn" >
DELETE FROM tb_pluss_activity_consum_return where id=#{id}
</delete>
<select id="queryActivityConsumReturnPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.ActivityConsumReturn">
SELECT * from tb_pluss_activity_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name Like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="comsumeMoney!= null">
and comsumeMoney = #{comsumeMoney}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="percent!= null">
and percent = #{percent}
</if>
<if test="startDt!= null">
AND startDt <![CDATA[>=]]>#{startDt}
</if>
<if test="endDt!= null">
AND endDt <![CDATA[<=]]>#{endDt}
</if>
<!-- <if test="startDt!= null">
and startDt = #{startDt}
</if>
<if test="endDt!= null">
and endDt = #{endDt}
</if> -->
<if test="timeType!= null">
and timeType = #{timeType}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryActivityNoConsumReturnPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.ActivityConsumReturn">
SELECT * from tb_pluss_activity_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name Like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="comsumeMoney!= null">
and comsumeMoney = #{comsumeMoney}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="percent!= null">
and percent = #{percent}
</if>
<if test="startDt!= null">
AND startDt <![CDATA[>=]]>#{startDt}
</if>
<if test="endDt!= null">
AND endDt <![CDATA[<=]]>#{endDt}
</if>
<!-- <if test="startDt!= null">
and startDt = #{startDt}
</if>
<if test="endDt!= null">
and endDt = #{endDt}
</if> -->
<if test="timeType!= null">
and timeType = #{timeType}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryActivityConsumReturnPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_activity_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name Like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="comsumeMoney!= null">
and comsumeMoney = #{comsumeMoney}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="percent!= null">
and percent = #{percent}
</if>
<if test="startDt!= null">
AND startDt <![CDATA[>=]]>#{startDt}
</if>
<if test="endDt!= null">
AND endDt <![CDATA[<=]]>#{endDt}
</if>
<!-- <if test="startDt!= null">
and startDt = #{startDt}
</if>
<if test="endDt!= null">
and endDt = #{endDt}
</if> -->
<if test="timeType!= null">
and timeType = #{timeType}
</if>
</where>
</select>
<select id="queryActivityNoConsumReturnPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_activity_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="name!= null">
and name Like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="comsumeMoney!= null">
and comsumeMoney = #{comsumeMoney}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="percent!= null">
and percent = #{percent}
</if>
<if test="startDt!= null">
AND startDt <![CDATA[>=]]>#{startDt}
</if>
<if test="endDt!= null">
AND endDt <![CDATA[<=]]>#{endDt}
</if>
<!-- <if test="startDt!= null">
and startDt = #{startDt}
</if>
<if test="endDt!= null">
and endDt = #{endDt}
</if> -->
<if test="timeType!= null">
and timeType = #{timeType}
</if>
</where>
</select>
</mapper>

View 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="cn.pluss.platform.mapper.ActivityEnrollMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.ActivityEnroll">
<id column="id" property="id" />
<result column="merchantCode" property="merchantCode" />
<result column="merchantName" property="merchantName" />
<result column="actName" property="actName" />
<result column="actId" property="actId" />
<result column="status" property="status" />
<result column="remark" property="remark" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,273 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.ActivityRechargeMapper">
<insert id="saveActivityRechargeBatch">
insert into tb_pluss_activity_recharge(userId,merchantCode,merchantName,rechargeMoney,giveMoney,startDt,endDt,name,createDt,timeType,storeId,storeName) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{userId},#{merchantCode},#{merchantName},#{rechargeMoney},#{giveMoney},#{startDt},#{endDt},#{name},#{createDt},#{timeType},#{storeId},#{storeName} )
</foreach>
</insert>
<select id="queryActivityRechargeList" parameterType="cn.pluss.platform.entity.ActivityRecharge" resultType="cn.pluss.platform.entity.ActivityRecharge">
SELECT * from tb_pluss_activity_recharge
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="rechargeMoney!= null">
and rechargeMoney = #{rechargeMoney}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="startDt!= null">
and startDt = #{startDt}
</if>
<if test="endDt!= null">
and endDt = #{endDt}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="startDt!= null">
AND startDt <![CDATA[>=]]>#{startDt}
</if>
<if test="endDt!= null">
AND endDt <![CDATA[<=]]>#{endDt}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
order by id desc
</select>
<select id="queryActivityRechargePage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.ActivityRecharge">
SELECT * from tb_pluss_activity_recharge
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="rechargeMoney!= null">
and rechargeMoney = #{rechargeMoney}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="startDt!= null">
AND startDt <![CDATA[>=]]>#{startDt}
</if>
<if test="endDt!= null">
AND endDt <![CDATA[<=]]>#{endDt}
</if>
<if test="name!= null and name!=''">
and name like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="timeType!= null">
and timeType = #{timeType}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryActivityNoRechargePage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.ActivityRecharge">
SELECT * from tb_pluss_activity_recharge
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="rechargeMoney!= null">
and rechargeMoney = #{rechargeMoney}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="startDt!= null">
AND startDt <![CDATA[>=]]>#{startDt}
</if>
<if test="endDt!= null">
AND endDt <![CDATA[<=]]>#{endDt}
</if>
<if test="name!= null and name!=''">
and name like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="timeType!= null">
and timeType = #{timeType}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryActivityRechargePageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_activity_recharge
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="rechargeMoney!= null">
and rechargeMoney = #{rechargeMoney}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="startDt!= null">
AND startDt <![CDATA[>=]]>#{startDt}
</if>
<if test="endDt!= null">
AND endDt <![CDATA[<=]]>#{endDt}
</if>
<if test="name!= null and name!=''">
and name = #{name}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="timeType!= null">
and timeType = #{timeType}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
</select>
<select id="queryActivityNoRechargePageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_activity_recharge
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode} ))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="rechargeMoney!= null">
and rechargeMoney = #{rechargeMoney}
</if>
<if test="giveMoney!= null">
and giveMoney = #{giveMoney}
</if>
<if test="startDt!= null">
AND startDt <![CDATA[>=]]>#{startDt}
</if>
<if test="endDt!= null">
AND endDt <![CDATA[<=]]>#{endDt}
</if>
<if test="name!= null and name!=''">
and name = #{name}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="timeType!= null">
and timeType = #{timeType}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="posterUrl!= null">
and posterUrl = #{posterUrl}
</if>
</where>
</select>
<select id="queryUsableActivityRechageList" parameterType="cn.pluss.platform.entity.ActivityRecharge" resultType="cn.pluss.platform.entity.ActivityRecharge">
(SELECT * FROM tb_pluss_activity_recharge
WHERE merchantCode = #{merchantCode} and storeId = #{storeId} and timeType = '0') UNION All
(SELECT * FROM tb_pluss_activity_recharge
WHERE merchantCode = #{merchantCode} and timeType = '1' and DATE_FORMAT(startDt,'%Y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(NOW(),'%Y-%m-%d') and DATE_FORMAT(endDt,'%Y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(NOW(),'%Y-%m-%d') )
</select>
</mapper>

View File

@@ -0,0 +1,201 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.ActivityRecommendMapper">
<insert id="saveActivityRecommend" parameterType="cn.pluss.platform.entity.ActivityRecommend">
insert into tb_pluss_activity_recommend(userId,name,firstMixRechargeMoney,recommendMoney,merchantCode,merchantName,storeId,storeName,createDt)VALUES(#{userId},#{name},#{firstMixRechargeMoney},#{recommendMoney},#{merchantCode},#{merchantName},#{storeId},#{storeName},NOW())
</insert>
<insert id="saveActivityRecommendBatch">
insert into tb_pluss_activity_recommend(userId,name,firstMixRechargeMoney,recommendMoney,merchantCode,merchantName,storeId,storeName,createDt) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{userId},#{name},#{firstMixRechargeMoney},#{recommendMoney},#{merchantCode},#{merchantName},#{storeId},#{storeName},#{createDt} )
</foreach>
</insert>
<select id="queryActivityRecommend" parameterType="cn.pluss.platform.entity.ActivityRecommend" resultType="cn.pluss.platform.entity.ActivityRecommend">
SELECT * from tb_pluss_activity_recommend
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="firstMixRechargeMoney!= null">
and firstMixRechargeMoney = #{firstMixRechargeMoney}
</if>
<if test="recommendMoney!= null">
and recommendMoney = #{recommendMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
</select>
<select id="queryActivityRecommendList" parameterType="cn.pluss.platform.entity.ActivityRecommend" resultType="cn.pluss.platform.entity.ActivityRecommend">
SELECT * from tb_pluss_activity_recommend
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="firstMixRechargeMoney!= null">
and firstMixRechargeMoney = #{firstMixRechargeMoney}
</if>
<if test="recommendMoney!= null">
and recommendMoney = #{recommendMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
</select>
<update id="updateActivityRecommend" parameterType="cn.pluss.platform.entity.ActivityRecommend" >
update tb_pluss_activity_recommend
<set>
<if test="userId!= null">
userId = #{userId},
</if>
<if test="name!= null">
name = #{name},
</if>
<if test="firstMixRechargeMoney!= null">
firstMixRechargeMoney = #{firstMixRechargeMoney},
</if>
<if test="recommendMoney!= null">
recommendMoney = #{recommendMoney},
</if>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="merchantName!= null">
merchantName = #{merchantName},
</if>
<if test="storeId!= null">
storeId = #{storeId},
</if>
<if test="storeName!= null">
storeName = #{storeName},
</if>
<if test="createDt!= null">
createDt = #{createDt}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteActivityRecommend" parameterType="cn.pluss.platform.entity.ActivityRecommend" >
DELETE FROM tb_pluss_activity_recommend where id=#{id}
</delete>
<select id="queryActivityRecommendPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.ActivityRecommend">
SELECT * from tb_pluss_activity_recommend
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="name!= null">
and name like CONCAT("%",#{name},"%")
</if>
<if test="firstMixRechargeMoney!= null">
and firstMixRechargeMoney = #{firstMixRechargeMoney}
</if>
<if test="recommendMoney!= null">
and recommendMoney = #{recommendMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryActivityRecommendPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_activity_recommend
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="name!= null">
and name like CONCAT("%",#{name},"%")
</if>
<if test="firstMixRechargeMoney!= null">
and firstMixRechargeMoney = #{firstMixRechargeMoney}
</if>
<if test="recommendMoney!= null">
and recommendMoney = #{recommendMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,403 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.AgentInfoMapper">
<resultMap id="AgentInfo" type="cn.pluss.platform.vo.AgentInfo" autoMapping="true">
</resultMap>
<select id="selectPage" resultMap="AgentInfo, cn.pluss.platform.mapper.CommonMapper.count">
SELECT SQL_CALC_FOUND_ROWS
ua.userId,
ui.loginName,
mr.rate,
ui.phone,
ui.STATUS,
ua.userName,
ui.createTime,
ui.updateTime,
ua.isFixedRate, ua.autoAudit, ua.payEcdemicSwitch, ua.isMarket, ua.isUnionPay,
sumPrice,
cashAmt,
t4.beforeMonthPrice,
t4.nowMonthPrice
FROM
tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui ON ua.userId = ui.id
LEFT JOIN tb_pluss_merchant_rate mr ON ua.userId = mr.userId
LEFT JOIN (
SELECT
SUM( mp.price ) sumPrice, mp.userId
FROM
tb_pluss_merchant_profit mp
GROUP BY mp.userId
) t2 ON ua.userId = t2.userId
LEFT JOIN (
SELECT SUM(pc.cashAmt) cashAmt, pc.userId
FROM tb_pluss_cash pc WHERE pc.`status` = '1'
GROUP BY pc.userId
) t3 ON ua.userId = t3.userId
LEFT JOIN (
SELECT
t.userId
, SUM(IF(recordMonth = DATE_FORMAT(DATE_ADD(CURRENT_DATE, INTERVAL -1 MONTH), "%Y-%m"), monthPrice, 0)) beforeMonthPrice
, SUM(IF(recordMonth = DATE_FORMAT(CURRENT_DATE, "%Y-%m"), monthPrice, 0)) nowMonthPrice
FROM (
SELECT
ua.userId,
mp.recordMonth,
IFNULL( SUM( mp.price ), 0 ) monthPrice
FROM
tb_pluss_user_app ua
LEFT JOIN tb_pluss_merchant_profit mp ON ua.userId = mp.userId
AND mp.recordMonth IN ( DATE_FORMAT(DATE_ADD(CURRENT_DATE, INTERVAL -1 MONTH), "%Y-%m"), DATE_FORMAT(CURRENT_DATE, "%Y-%m") )
WHERE
ua.userType = 'agent'
GROUP BY
ua.userId,
mp.recordMonth
) t GROUP BY t.userId
) t4 ON t4.userId = ua.userId
WHERE
ua.userType = 'agent'
AND ua.parentId IS NULL
<include refid="commonWhere"/>
ORDER BY
<foreach collection="page.orders" item="orderItem" separator=",">
${orderItem.column}
<if test="orderItem.asc == false">
DESC
</if>
</foreach>
LIMIT ${page.getIntValue('size') * (page.current - 1)}, ${page.getIntValue('size')};
SELECT found_rows() as count;
</select>
<select id="selectPermissionPage" resultMap="AgentInfo, cn.pluss.platform.mapper.CommonMapper.count">
SELECT SQL_CALC_FOUND_ROWS
ua.userId,
ui.loginName,
mr.rate,
ui.phone,
ui.STATUS,
ua.userName,
ui.createTime,
ui.updateTime,
tpcr.remark,
ua.isFixedRate, ua.autoAudit, ua.payEcdemicSwitch, ua.isMarket, ua.isUnionPay
FROM
tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui ON ua.userId = ui.id
LEFT JOIN tb_pluss_merchant_rate mr ON ua.userId = mr.userId
LEFT JOIN tb_pluss_common_remark tpcr on mr.userId = tpcr.userId AND tpcr.code = 'USER'
<where>
ui.loginName NOT LIKE '%@%'
AND ua.userType IN ('promoter', 'agent')
<include refid="commonWhere"/>
</where>
ORDER BY
<foreach collection="page.orders" item="orderItem" separator=",">
${orderItem.column}
<if test="orderItem.asc == false">
DESC
</if>
</foreach>
LIMIT ${page.getIntValue('size') * (page.current - 1)}, ${page.getIntValue('size')};
SELECT found_rows() as count;
</select>
<select id="selectPageCount" resultType="java.lang.Long">
SELECT
count(1)
FROM
tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui ON ua.userId = ui.id
LEFT JOIN tb_pluss_merchant_rate mr ON ua.userId = mr.userId
WHERE
ua.userType = 'agent'
AND ua.parentId IS NULL
<include refid="commonWhere"/>
ORDER BY ui.createTime desc
</select>
<select id="selectOne" resultType="cn.pluss.platform.vo.AgentInfo">
SELECT ua.userId, ui.loginName, mr.rate, ui.phone, ui.status, ua.userName, ui.createTime,
ui.updateTime,ua.isFixedRate, t3.cashAmt
FROM tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui ON ua.userId = ui.id
LEFT JOIN tb_pluss_merchant_rate mr ON ua.userId=mr.userId
LEFT JOIN tb_pluss_cash pc ON ua.userId = pc.userId
LEFT JOIN (
SELECT SUM(pc.cashAmt) cashAmt, pc.userId
FROM tb_pluss_cash pc
GROUP BY pc.userId
) t3 ON ua.userId = t3.userId
WHERE ua.userType = 'agent'
<include refid="commonWhere"/>
LIMIT 1
</select>
<select id="selectRecentMonthPrice" resultType="cn.pluss.platform.vo.AgentInfo">
SELECT
t.userId, t.userName
, SUM(IF(recordMonth = DATE_FORMAT(DATE_ADD(CURRENT_DATE, INTERVAL -1 MONTH), "%Y-%m"), monthPrice, 0)) beforeMonthPrice
, SUM(IF(recordMonth = DATE_FORMAT(CURRENT_DATE, "%Y-%m"), monthPrice, 0)) nowMonthPrice
FROM (
SELECT
ua.userId,
ua.userName,
mp.recordMonth,
IFNULL( SUM( mp.price ), 0 ) monthPrice
FROM
tb_pluss_user_app ua
LEFT JOIN tb_pluss_merchant_profit mp ON ua.userId = mp.userId
AND mp.recordMonth IN ( DATE_FORMAT(DATE_ADD(CURRENT_DATE, INTERVAL -1 MONTH), "%Y-%m"), DATE_FORMAT(CURRENT_DATE, "%Y-%m") )
WHERE
ua.userType = 'agent'
GROUP BY
ua.userId,
ua.userName,
mp.recordMonth
) t GROUP BY t.monthPrice, t.userId, t.userName;
</select>
<select id="selectSubAgentPage" resultMap="AgentInfo, cn.pluss.platform.mapper.CommonMapper.count">
SELECT SQL_CALC_FOUND_ROWS
ua.userId,
ua.parentId,
ui.loginName,
mr.rate,
ui.phone,
ui.STATUS,
ua.userName,
ui.createTime,
ui.updateTime,
ua.isFixedRate, ua.autoAudit, ua.payEcdemicSwitch, ua.isMarket, ua.isUnionPay,
sumPrice,
cashAmt,
t4.beforeMonthPrice,
t4.nowMonthPrice
FROM
tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui ON ua.userId = ui.id
LEFT JOIN tb_pluss_merchant_rate mr ON ua.userId = mr.userId
LEFT JOIN (
SELECT
SUM( mp.price ) sumPrice, mp.userId
FROM
tb_pluss_merchant_profit mp
GROUP BY mp.userId
) t2 ON ua.userId = t2.userId
LEFT JOIN (
SELECT SUM(pc.cashAmt) cashAmt, pc.userId
FROM tb_pluss_cash pc
WHERE pc.`status` = '1'
GROUP BY pc.userId
) t3 ON ua.userId = t3.userId
LEFT JOIN (
SELECT
t.userId
, SUM(IF(recordMonth = DATE_FORMAT(DATE_ADD(CURRENT_DATE, INTERVAL -1 MONTH), "%Y-%m"), monthPrice, 0)) beforeMonthPrice
, SUM(IF(recordMonth = DATE_FORMAT(CURRENT_DATE, "%Y-%m"), monthPrice, 0)) nowMonthPrice
FROM (
SELECT
ua.userId,
mp.recordMonth,
IFNULL( SUM( mp.price ), 0 ) monthPrice
FROM
tb_pluss_user_app ua
LEFT JOIN tb_pluss_merchant_profit mp ON ua.userId = mp.userId
AND mp.recordMonth IN ( DATE_FORMAT(DATE_ADD(CURRENT_DATE, INTERVAL -1 MONTH), "%Y-%m"), DATE_FORMAT(CURRENT_DATE, "%Y-%m") )
WHERE
ua.userType = 'agent'
GROUP BY
ua.userId,
mp.recordMonth
) t GROUP BY t.userId
) t4 ON t4.userId = ua.userId
WHERE
ua.userType = 'agent'
AND ua.parentId IS NOT NULL
<include refid="commonWhere"/>
ORDER BY
<foreach collection="page.orders" item="orderItem" separator=",">
${orderItem.column}
<if test="orderItem.asc == false">
DESC
</if>
</foreach>
LIMIT ${page.getIntValue('size') * (page.current - 1)}, ${page.getIntValue('size')};
SELECT found_rows() as count;
</select>
<!-- <select id="selectSubAgentPage" resultType="cn.pluss.platform.vo.AgentInfo">-->
<!-- SELECT-->
<!-- ua.userId,-->
<!-- ua.parentId,-->
<!-- ui.loginName,-->
<!-- mr.rate,-->
<!-- ui.phone,-->
<!-- ui.STATUS,-->
<!-- ua.userName,-->
<!-- ui.createTime,-->
<!-- ui.updateTime,-->
<!-- ua.isFixedRate, ua.autoAudit, ua.payEcdemicSwitch, ua.isMarket, ua.isUnionPay,-->
<!-- t2.sumPrice,-->
<!-- t3.cashAmt-->
<!-- FROM-->
<!-- tb_pluss_user_app ua-->
<!-- LEFT JOIN tb_pluss_user_info ui ON ua.userId = ui.id-->
<!-- LEFT JOIN tb_pluss_merchant_rate mr ON ua.userId = mr.userId-->
<!-- LEFT JOIN (-->
<!-- SELECT-->
<!-- SUM( mp.price ) sumPrice, mp.userId-->
<!-- FROM-->
<!-- tb_pluss_merchant_profit mp-->
<!-- GROUP BY mp.userId-->
<!-- ) t2 ON ua.userId = t2.userId-->
<!-- LEFT JOIN (-->
<!-- SELECT SUM(pc.cashAmt) cashAmt, pc.userId-->
<!-- FROM tb_pluss_cash pc-->
<!-- GROUP BY pc.userId-->
<!-- ) t3 ON ua.userId = t3.userId-->
<!-- WHERE-->
<!-- ua.userType = 'agent'-->
<!-- AND ua.parentId IS NOT NULL-->
<!-- <include refid="commonWhere"/>-->
<!-- <if test="agentInfo.parentId != null and agentInfo.parentId != ''">-->
<!-- and ua.parentId = #{agentInfo.parentId}-->
<!-- </if>-->
<!-- ORDER BY-->
<!-- ui.createTime-->
<!-- </select>-->
<select id="selectSubAgentPageCount" resultType="java.lang.Long">
SELECT
ua.userId,
ua.parentId,
ui.loginName,
mr.rate,
ui.phone,
ui.STATUS,
ua.userName,
ui.createTime,
ui.updateTime,
ua.isFixedRate,
t2.sumPrice,
t3.cashAmt
FROM
tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui ON ua.userId = ui.id
LEFT JOIN tb_pluss_merchant_rate mr ON ua.userId = mr.userId
WHERE
ua.userType = 'agent'
AND ua.parentId IS NOT NULL
<include refid="commonWhere"/>
<if test="agentInfo.parentId != null and agentInfo.parentId != ''">
and ua.parentId = #{agentInfo.parentId}
</if>
ORDER BY
ui.createTime
</select>
<select id="selectStaffPage" resultType="cn.pluss.platform.vo.AgentStaffVO">
SELECT loginName, userId, parentId, userName, createTime, phone, agentName, agentPhone FROM (
SELECT
ui.loginName, ua.userId, ua.parentId, ua.userName, ua.createDt createTime, ui.phone
, ua1.userName agentName, ui1.phone agentPhone
FROM tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui ON ua.userId = ui.id
LEFT JOIN tb_pluss_user_app ua1 ON ua.parentId = ua1.userId
LEFT JOIN tb_pluss_user_info ui1 ON ui1.id = ua1.userId
WHERE ua.userType = 'agent_staff'
) t
<where>
<if test="agentStaffVO.userId != null and agentStaffVO.userId != ''">
t.userId = #{agentStaffVO.userId}
</if>
<if test="agentStaffVO.loginName != null and agentStaffVO.loginName != ''">
t.loginName = #{agentStaffVO.loginName}
</if>
<if test="agentStaffVO.userName != null and agentStaffVO.userName != ''">
t.userName LIKE CONCAT('%', #{agentStaffVO.userName},'%')
</if>
<if test="agentStaffVO.phone != null and agentStaffVO.phone != ''">
t.phone LIKE CONCAT('%',#{agentStaffVO.phone},'%')
</if>
<if test="agentStaffVO.parentId != null and agentStaffVO.parentId != ''">
t.parentId =#{agentStaffVO.parentId}
</if>
<if test="agentStaffVO.agentName != null and agentStaffVO.agentName != ''">
t.agentName LIKE CONCAT('%', #{agentStaffVO.agentName},'%')
</if>
<if test="agentStaffVO.agentPhone != null and agentStaffVO.agentPhone != ''">
t.agentPhone LIKE CONCAT('%',#{agentStaffVO.agentPhone},'%')
</if>
</where>
</select>
<sql id="commonWhere">
<if test="agentInfo.userId != null and agentInfo.userId != ''">
AND ua.userId = #{agentInfo.userId}
</if>
<if test="agentInfo.loginName != null and agentInfo.loginName != ''">
AND ui.loginName LIKE CONCAT("%", #{agentInfo.loginName}, "%")
</if>
<if test="agentInfo.phone != null and agentInfo.phone != ''">
AND ui.phone LIKE CONCAT("%", #{agentInfo.phone}, "%")
</if>
<if test="agentInfo.userName != null and agentInfo.userName != ''">
AND ua.userName LIKE #{agentInfo.userName}
</if>
<if test="agentInfo.isFixedRate == '1'.toString() ">
AND ua.isFixedRate = '1'
</if>
<if test="agentInfo.isFixedRate == '0'.toString() ">
AND (ua.isFixedRate is null or ua.isFixedRate = '0')
</if>
<if test="agentInfo.rate != null and agentInfo.rate != ''">
AND mr.rate LIKE #{agentInfo.rate}
</if>
<if test="agentInfo.autoAudit != null and agentInfo.autoAudit != ''">
<choose>
<when test="agentInfo.autoAudit == '1'.toString()">
AND ua.autoAudit = '1'
</when>
<otherwise>
AND (ua.autoAudit = '0' OR ua.autoAudit IS NULL)
</otherwise>
</choose>
</if>
<if test="agentInfo.payEcdemicSwitch != null and agentInfo.payEcdemicSwitch != ''">
<choose>
<when test="agentInfo.payEcdemicSwitch == '1'.toString()">
AND ua.payEcdemicSwitch = '1'
</when>
<otherwise>
AND ua.payEcdemicSwitch = '0'
</otherwise>
</choose>
</if>
<if test="agentInfo.isMarket != null and agentInfo.isMarket != ''">
<choose>
<when test="agentInfo.isMarket == '1'.toString()">
AND ua.isMarket = '1'
</when>
<otherwise>
AND (ua.isMarket = '0' OR ua.isMarket IS NULL)
</otherwise>
</choose>
</if>
<if test="agentInfo.isUnionPay != null and agentInfo.isUnionPay != ''">
<choose>
<when test="agentInfo.isUnionPay == '1'.toString()">
AND ua.isUnionPay = '1'
</when>
<otherwise>
AND (ua.isUnionPay = '0' OR ua.isUnionPay IS NULL)
</otherwise>
</choose>
</if>
</sql>
</mapper>

View File

@@ -0,0 +1,73 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.AgentMapper">
<select id="selectPage" resultType="cn.pluss.platform.vo.AgentInfo">
SELECT
ua.userId,
ui.loginName,
mr.rate,
ui.phone,
ui.STATUS,
ua.userName,
ui.createTime,
ui.updateTime
FROM
tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui ON ua.userId = ui.id
LEFT JOIN tb_pluss_merchant_rate mr ON ua.userId = mr.userId
WHERE
ua.userType = 'agent'
<include refid="commonWhere"/>
ORDER BY
ui.createTime
</select>
<select id="selectOne" resultType="cn.pluss.platform.vo.AgentInfo">
SELECT ua.userId, ui.loginName, mr.rate, ui.phone, ui.status, ua.userName, ui.createTime,
ui.updateTime,pc.cashAmt
FROM tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui
ON ua.userId = ui.id
LEFT JOIN tb_pluss_merchant_rate mr
ON ua.userId=mr.userId
LEFT JOIN tb_pluss_cash pc
ON ua.userId = pc.userId
WHERE ua.userType = 'agent'
<include refid="commonWhere"/>
LIMIT 1
</select>
<sql id="commonWhere">
<if test="agentInfo.userId != null and agentInfo.userId != ''">
AND ua.userId = #{agentInfo.userId}
</if>
<if test="agentInfo.loginName != null and agentInfo.loginName != ''">
AND ui.loginName LIKE CONCAT("%", #{agentInfo.loginName}, "%")
</if>
<if test="agentInfo.parentId != null">
AND ua.parentId = #{agentInfo.parentId}
</if>
<if test="agentInfo.phone != null and agentInfo.phone != ''">
AND ui.phone LIKE CONCAT("%", #{agentInfo.phone}, "%")
</if>
<if test="agentInfo.userName != null and agentInfo.userName != ''">
AND ua.userName LIKE #{agentInfo.userName}
</if>
<if test="agentInfo.createTimeStart != null">
AND ui.createTime &gt; #{agentInfo.createTimeStart}
</if>
<if test="agentInfo.createTimeEnd != null">
AND ui.createTime &lt;= #{agentInfo.createTimeEnd}
</if>
<if test="agentInfo.updateTimeStart != null">
AND ui.updateTime &gt; #{agentInfo.updateTimeStart}
</if>
<if test="agentInfo.updateTimeEnd != null">
AND ui.updateTime &lt;= #{agentInfo.updateTimeEnd}
</if>
<if test="agentInfo.rate != null and agentInfo.rate != ''">
AND mr.rate = #{agentInfo.rate}
</if>
</sql>
</mapper>

View File

@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.AgreementMapper">
<insert id="saveAgreement" parameterType="cn.pluss.platform.entity.Agreement">
insert into tb_pluss_agreement(name,content,createDt,createor,discern)VALUES(#{name},#{content},now(),#{createor},#{discern})
</insert>
<insert id="saveAgreementBatch">
insert into tb_pluss_agreement(name,content,createDt,createor,discern) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{name},#{content},now(),#{createor},#{discern} )
</foreach>
</insert>
<select id="queryAgreement" parameterType="cn.pluss.platform.entity.Agreement" resultType="cn.pluss.platform.entity.Agreement">
SELECT * from tb_pluss_agreement
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="createor!= null">
and createor = #{createor}
</if>
<if test="discern!= null">
and discern = #{discern}
</if>
</where>
</select>
<select id="queryAgreementList" parameterType="cn.pluss.platform.entity.Agreement" resultType="cn.pluss.platform.entity.Agreement">
SELECT * from tb_pluss_agreement
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="createor!= null">
and createor = #{createor}
</if>
<if test="discern!= null">
and discern = #{discern}
</if>
</where>
</select>
<update id="updateAgreement" parameterType="cn.pluss.platform.entity.Agreement" >
update tb_pluss_agreement
<set>
<if test="name!= null">
name = #{name},
</if>
<if test="content!= null">
content = #{content},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="createor!= null">
createor = #{createor},
</if>
<if test="discern!= null">
discern = #{discern}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteAgreement" parameterType="cn.pluss.platform.entity.Agreement" >
DELETE FROM tb_pluss_agreement where id=#{id}
</delete>
<select id="queryAgreementPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.Agreement">
SELECT * from tb_pluss_agreement
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name like CONCAT("%",#{name},"%")
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="createor!= null">
and createor = #{createor}
</if>
<if test="discern!= null">
and discern = #{discern}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryAgreementPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_agreement
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name like CONCAT("%",#{name},"%")
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="createor!= null">
and createor = #{createor}
</if>
<if test="discern!= null">
and discern = #{discern}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.AliMccMapper">
<insert id="saveAliMcc" parameterType="cn.pluss.platform.entity.AliMcc">
insert into tb_pluss_ali_mcc(mccCode)VALUES(#{mccCode})
</insert>
<insert id="saveAliMccBatch">
insert into tb_pluss_ali_mcc(mccCode) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{mccCode} )
</foreach>
</insert>
<select id="queryAliMcc" parameterType="cn.pluss.platform.entity.AliMcc" resultType="cn.pluss.platform.entity.AliMcc">
SELECT * from tb_pluss_ali_mcc
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="mccCode!= null">
and mccCode = #{mccCode}
</if>
</where>
</select>
<select id="queryAliMccList" parameterType="cn.pluss.platform.entity.AliMcc" resultType="cn.pluss.platform.entity.AliMcc">
SELECT * from tb_pluss_ali_mcc
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="mccCode!= null">
and mccCode = #{mccCode}
</if>
</where>
</select>
<update id="updateAliMcc" parameterType="cn.pluss.platform.entity.AliMcc" >
update tb_pluss_ali_mcc
<set>
<if test="mccCode!= null">
mccCode = #{mccCode}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteAliMcc" parameterType="cn.pluss.platform.entity.AliMcc" >
DELETE FROM tb_pluss_ali_mcc where id=#{id}
</delete>
<select id="queryAliMccPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.AliMcc">
SELECT * from tb_pluss_ali_mcc
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="mccCode!= null">
and mccCode = #{mccCode}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryAliMccPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_ali_mcc
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="mccCode!= null">
and mccCode = #{mccCode}
</if>
</where>
</select>
<select id="queryMccCode" resultType="java.lang.String">
select mccCode from tb_pluss_ali_mcc where mccCode like CONCAT("%",#{mccCode})
</select>
</mapper>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.AppGuideMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.AppGuide">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="name" property="name" />
<result column="content" property="content" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.AppMenuMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.AppMenu">
<id column="id" property="id" />
<result column="menu_group" property="menuGroup" />
<result column="name" property="name" />
<result column="code" property="code" />
<result column="icon" property="icon" />
<result column="nav_code" property="navCode" />
<result column="nav_name" property="navName" />
<result column="url" property="url" />
<result column="sort" property="sort" />
<result column="visible" property="visible" />
<result column="create_time" property="createTime" />
<result column="update_time" property="updateTime" />
<result column="isApplets" property="isApplets"/>
<result column="isUniapp" property="isUniapp"/>
<result column="userName" property="userName" />
<result column="path" property="path" />
<result column="isAndroidEnabled" property="isAndroidEnabled"/>
<result column="isIphoneEnabled" property="isIphoneEnabled"/>
</resultMap>
<select id="getByNavCodeAll" resultType="cn.pluss.platform.entity.AppMenu">
SELECT appMenu.id, appMenu.menu_group menuGroup, appMenu.name, appMenu.code, appMenu.icon,
appMenu.nav_code navCode, appMenu.nav_name navName, appMenu.url, appMenu.sort, appMenu.visible,
appMenu.create_time createTime, appMenu.update_time updateTime, dict.name menuGroupDesc,
appMenu.isApplets, appMenu.userName,appMenu.path, appMenu.isUniapp
FROM tb_pluss_app_menu appMenu
LEFT JOIN tb_pluss_dict dict ON appMenu.menu_group = dict.id
LEFT JOIN tb_pluss_app_menu_user_type amut ON amut.`name` = appMenu.`name`
WHERE appMenu.nav_code = #{navCode} AND amut.dictValue = #{userType}
ORDER BY dict.sort, appMenu.sort
</select>
<select id="getByNavCode" resultType="cn.pluss.platform.entity.AppMenu">
SELECT appMenu.id, appMenu.menu_group menuGroup, appMenu.name, appMenu.code, appMenu.icon,
appMenu.nav_code navCode, appMenu.nav_name navName, appMenu.url, appMenu.sort, appMenu.visible,
appMenu.create_time createTime, appMenu.update_time updateTime, dict.name menuGroupDesc,
appMenu.isApplets, appMenu.userName,appMenu.path, appMenu.isUniapp
FROM tb_pluss_app_menu appMenu
LEFT JOIN tb_pluss_dict dict ON appMenu.menu_group = dict.id
LEFT JOIN tb_pluss_app_menu_user_type amut ON amut.`name` = appMenu.`name`
WHERE appMenu.visible = 1 AND appMenu.nav_code = #{navCode} AND amut.dictValue = #{userType}
<if test="_parameter.containsKey('clientType')">
<choose>
<when test="clientType == 1">
and appMenu.isAndroidEnabled = '1'
</when>
<otherwise>
and appMenu.isIphoneEnabled = '1'
</otherwise>
</choose>
</if>
ORDER BY dict.sort, appMenu.sort
</select>
</mapper>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.AppVersionInfoMapper">
<select id="pageData" resultType="cn.pluss.platform.entity.AppVersionInfo">
select id,platformCode,platformName,versionCode,versionName,url,updateInfo,forceUpdate,createTime,updateTime
from tb_pluss_app_version_info
order by case
when platformCode=1 then 0 else 1
END,createTime desc
</select>
</mapper>

View 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="cn.pluss.platform.mapper.AppletInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.AppletInfo">
<id column="id" property="id" />
<result column="appid" property="appid" />
<result column="secret" property="secret" />
<result column="remark" property="remark" />
<result column="createTime" property="createTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.AreaMapper">
<resultMap type="cn.pluss.platform.leshua.LeshuaArea" id="area">
<result property="code" column="f_area_no" ></result>
<result property="name" column="f_area_name" jdbcType="VARCHAR"></result>
</resultMap>
<insert id="saveArea" parameterType="cn.pluss.platform.entity.Area">
insert into tb_pluss_area(f_area_no,f_area_name,f_aliasa,f_area_cups_no,f_city_no,f_x,f_y)VALUES(#{f_area_no},#{f_area_name},#{f_aliasa},#{f_area_cups_no},#{f_city_no},#{f_x},#{f_y})
</insert>
<insert id="saveAreaBatch">
insert into tb_pluss_area(f_area_no,f_area_name,f_aliasa,f_area_cups_no,f_city_no,f_x,f_y) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{f_area_no},#{f_area_name},#{f_aliasa},#{f_area_cups_no},#{f_city_no},#{f_x},#{f_y} )
</foreach>
</insert>
<select id="queryArea" parameterType="cn.pluss.platform.entity.Area" resultMap="area">
SELECT * from tb_pluss_area
<where>
<if test="f_area_no!= null">
and f_area_no = #{f_area_no}
</if>
<if test="f_area_name!= null">
and f_area_name = #{f_area_name}
</if>
<if test="f_aliasa!= null">
and f_aliasa = #{f_aliasa}
</if>
<if test="f_area_cups_no!= null">
and f_area_cups_no = #{f_area_cups_no}
</if>
<if test="f_city_no!= null">
and f_city_no = #{f_city_no}
</if>
<if test="f_x!= null">
and f_x = #{f_x}
</if>
<if test="f_y!= null">
and f_y = #{f_y}
</if>
</where>
</select>
<select id="queryAreaList" parameterType="cn.pluss.platform.entity.Area" resultMap="area">
SELECT * from tb_pluss_area
<where>
<if test="f_area_no!= null">
and f_area_no = #{f_area_no}
</if>
<if test="f_area_name!= null">
and f_area_name = #{f_area_name}
</if>
<if test="f_aliasa!= null">
and f_aliasa = #{f_aliasa}
</if>
<if test="f_area_cups_no!= null">
and f_area_cups_no = #{f_area_cups_no}
</if>
<if test="f_city_no!= null">
and f_city_no = #{f_city_no}
</if>
<if test="f_x!= null">
and f_x = #{f_x}
</if>
<if test="f_y!= null">
and f_y = #{f_y}
</if>
</where>
</select>
<update id="updateArea" parameterType="cn.pluss.platform.entity.Area" >
update tb_pluss_area
<set>
<if test="f_area_no!= null">
f_area_no = #{f_area_no},
</if>
<if test="f_area_name!= null">
f_area_name = #{f_area_name},
</if>
<if test="f_aliasa!= null">
f_aliasa = #{f_aliasa},
</if>
<if test="f_area_cups_no!= null">
f_area_cups_no = #{f_area_cups_no},
</if>
<if test="f_city_no!= null">
f_city_no = #{f_city_no},
</if>
<if test="f_x!= null">
f_x = #{f_x},
</if>
<if test="f_y!= null">
f_y = #{f_y}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteArea" parameterType="cn.pluss.platform.entity.Area" >
DELETE FROM tb_pluss_area where id=#{id}
</delete>
<select id="queryAreaPage" parameterType="java.util.Map" resultMap="area">
SELECT * from tb_pluss_area
<where>
<if test="f_area_no!= null">
and f_area_no = #{f_area_no}
</if>
<if test="f_area_name!= null">
and f_area_name = #{f_area_name}
</if>
<if test="f_aliasa!= null">
and f_aliasa = #{f_aliasa}
</if>
<if test="f_area_cups_no!= null">
and f_area_cups_no = #{f_area_cups_no}
</if>
<if test="f_city_no!= null">
and f_city_no = #{f_city_no}
</if>
<if test="f_x!= null">
and f_x = #{f_x}
</if>
<if test="f_y!= null">
and f_y = #{f_y}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryAreaPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_area
<where>
<if test="f_area_no!= null">
and f_area_no = #{f_area_no}
</if>
<if test="f_area_name!= null">
and f_area_name = #{f_area_name}
</if>
<if test="f_aliasa!= null">
and f_aliasa = #{f_aliasa}
</if>
<if test="f_area_cups_no!= null">
and f_area_cups_no = #{f_area_cups_no}
</if>
<if test="f_city_no!= null">
and f_city_no = #{f_city_no}
</if>
<if test="f_x!= null">
and f_x = #{f_x}
</if>
<if test="f_y!= null">
and f_y = #{f_y}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,81 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.AreaCityMapper">
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.AreaCity">
<id column="id" property="id" />
<result column="type" property="type" />
<result column="areaName" property="areaName" />
<result column="parentAreaCode" property="parentAreaCode" />
<result column="areaCode" property="areaCode" />
<collection property="areaCityList" column="areaCode" ofType="java.util.HashMap" select="queryCity"/>
</resultMap>
<resultMap id="cityMap" type="cn.pluss.platform.entity.AreaCity">
<id column="id" property="id" />
<result column="type" property="type" />
<result column="areaName" property="areaName" />
<result column="parentAreaCode" property="parentAreaCode" />
<result column="areaCode" property="areaCode" />
<collection property="areaCityList" column="areaCode" ofType="java.util.HashMap" select="queryCountry"/>
</resultMap>
<sql id="ref_column">
id,type,areaName,parentAreaCode,areaCode
</sql>
<!--查询所有省 -->
<select id="queryProvince" resultMap="BaseResultMap">
select <include refid="ref_column" /> from tb_pluss_area_city where type = 1
</select>
<select id="queryOnlyProvince" resultType="cn.pluss.platform.entity.AreaCity">
select <include refid="ref_column" /> from tb_pluss_area_city where type = 1
</select>
<!--查询所有市 -->
<select id="queryCity" resultMap="cityMap">
select <include refid="ref_column" /> from tb_pluss_area_city where parentAreaCode=#{areaCode}
</select>
<!--查询所有区 -->
<select id="queryCountry" resultType="cn.pluss.platform.entity.AreaCity">
select <include refid="ref_column" /> from tb_pluss_area_city where parentAreaCode = #{areaCode}
</select>
<select id="getAreaCityByProvince" resultMap="BaseResultMap">
select <include refid="ref_column" /> from tb_pluss_area_city where areaCode = #{areaCode}
</select>
<select id="getAreaCodeByName" parameterType="java.lang.String" resultType="java.util.Map">
SELECT a.areaCode AS provinceCode
<choose>
<when test="type == 1">
,b.areaCode AS cityCode
</when>
<otherwise>
,a.areaCode AS cityCode
</otherwise>
</choose>
<choose>
<when test="type == 1">
,c.areaCode as areaCode
</when>
<otherwise>
,b.areaCode AS areaCode
</otherwise>
</choose>
FROM tb_pluss_area_city a
LEFT JOIN tb_pluss_area_city b on a.areaCode = b.parentAreaCode
<if test="type == 1">
LEFT JOIN tb_pluss_area_city c ON b.areaCode = c.parentAreaCode
</if>
WHERE a.areaName = #{provinceName}
and b.areaName = #{cityName}
<if test="type == 1">
AND c.areaName = #{areaName}
</if>
</select>
</mapper>

View 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="cn.pluss.platform.mapper.BankCardMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.BankCard">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="bankCardNo" property="bankCardNo" />
<result column="bankName" property="bankName" />
<result column="branchName" property="branchName" />
<result column="accountType" property="accountType" />
<result column="contactLine" property="contactLine" />
<result column="branchProvince" property="branchProvince" />
<result column="branchCity" property="branchCity" />
<result column="branchArea" property="branchArea" />
<result column="phone" property="phone" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,23 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.BankCodeSxfMapper">
<select id="getBranchName" resultType="cn.pluss.platform.leshua.BankNameVO">
SELECT cnaps_code unionpayCode , cnaps_name branchName
FROM tb_pluss_bank_code_sxf
<where>
<if test="bankName != null and bankName != ''">
AND cnaps_name like CONCAT(#{bankName}, "%")
</if>
<if test="areaCode != null and areaCode != ''">
AND city_name like CONCAT(#{areaCode}, "%")
</if>
<if test="provinceCode != null and provinceCode != ''">
AND province_name like CONCAT(#{provinceCode}, "%")
</if>
<if test="branchName!=null and branchName!=''">
AND cnaps_name like CONCAT("%",#{branchName},"%")
</if>
</where>
</select>
</mapper>

View 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="cn.pluss.platform.mapper.BankCodeYsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.BankCodeYs">
<result column="contactLine" property="contactLine" />
<result column="branchName" property="branchName" />
<result column="bankType" property="bankType" />
<result column="bankName" property="bankName" />
<result column="cityCode" property="cityCode" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,229 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.BankUnionpayCodeMapper">
<insert id="saveBankUnionpayCode" parameterType="cn.pluss.platform.entity.BankUnionpayCode">
insert into tb_pluss_bank_unionpay_code(f_bank_area,f_bank_city,f_cft_area_code,f_cft_city_code,f_unionpay_code,f_branch_name,f_bank_name,f_x,f_y)VALUES(#{f_bank_area},#{f_bank_city},#{f_cft_area_code},#{f_cft_city_code},#{f_unionpay_code},#{f_branch_name},#{f_bank_name},#{f_x},#{f_y})
</insert>
<insert id="saveBankUnionpayCodeBatch">
insert into tb_pluss_bank_unionpay_code(f_bank_area,f_bank_city,f_cft_area_code,f_cft_city_code,f_unionpay_code,f_branch_name,f_bank_name,f_x,f_y) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{f_bank_area},#{f_bank_city},#{f_cft_area_code},#{f_cft_city_code},#{f_unionpay_code},#{f_branch_name},#{f_bank_name},#{f_x},#{f_y} )
</foreach>
</insert>
<select id="queryBankUnionpayCode" parameterType="cn.pluss.platform.entity.BankUnionpayCode" resultType="cn.pluss.platform.entity.BankUnionpayCode">
SELECT * from tb_pluss_bank_unionpay_code
<where>
<if test="f_bank_area!= null">
and f_bank_area = #{f_bank_area}
</if>
<if test="f_bank_city!= null">
and f_bank_city = #{f_bank_city}
</if>
<if test="f_cft_area_code!= null">
and f_cft_area_code = #{f_cft_area_code}
</if>
<if test="f_cft_city_code!= null">
and f_cft_city_code = #{f_cft_city_code}
</if>
<if test="f_unionpay_code!= null">
and f_unionpay_code = #{f_unionpay_code}
</if>
<if test="f_branch_name!= null">
and f_branch_name = #{f_branch_name}
</if>
<if test="f_bank_name!= null">
and f_bank_name = #{f_bank_name}
</if>
<if test="f_x!= null">
and f_x = #{f_x}
</if>
<if test="f_y!= null">
and f_y = #{f_y}
</if>
</where>
</select>
<select id="queryBankUnionpayCodeList" parameterType="cn.pluss.platform.entity.BankUnionpayCode" resultType="cn.pluss.platform.entity.BankUnionpayCode">
SELECT * from tb_pluss_bank_unionpay_code
<where>
<if test="f_bank_area!= null">
and f_bank_area = #{f_bank_area}
</if>
<if test="f_bank_city!= null">
and f_bank_city = #{f_bank_city}
</if>
<if test="f_cft_area_code!= null">
and f_cft_area_code = #{f_cft_area_code}
</if>
<if test="f_cft_city_code!= null">
and f_cft_city_code = #{f_cft_city_code}
</if>
<if test="f_unionpay_code!= null">
and f_unionpay_code = #{f_unionpay_code}
</if>
<if test="f_branch_name!= null">
and f_branch_name = #{f_branch_name}
</if>
<if test="f_bank_name!= null">
and f_bank_name = #{f_bank_name}
</if>
<if test="f_x!= null">
and f_x = #{f_x}
</if>
<if test="f_y!= null">
and f_y = #{f_y}
</if>
</where>
</select>
<update id="updateBankUnionpayCode" parameterType="cn.pluss.platform.entity.BankUnionpayCode" >
update tb_pluss_bank_unionpay_code
<set>
<if test="f_bank_area!= null">
f_bank_area = #{f_bank_area},
</if>
<if test="f_bank_city!= null">
f_bank_city = #{f_bank_city},
</if>
<if test="f_cft_area_code!= null">
f_cft_area_code = #{f_cft_area_code},
</if>
<if test="f_cft_city_code!= null">
f_cft_city_code = #{f_cft_city_code},
</if>
<if test="f_unionpay_code!= null">
f_unionpay_code = #{f_unionpay_code},
</if>
<if test="f_branch_name!= null">
f_branch_name = #{f_branch_name},
</if>
<if test="f_bank_name!= null">
f_bank_name = #{f_bank_name},
</if>
<if test="f_x!= null">
f_x = #{f_x},
</if>
<if test="f_y!= null">
f_y = #{f_y}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteBankUnionpayCode" parameterType="cn.pluss.platform.entity.BankUnionpayCode" >
DELETE FROM tb_pluss_bank_unionpay_code where id=#{id}
</delete>
<select id="queryBankUnionpayCodePage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.BankUnionpayCode">
SELECT * from tb_pluss_bank_unionpay_code
<where>
<if test="f_bank_area!= null">
and f_bank_area = #{f_bank_area}
</if>
<if test="f_bank_city!= null">
and f_bank_city = #{f_bank_city}
</if>
<if test="f_cft_area_code!= null">
and f_cft_area_code = #{f_cft_area_code}
</if>
<if test="f_cft_city_code!= null">
and f_cft_city_code = #{f_cft_city_code}
</if>
<if test="f_unionpay_code!= null">
and f_unionpay_code = #{f_unionpay_code}
</if>
<if test="f_branch_name!= null">
and f_branch_name = #{f_branch_name}
</if>
<if test="f_bank_name!= null">
and f_bank_name = #{f_bank_name}
</if>
<if test="f_x!= null">
and f_x = #{f_x}
</if>
<if test="f_y!= null">
and f_y = #{f_y}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryBankUnionpayCodePageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_bank_unionpay_code
<where>
<if test="f_bank_area!= null">
and f_bank_area = #{f_bank_area}
</if>
<if test="f_bank_city!= null">
and f_bank_city = #{f_bank_city}
</if>
<if test="f_cft_area_code!= null">
and f_cft_area_code = #{f_cft_area_code}
</if>
<if test="f_cft_city_code!= null">
and f_cft_city_code = #{f_cft_city_code}
</if>
<if test="f_unionpay_code!= null">
and f_unionpay_code = #{f_unionpay_code}
</if>
<if test="f_branch_name!= null">
and f_branch_name = #{f_branch_name}
</if>
<if test="f_bank_name!= null">
and f_bank_name = #{f_bank_name}
</if>
<if test="f_x!= null">
and f_x = #{f_x}
</if>
<if test="f_y!= null">
and f_y = #{f_y}
</if>
</where>
</select>
<!--查询银行 -->
<select id="getBankNameList" resultType="java.lang.String">
select F_bank_name from tb_pluss_bank_unionpay_code GROUP BY F_bank_name
</select>
<resultMap type="cn.pluss.platform.leshua.ProvinceVO" id="provinceVO">
<result property="provinceCode" column="F_cft_area_code" jdbcType="VARCHAR"></result>
<result property="provinceName" column="F_bank_area" jdbcType="VARCHAR"></result>
</resultMap>
<resultMap type="cn.pluss.platform.leshua.CityVO" id="cityVO">
<result property="cityCode" column="F_cft_city_code" jdbcType="VARCHAR"></result>
<result property="cityName" column="F_bank_city" jdbcType="VARCHAR"></result>
</resultMap>
<resultMap type="cn.pluss.platform.leshua.BankNameVO" id="bankNameVO">
<result property="unionpayCode" column="F_unionpay_code" jdbcType="VARCHAR"></result>
<result property="branchName" column="F_branch_name" jdbcType="VARCHAR"></result>
</resultMap>
<!-- 省份 -->
<select id="getProvince" resultMap="provinceVO">
select F_cft_area_code,F_bank_area from(select F_cft_area_code,F_bank_area from tb_pluss_bank_unionpay_code order by (F_cft_area_code+0) ASC)a GROUP BY (a.f_cft_area_code+0)
</select>
<!--省下面的市 -->
<select id="getCity" resultMap="cityVO">
SELECT F_cft_city_code,F_bank_city FROM tb_pluss_bank_unionpay_code WHERE F_cft_area_code=#{provinceCode} GROUP BY F_cft_city_code
</select>
<!--根据选择的银行,省,市 查下面的支行 -->
<select id="getBranchName" resultMap="bankNameVO">
SELECT F_unionpay_code,F_branch_name from tb_pluss_bank_unionpay_code WHERE F_branch_name like CONCAT(#{bankName}, "%", #{areaCode}, "%")
<if test="brankName!=null and brankName!=''">
AND
F_branch_name like CONCAT("%",#{brankName},"%")
</if>
GROUP BY F_unionpay_code
</select>
</mapper>

View File

@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.BannerMapper">
<insert id="saveBanner" parameterType="cn.pluss.platform.entity.Banner">
insert into tb_pluss_banner(picUrl,seq,jumpUrl,type)VALUES(#{picUrl},#{seq},#{jumpUrl},#{type})
</insert>
<insert id="saveBannerBatch">
insert into tb_pluss_banner(picUrl,seq,jumpUrl,type) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{picUrl},#{seq},#{jumpUrl},#{type} )
</foreach>
</insert>
<select id="queryBanner" parameterType="cn.pluss.platform.entity.Banner" resultType="cn.pluss.platform.entity.Banner">
SELECT * from tb_pluss_banner
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="picUrl!= null">
and picUrl = #{picUrl}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
<if test="jumpUrl!= null">
and jumpUrl = #{jumpUrl}
</if>
<if test="type!= null">
and type = #{type}
</if>
</where>
</select>
<select id="queryBannerList" parameterType="cn.pluss.platform.entity.Banner" resultType="cn.pluss.platform.entity.Banner">
SELECT * from tb_pluss_banner
<where>
(`status` != '0' OR `status` IS NULL)
<if test="id!= null">
and id = #{id}
</if>
<if test="picUrl!= null">
and picUrl = #{picUrl}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
<if test="jumpUrl!= null">
and jumpUrl = #{jumpUrl}
</if>
<if test="type!= null">
and type = #{type}
</if>
</where>
</select>
<update id="updateBanner" parameterType="cn.pluss.platform.entity.Banner" >
update tb_pluss_banner
<set>
<if test="picUrl!= null">
picUrl = #{picUrl},
</if>
<if test="seq!= null">
seq = #{seq},
</if>
<if test="jumpUrl!= null">
jumpUrl = #{jumpUrl},
</if>
<if test="type!= null">
type = #{type}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteBanner" parameterType="cn.pluss.platform.entity.Banner" >
DELETE FROM tb_pluss_banner where id=#{id}
</delete>
<select id="queryBannerPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.Banner">
SELECT * from tb_pluss_banner
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="picUrl!= null">
and picUrl = #{picUrl}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
<if test="jumpUrl!= null">
and jumpUrl = #{jumpUrl}
</if>
<if test="type!= null">
and type = #{type}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryBannerPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_banner
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="picUrl!= null">
and picUrl = #{picUrl}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
<if test="jumpUrl!= null">
and jumpUrl = #{jumpUrl}
</if>
<if test="type!= null">
and type = #{type}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,166 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.BestNewActivityMapper">
<insert id="saveBestNewActivity" parameterType="cn.pluss.platform.entity.BestNewActivity">
insert into tb_pluss_best_new_activity(title, content, updateTime, updateor, seq, status)
VALUES (#{title}, #{content}, #{updateTime}, #{updateor}, #{seq}, #{status})
</insert>
<insert id="saveBestNewActivityBatch">
insert into tb_pluss_best_new_activity(title,content,updateTime,updateor) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{title},#{content},#{updateTime},#{updateor} )
</foreach>
</insert>
<select id="queryBestNewActivity" parameterType="cn.pluss.platform.entity.BestNewActivity"
resultType="cn.pluss.platform.entity.BestNewActivity">
SELECT * from tb_pluss_best_new_activity
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="title!= null">
and title = #{title}
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="updateTime!= null">
and updateTime = #{updateTime}
</if>
<if test="updateor!= null">
and updateor = #{updateor}
</if>
<if test="status!= null">
and status = #{status}
</if>
</where>
</select>
<select id="queryBestNewActivityList" parameterType="cn.pluss.platform.entity.BestNewActivity"
resultType="cn.pluss.platform.entity.BestNewActivity">
SELECT * from tb_pluss_best_new_activity
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="title!= null">
and title = #{title}
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="updateTime!= null">
and updateTime = #{updateTime}
</if>
<if test="updateor!= null">
and updateor = #{updateor}
</if>
<if test="status!= null">
and status = #{status}
</if>
</where>
</select>
<update id="updateBestNewActivity" parameterType="cn.pluss.platform.entity.BestNewActivity">
update tb_pluss_best_new_activity
<set>
<if test="title!= null">
title = #{title},
</if>
<if test="content!= null">
content = #{content},
</if>
<if test="seq!= null">
seq = #{seq},
</if>
<if test="updateTime!= null">
updateTime = #{updateTime},
</if>
<if test="updateor!= null">
updateor = #{updateor},
</if>
<if test="status!= null">
status = #{status}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteBestNewActivity" parameterType="cn.pluss.platform.entity.BestNewActivity">
DELETE
FROM tb_pluss_best_new_activity
where id = #{id}
</delete>
<select id="queryBestNewActivityPage" parameterType="java.util.Map"
resultType="cn.pluss.platform.entity.BestNewActivity">
SELECT bna.*, IF(nrr.id IS NULL, 0, 1) readStatus from tb_pluss_best_new_activity bna
LEFT JOIN tb_pluss_notice_read_record nrr ON nrr.noticeId = bna.id
<if test="userId != null">
AND nrr.userId = #{userId}
</if>
<where>
<if test="type != null">
FIND_IN_SET(#{type}, bna.`type`)
</if>
<if test="id!= null">
AND id = #{id}
</if>
<if test="seq!= null">
AND seq = #{seq}
</if>
<if test="title!= null">
AND title LIKE CONCAT("%",#{title},"%")
</if>
<if test="content!= null">
AND content = #{content}
</if>
<if test="updateTime!= null">
AND updateTime = #{updateTime}
</if>
<if test="updateor!= null">
AND updateor = #{updateor}
</if>
<if test="status!= null">
AND status = #{status}
</if>
</where>
ORDER BY seq IS NULL, bna.updateTime DESC LIMIT #{pageSize} OFFSET #{offset}
</select>
<select id="queryBestNewActivityPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_best_new_activity
<where>
<if test="type != null">
FIND_IN_SET(#{type}, `type`)
</if>
<if test="id!= null">
and id = #{id}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
<if test="title!= null">
and title LIKE CONCAT("%",#{title},"%")
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="updateTime!= null">
and updateTime = #{updateTime}
</if>
<if test="updateor!= null">
and updateor = #{updateor}
</if>
<if test="status!= null">
and status = #{status}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,416 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.BillStatisticsMapper">
<select id="selectBillStatistics" resultType="cn.pluss.platform.vo.BillStatisticsVO">
SELECT * FROM (
SELECT
IFNULL( COUNT( IF ( `status` = '1', 1, NULL ) ), 0) allOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), 1, NULL ) ), 0) wxOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), 1, NULL ) ), 0) aliOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), 1, NULL ) ), 0) bankOrderCount,
IFNULL( COUNT( IF ( `status` = '2', 1, NULL ) ), 0) allRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), 1, NULL ) ), 0) wxRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), 1, NULL ) ), 0) aliRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), 1, NULL ) ), 0) bankRefundOrderCount,
IFNULL( SUM( IF ( `status` = '1', consumeFee, - consumeFee ) ), 0.00 ) allInMoney,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ), 0.00 ) wxInMoney,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ), 0.00 ) aliInMoney,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ), 0.00 ) bankInMoney,
IFNULL( SUM( IF ( `status` = 1, marketAmt, - marketAmt ) ), 0.00 ) allSubsidy,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ), 0.00 ) wxSubsidy,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ), 0.00 ) aliSubsidy,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ), 0.00 ) bankSubsidy,
IFNULL( SUM( IF ( `status` = 1, enterFee, - enterFee ) ), 0.00 ) allInAccount,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', enterFee, - enterFee ), 0.00 ) ), 0.00 ) wxInAccount,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1',enterFee, - enterFee ), 0.00 ) ), 0.00 ) aliInAccount,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', enterFee, - enterFee ), 0.00 ) ), 0.00 ) bankInAccount,
#{startDate} startDate,
#{endDate} endDate,
"汇总" billName
FROM
tb_pluss_merchant_order
WHERE
`status` IN ( '1', '2' )
AND merchantCode = #{merchantCode}
AND createDt BETWEEN #{startDate} AND #{endDate}
UNION
SELECT
IFNULL( COUNT( IF ( `status` = '1', 1, NULL ) ), 0) allOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), 1, NULL ) ), 0) wxOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), 1, NULL ) ), 0) aliOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), 1, NULL ) ), 0) bankOrderCount,
IFNULL( COUNT( IF ( `status` = '2', 1, NULL ) ), 0) allRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), 1, NULL ) ), 0) wxRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), 1, NULL ) ), 0) aliRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), 1, NULL ) ), 0) bankRefundOrderCount,
IFNULL( SUM( IF ( `status` = '1', consumeFee, - consumeFee ) ), 0.00 ) allInMoney,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ), 0.00 ) wxInMoney,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ), 0.00 ) aliInMoney,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ), 0.00 ) bankInMoney,
IFNULL( SUM( IF ( `status` = 1, marketAmt, - marketAmt ) ), 0.00 ) allSubsidy,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ), 0.00 ) wxSubsidy,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ), 0.00 ) aliSubsidy,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ), 0.00 ) bankSubsidy,
IFNULL( SUM( IF ( `status` = 1, enterFee, - enterFee ) ), 0.00 ) allInAccount,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', enterFee, - enterFee ), 0.00 ) ), 0.00 ) wxInAccount,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1',enterFee, - enterFee ), 0.00 ) ), 0.00 ) aliInAccount,
IFNULL( SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', enterFee, - enterFee ), 0.00 ) ), 0.00 ) bankInAccount,
DATE_FORMAT(mo.createDt, '%Y-%m-%d 00:00:00') startDate,
DATE_FORMAT(mo.createDt, '%Y-%m-%d 23:59:59') endDate,
DATE_FORMAT(mo.createDt, '%Y-%m-%d') billName
FROM tb_pluss_merchant_order mo
WHERE mo.`status` IN ('1', '2')
AND merchantCode = #{merchantCode}
AND createDt BETWEEN #{startDate} AND #{endDate}
GROUP BY DATE_FORMAT(mo.createDt, '%Y-%m-%d'), DATE_FORMAT(mo.createDt, '%Y-%m-%d 00:00:00'), DATE_FORMAT(mo.createDt, '%Y-%m-%d 23:59:59')
) t, (
SELECT CONCAT(mc.channelName, '备付金') merchantChannelType
FROM tb_pluss_merchant_channel mc
LEFT JOIN tb_pluss_merchant_channel_status mcs ON mc.id = mcs.channel
WHERE mcs.merchantCode = #{merchantCode}
) t2
ORDER BY t.billName DESC;
</select>
<select id="selectBillList" resultType="cn.pluss.platform.vo.MerchantOrderExportVO">
SELECT mo.orderNumber,
mo.thirdTransNo thirdOrderNo,
mro.refundNo,
CASE mo.payTypeCode
WHEN "sxfPay1" THEN "微信"
WHEN "wechatPay" THEN "微信"
WHEN "sxfPay0" THEN "支付宝"
WHEN "aliPay" THEN "支付宝"
WHEN "sxfPay2" THEN "银联"
WHEN "bank" THEN "银联"
END payType,
CASE mo.orderType
WHEN 1 THEN '反扫收款'
WHEN 2 THEN '收款码'
WHEN 3 THEN '会员充值'
WHEN 4 THEN 'POS刷卡'
WHEN 5 THEN '反扫会员充值'
WHEN 6 THEN '扫码王'
WHEN 9 THEN '收款码'
WHEN 10 THEN '线上店' END 'orderTypeDesc',
consumeFee,
IF(mro.refundNo IS NULL, 0, consumeFee) refundFee,
0 subsidy,
mo.marketAmt,
IF(mro.refundNo IS NOT NULL, 0, consumeFee - enterFee) serviceCharge,
IF(mro.refundNo IS NOT NULL, 0, enterFee) enterFee,
mo.staffName,
mo.remark,
mo.createDt,
mo.transDt
FROM tb_pluss_merchant_order mo
LEFT JOIN tb_pluss_merchant_refund_order mro ON mo.orderNumber = mro.orderNumber
WHERE mo.merchantCode = #{merchantCode}
AND mo.`status` IN ( '1' )
AND mo.createDt BETWEEN #{startDate}
AND #{endDate};
</select>
<select id="selectMemberBillList" resultType="cn.pluss.platform.vo.MemberOrderVO">
SELECT mo.orderNumber,
mo2.thirdTransNo thirdOrderNo,
mm.nickName,
mm.phone,
IF (mo.orderType = 0, NULL,
IF (mo.rechargeType = 1, "现金",
CASE mo2.payTypeCode
WHEN "sxfPay1" THEN "微信"
WHEN "wechatPay" THEN "微信"
WHEN "sxfPay0" THEN "支付宝"
WHEN "aliPay" THEN "支付宝"
WHEN "sxfPay2" THEN "银联"
WHEN "bank" THEN "银联"
END
))
payType,
IF (mo.orderType = 0, "会员消费", "会员充值") orderType,
mo.orderFee,
IF (mo.orderType = 0, 0.00,
IF (mo.rechargeType = 1, 0.00, mo2.consumeFee - mo2.enterFee)
) serviceRecharge,
IF (mo.orderType = 0, 0.00,
IF (mo.rechargeType = 1, mo.orderFee, 0.00)
) inCashMoney,
IF (mo.orderType = 0, 0.00,
IF (mo.rechargeType != 1, mo2.enterFee, 0.00)
) cardMoney,
IF(mo.orderType = 0, mo.orderFee, 0.00) consumeFee,
IFNULL(mmr.giveMoney, IFNULL(mmc.giveMoney, 0.00)) giveMoney,
IFNULL(mo.staffName, mbi.alias) staffName,
mo.remark,
mo.createDt,
IFNULL(mo2.transDt, mo.createDt) transDt,
t.memberBalance
FROM tb_pluss_member_order mo
LEFT JOIN tb_pluss_merchant_order mo2 ON mo.orderNumber = mo2.orderNumber
LEFT JOIN tb_pluss_merchant_base_info mbi ON mbi.merchantCode = mo.merchantCode
LEFT JOIN tb_pluss_merchant_menber mm ON mm.memberCode = mo.memberCode
LEFT JOIN tb_pluss_merchant_menber_recharge mmr ON mmr.orderNumber = mo.orderNumber
LEFT JOIN tb_pluss_merchant_menber_comsume mmc ON mmc.orderNumber = mo.orderNumber
LEFT JOIN (
SELECT
t.*,
ROUND(IF (@cgroup = t.memberCode, @csum := @csum + t.cardMoney, @csum := 0 + t.cardMoney), 2) memberBalance,
(@cgroup:= t.memberCode) `newGroup`
FROM (
SELECT
SUM( IF (
mo.orderType = 0,
( IFNULL( mmc.giveMoney, 0.00 ) + IFNULL( mmr.giveMoney, 0.00 ) - IFNULL( mo.orderFee, 0.00 ) ),
( IFNULL( mmc.giveMoney, 0.00 ) + IFNULL( mmr.giveMoney, 0.00 ) + IFNULL( mo.orderFee, 0.00 ) )
)
) cardMoney, mo.memberCode, mo.createDt
FROM tb_pluss_member_order mo
LEFT JOIN tb_pluss_merchant_menber_comsume mmc ON mo.orderNumber = mmc.orderNumber
LEFT JOIN tb_pluss_merchant_menber_recharge mmr ON mo.orderNumber = mmr.orderNumber
WHERE mo.merchantCode = #{merchantCode} AND mo.createDt &lt;= #{endDate}
GROUP BY mo.memberCode, mo.createDt
ORDER BY mo.memberCode, mo.createDt
) t,
(select @csum:=0, @cgroup:='') it
ORDER BY t.memberCode, t.createDt
) t ON t.createDt = mo.createDt
WHERE mo.orderStatus = '1' AND mo.merchantCode = #{merchantCode}
AND mo.createDt BETWEEN #{startDate} AND #{endDate}
ORDER BY mo.createDt;
</select>
<select id="selectMemberBillStatistics" resultType="cn.pluss.platform.vo.MemberOrderStatisticsVO">
SELECT t.*, t2.sumMemberBalance memberBalance, t3.merchantChannelType FROM (
SELECT
COUNT( IF ( mo.orderType = 0, 1, NULL ) ) consumeOrderCount,
COUNT( IF ( mo.orderType = 1, 1, NULL ) ) rechargeOrderCount,
COUNT( IF ( mo.orderType = 1 &amp;&amp; mo.rechargeType = 1, 1, NULL ) ) inCashRechargeOrderCount,
COUNT( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay1' || mo2.payTypeCode = 'wechatPay' || mo2.payTypeCode = 'leshuaPay1' ), 1, NULL ) ) wxOrderCount,
COUNT( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay0' || mo2.payTypeCode = 'aliPay' || mo2.payTypeCode = 'leshuaPay0' ), 1, NULL ) ) aliOrderCount,
COUNT( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay2' || mo2.payTypeCode = 'bank' || mo2.payTypeCode = 'leshuaPay2' ), 1, NULL ) ) bankOrderCount,
ROUND(SUM( IF ( mo.orderType = 0, mo.orderFee, 0.00)), 2) consumeSum,
ROUND(SUM( IF ( mo.orderType = 1, mo.orderFee, 0.00)), 2) rechargeSum,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; mo.rechargeType = 1, mo.orderFee, 0.00) ), 2) inCashRechargeSum,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay1' || mo2.payTypeCode = 'wechatPay' || mo2.payTypeCode = 'leshuaPay1' ), mo.orderFee, 0.00 ) ), 2) wxRechargeSum,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay0' || mo2.payTypeCode = 'aliPay' || mo2.payTypeCode = 'leshuaPay0' ), mo.orderFee, 0.00 ) ), 2) aliRechargeSum,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay2' || mo2.payTypeCode = 'bank' || mo2.payTypeCode = 'leshuaPay2' ), mo.orderFee, 0.00 ) ), 2) bankRechargeSum,
ROUND(SUM( IF ( mo.orderType = 0, IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) consumeGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1, IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) rechargeGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; mo.rechargeType = 1, IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) inCashRechargeGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay1' || mo2.payTypeCode = 'wechatPay' || mo2.payTypeCode = 'leshuaPay1' ), IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) wxGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay0' || mo2.payTypeCode = 'aliPay' || mo2.payTypeCode = 'leshuaPay0') , IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) aliGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay2' || mo2.payTypeCode = 'bank' || mo2.payTypeCode = 'leshuaPay2' ), IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) bankGiveMoney,
#{startDate} startDate,
#{endDate} endDate,
'汇总' billName
FROM
tb_pluss_member_order mo
LEFT JOIN tb_pluss_merchant_order mo2 ON mo.orderNumber = mo2.orderNumber
LEFT JOIN tb_pluss_merchant_menber_recharge mmr ON mmr.orderNumber = mo.orderNumber
LEFT JOIN tb_pluss_merchant_menber_comsume mmc ON mmc.orderNumber = mo.orderNumber
WHERE
mo.orderStatus = '1'
AND mo.merchantCode = #{merchantCode}
AND mo.createDt BETWEEN #{startDate} AND #{endDate}
UNION
SELECT
COUNT( IF ( mo.orderType = 0, 1, NULL ) ) consumeOrderCount,
COUNT( IF ( mo.orderType = 1, 1, NULL ) ) rechargeOrderCount,
COUNT( IF ( mo.orderType = 1 &amp;&amp; mo.rechargeType = 1, 1, NULL ) ) inCashRechargeOrderCount,
COUNT( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay1' || mo2.payTypeCode = 'wechatPay' || mo2.payTypeCode = 'leshuaPay1' ), 1, NULL ) ) wxOrderCount,
COUNT( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay0' || mo2.payTypeCode = 'aliPay' || mo2.payTypeCode = 'leshuaPay0' ), 1, NULL ) ) aliOrderCount,
COUNT( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay2' || mo2.payTypeCode = 'bank' || mo2.payTypeCode = 'leshuaPay2' ), 1, NULL ) ) bankOrderCount,
ROUND(SUM( IF ( mo.orderType = 0, mo.orderFee, 0.00)), 2) consumeSum,
ROUND(SUM( IF ( mo.orderType = 1, mo.orderFee, 0.00)), 2) rechargeSum,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; mo.rechargeType = 1, mo.orderFee, 0.00) ), 2) inCashRechargeSum,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay1' || mo2.payTypeCode = 'wechatPay' || mo2.payTypeCode = 'leshuaPay1' ), mo.orderFee, 0.00 ) ), 2) wxRechargeSum,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay0' || mo2.payTypeCode = 'aliPay' || mo2.payTypeCode = 'leshuaPay0' ), mo.orderFee, 0.00 ) ), 2) aliRechargeSum,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay2' || mo2.payTypeCode = 'bank' || mo2.payTypeCode = 'leshuaPay2' ), mo.orderFee, 0.00 ) ), 2) bankRechargeSum,
ROUND(SUM( IF ( mo.orderType = 0, IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) consumeGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1, IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) rechargeGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; mo.rechargeType = 1, IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) inCashRechargeGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay1' || mo2.payTypeCode = 'wechatPay' || mo2.payTypeCode = 'leshuaPay1' ), IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) wxGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay0' || mo2.payTypeCode = 'aliPay' || mo2.payTypeCode = 'leshuaPay0') , IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) aliGiveMoney,
ROUND(SUM( IF ( mo.orderType = 1 &amp;&amp; ( mo2.payTypeCode = 'sxfPay2' || mo2.payTypeCode = 'bank' || mo2.payTypeCode = 'leshuaPay2' ), IFNULL(mmr.giveMoney, 0.00) + IFNULL(mmc.giveMoney, 0.00), 0.00)), 2) bankGiveMoney,
DATE_FORMAT(mo.createDt, '%Y-%m-%d 00:00:00') startDate,
DATE_FORMAT(mo.createDt, '%Y-%m-%d 23:59:59') endDate,
DATE_FORMAT(mo.createDt, '%Y-%m-%d') billName
FROM tb_pluss_member_order mo
LEFT JOIN tb_pluss_merchant_order mo2 ON mo.orderNumber = mo2.orderNumber
LEFT JOIN tb_pluss_merchant_menber_recharge mmr ON mmr.orderNumber = mo.orderNumber
LEFT JOIN tb_pluss_merchant_menber_comsume mmc ON mmc.orderNumber = mo.orderNumber
WHERE mo.orderStatus = '1'
AND mo.merchantCode = #{merchantCode}
AND mo.createDt BETWEEN #{startDate} AND #{endDate}
GROUP BY DATE_FORMAT(mo.createDt, '%Y-%m-%d'), DATE_FORMAT(mo.createDt, '%Y-%m-%d 00:00:00'), DATE_FORMAT(mo.createDt, '%Y-%m-%d 23:59:59')
) t LEFT JOIN (
SELECT date, ROUND((@csum := @csum + memberBalance), 2) sumMemberBalance
FROM (SELECT
SUM(
IF (mo.orderType = 0,
(IFNULL(mmc.giveMoney, 0.00) + IFNULL(mmr.giveMoney, 0.00) - IFNULL(mo.orderFee, 0.00)),
(IFNULL(mmc.giveMoney, 0.00) + IFNULL(mmr.giveMoney, 0.00) + IFNULL(mo.orderFee, 0.00))
)
) memberBalance, DATE_FORMAT(mo.createDt, '%Y-%m-%d 23:59:59') date
FROM tb_pluss_member_order mo
LEFT JOIN tb_pluss_merchant_menber_comsume mmc ON mo.orderNumber = mmc.orderNumber
LEFT JOIN tb_pluss_merchant_menber_recharge mmr ON mo.orderNumber = mmr.orderNumber
WHERE mo.merchantCode = 'M800202104111235020' AND mo.orderStatus = 1
GROUP BY DATE_FORMAT(mo.createDt, '%Y-%m-%d 23:59:59')) t ,(select @csum:=0) as it order by date
) t2 ON DATE_FORMAT(t.endDate, '%Y%m%d%H%i%s') = DATE_FORMAT(t2.date, '%Y%m%d%H%i%s'), (
SELECT CONCAT(mc.channelName, '备付金') merchantChannelType
FROM tb_pluss_merchant_channel mc
LEFT JOIN tb_pluss_merchant_channel_status mcs ON mc.id = mcs.channel
WHERE mcs.merchantCode = #{merchantCode}
) t3
ORDER BY t.billName DESC;
</select>
<select id="selectStaffBillStatistics" resultType="cn.pluss.platform.vo.BillStatisticsVO">
SELECT ta.staffName,
IFNULL(t.billName, tn.billName) billName,
IFNULL(t.allOrderCount, 0) allOrderCount,
IFNULL(t.wxOrderCount, 0) wxOrderCount,
IFNULL(t.aliOrderCount, 0) aliOrderCount,
IFNULL(t.bankOrderCount, 0) bankOrderCount,
IFNULL(t.allRefundOrderCount, 0) allRefundOrderCount,
IFNULL(t.wxRefundOrderCount, 0) wxRefundOrderCount,
IFNULL(t.aliRefundOrderCount, 0) aliRefundOrderCount,
IFNULL(t.bankRefundOrderCount, 0) bankRefundOrderCount,
IFNULL(t.allInMoney, 0.00) allInMoney,
IFNULL(t.wxInMoney, 0.00) wxInMoney,
IFNULL(t.aliInMoney, 0.00) aliInMoney,
IFNULL(t.bankInMoney, 0.00) bankInMoney,
IFNULL(t.allSubsidy, 0.00) allSubsidy,
IFNULL(t.wxSubsidy, 0.00) wxSubsidy,
IFNULL(t.aliSubsidy, 0.00) aliSubsidy,
IFNULL(t.bankSubsidy, 0.00) bankSubsidy,
IFNULL(t.allInAccount, 0.00) allInAccount,
IFNULL(t.wxInAccount, 0.00) wxInAccount,
IFNULL(t.aliInAccount, 0.00) aliInAccount,
IFNULL(t.bankInAccount, 0.00) bankInAccount,
#{startDate} startDate,
#{endDate} endDate,
IFNULL(tn.inCashOrderCount, 0) inCashOrderCount,
IFNULL(tn.inCashInMoney, 0.00) inCashInMoney,
IFNULL(tn.inCashInMoney, 0.00) inCashInAccount,
t2.merchantChannelType
FROM
( SELECT userId, ua.userName staffName
FROM tb_pluss_user_app ua
WHERE userType = 'staff'
AND merchantCode = #{merchantCode}
) ta LEFT JOIN
(
SELECT
IFNULL( COUNT( IF ( `status` = '1', 1, NULL ) ), 0) allOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), 1, NULL ) ), 0) wxOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), 1, NULL ) ), 0) aliOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), 1, NULL ) ), 0) bankOrderCount,
IFNULL( COUNT( IF ( `status` = '2', 1, NULL ) ), 0) allRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), 1, NULL ) ), 0) wxRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), 1, NULL ) ), 0) aliRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), 1, NULL ) ), 0) bankRefundOrderCount,
SUM( IF ( `status` = '1', consumeFee, - consumeFee ) ) allInMoney,
SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ) wxInMoney,
SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ) aliInMoney,
SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ) bankInMoney,
SUM( IF ( `status` = 1, marketAmt, - marketAmt ) ) allSubsidy,
SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ) wxSubsidy,
SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ) aliSubsidy,
SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ) bankSubsidy,
SUM( IF ( `status` = 1, enterFee, - enterFee ) ) allInAccount,
SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', enterFee, - enterFee ), 0.00 ) ) wxInAccount,
SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1',enterFee, - enterFee ), 0.00 ) ) aliInAccount,
SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', enterFee, - enterFee ), 0.00 ) ) bankInAccount,
#{startDate} startDate,
#{endDate} endDate,
mo.staffCode,
CONCAT(staffName, '——汇总') billName
FROM
tb_pluss_merchant_order mo
WHERE `status` IN ( '1', '2' )
AND staffName IS NOT NULL
AND merchantCode = #{merchantCode}
AND createDt BETWEEN #{startDate} AND #{endDate}
GROUP BY staffName, staffCode
UNION
SELECT
IFNULL( COUNT( IF ( `status` = '1', 1, NULL ) ), 0) allOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), 1, NULL ) ), 0) wxOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), 1, NULL ) ), 0) aliOrderCount,
IFNULL( COUNT( IF ( `status` = '1' &amp;&amp; ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), 1, NULL ) ), 0) bankOrderCount,
IFNULL( COUNT( IF ( `status` = '2', 1, NULL ) ), 0) allRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), 1, NULL ) ), 0) wxRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), 1, NULL ) ), 0) aliRefundOrderCount,
IFNULL( COUNT( IF ( `status` = '2' &amp;&amp; ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), 1, NULL ) ), 0) bankRefundOrderCount,
SUM( IF ( `status` = '1', consumeFee, - consumeFee ) ) allInMoney,
SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ) wxInMoney,
SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ) aliInMoney,
SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', consumeFee, - consumeFee ), 0.00 ) ) bankInMoney,
SUM( IF ( `status` = 1, marketAmt, - marketAmt ) ) allSubsidy,
SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ) wxSubsidy,
SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ) aliSubsidy,
SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', marketAmt, - marketAmt ), 0.00 ) ) bankSubsidy,
SUM( IF ( `status` = 1, enterFee, - enterFee ) ) allInAccount,
SUM( IF ( ( payTypeCode = 'sxfPay1' || payTypeCode = 'wechatPay' || payTypeCode = 'leshuaPay1' ), IF ( `status` = '1', enterFee, - enterFee ), 0.00 ) ) wxInAccount,
SUM( IF ( ( payTypeCode = 'sxfPay0' || payTypeCode = 'aliPay' || payTypeCode = 'leshuaPay0' ), IF ( `status` = '1',enterFee, - enterFee ), 0.00 ) ) aliInAccount,
SUM( IF ( ( payTypeCode = 'sxfPay2' || payTypeCode = 'bank' || payTypeCode = 'leshuaPay2' ), IF ( `status` = '1', enterFee, - enterFee ), 0.00 ) ) bankInAccount,
DATE_FORMAT(mo.createDt, '%Y-%m-%d 00:00:00') startDate,
DATE_FORMAT(mo.createDt, '%Y-%m-%d 23:59:59') endDate,
mo.staffCode,
CONCAT(mo.staffName, '——', DATE_FORMAT(mo.createDt, '%Y-%m-%d')) billName
FROM tb_pluss_merchant_order mo
WHERE mo.`status` IN ('1', '2')
AND staffName IS NOT NULL
AND merchantCode = #{merchantCode}
AND createDt BETWEEN #{startDate} AND #{endDate}
GROUP BY DATE_FORMAT(mo.createDt, '%Y-%m-%d'), DATE_FORMAT(mo.createDt, '%Y-%m-%d 00:00:00'), DATE_FORMAT(mo.createDt, '%Y-%m-%d 23:59:59'), CONCAT(mo.staffName, '——', DATE_FORMAT(mo.createDt, '%Y-%m-%d')), mo.staffCode
) t ON ta.userId = t.staffCode
LEFT JOIN (
SELECT
CONCAT(staffName, '——汇总' ) billName,
staffName,
SUM( orderFee ) inCashInMoney,
COUNT(1) inCashOrderCount
FROM
tb_pluss_member_order
WHERE
orderType = 1
AND rechargeType = 1
AND orderStatus = 1
AND merchantCode = #{merchantCode}
AND createDt BETWEEN #{startDate} AND #{endDate}
GROUP BY
CONCAT(staffName, '——汇总' ),
staffName
UNION
SELECT
CONCAT(staffName, DATE_FORMAT( createDt, '——%Y-%m-%d' )) billName,
staffName,
SUM( orderFee ) inCashMoney,
COUNT(1) inCashOrderCount
FROM
tb_pluss_member_order
WHERE
orderType = 1
AND rechargeType = 1
AND orderStatus = 1
AND merchantCode = #{merchantCode}
AND createDt BETWEEN #{startDate} AND #{endDate}
GROUP BY
CONCAT(staffName, DATE_FORMAT( createDt, '——%Y-%m-%d' )),
staffName
) tn ON tn.staffName = ta.staffName
, (
SELECT CONCAT(mc.channelName, '备付金') merchantChannelType
FROM tb_pluss_merchant_channel mc
LEFT JOIN tb_pluss_merchant_channel_status mcs ON mc.id = mcs.channel
WHERE mcs.merchantCode = #{merchantCode}
) t2
ORDER BY t.billName DESC;
</select>
</mapper>

View File

@@ -0,0 +1,38 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.BusinessInfoMapper">
<select id="selectPage" resultType="cn.pluss.platform.vo.BusinessInfoVo">
SELECT ua.userId, ui.loginName, ui.phone, ui.status, ua.userName, ui.createTime, ui.updateTime,
pup.userName AS agentName, pup.userId AS agentId
FROM tb_pluss_user_app ua
LEFT JOIN tb_pluss_user_info ui
ON ua.userId = ui.id
LEFT JOIN tb_pluss_user_app pup
ON ua.parentId = pup.userId
WHERE ua.userType = 'agent_staff'
<include refid="commonWhere" />
</select>
<sql id="commonWhere">
<if test="businessInfoVo.userId != null and businessInfoVo.userId != ''">
AND ua.userId = #{businessInfoVo.userId}
</if>
<if test="businessInfoVo.loginName != null and businessInfoVo.loginName != ''">
AND ui.loginName LIKE CONCAT("%", #{businessInfoVo.loginName}, "%")
</if>
<if test="businessInfoVo.phone != null and businessInfoVo.phone != ''">
AND ui.phone LIKE CONCAT("%", #{businessInfoVo.phone}, "%")
</if>
<if test="businessInfoVo.userName != null and businessInfoVo.userName != ''">
AND ua.userName LIKE CONCAT("%", #{businessInfoVo.userName}, "%")
</if>
<if test="businessInfoVo.agentName != null and businessInfoVo.agentName != ''">
AND pup.userName LIKE concat('%',#{businessInfoVo.agentName},'%')
</if>
<if test="businessInfoVo.agentId != null">
AND pup.userId = #{businessInfoVo.agentId}
</if>
</sql>
</mapper>

View 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="cn.pluss.platform.mapper.CacheInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.CacheInfo">
<id column="id" property="id" />
<result column="keyCode" property="keyCode" />
<result column="appId" property="appId" />
<result column="appSercet" property="appSercet" />
<result column="accessToken" property="accessToken" />
<result column="refreshToken" property="refreshToken" />
<result column="expires_in" property="expiresIn" />
<result column="createTime" property="createTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.CashMapper">
<select id="queryCashPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.Cash">
SELECT
tpc.id, tpc.userId,tpc.userName,tpc.merchantCode,tpc.merchantName,
IFNULL(tpc.accountNo, ca.accountNo) accountNo, IFNULL(tpc.accountName, ca.accountName) accountName,
tpc.cashAmt,tpc.status,tpc.reason,tpc.createDt,tpc.updateDt,tpc.cashNumber,tpc.type,
tpui.alias as alias from tb_pluss_cash tpc
LEFT JOIN tb_pluss_merchant_base_info tpui on tpui.userId = tpc.userId
LEFT JOIN tb_pluss_cash_account ca ON ca.userId = tpc.userId
<where>
<if test="id!= null">
and tpc.id = #{id}
</if>
<if test="userId!= null">
and tpc.userId = #{userId}
</if>
<if test="userName!= null">
and tpc.userName LIKE CONCAT("%",#{userName},"%")
</if>
<if test="merchantCode!= null">
and tpc.merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and tpc.merchantName LIKE CONCAT("%", #{merchantName},"%")
</if>
<if test="cashAmt!= null">
and tpc.cashAmt = #{cashAmt}
</if>
<if test="status!= null">
and tpc.status = #{status}
</if>
<if test="reason!= null">
and tpc.reason = #{reason}
</if>
<if test="createDt!= null">
and tpc.createDt = #{createDt}
</if>
<if test="updateDt!= null">
and tpc.updateDt = #{updateDt}
</if>
<if test="logo!= null">
and tpc.logo = #{logo}
</if>
<if test="cashNumber!= null">
and tpc.cashNumber = #{cashNumber}
</if>
<if test="backNo!= null">
and tpc.backNo = #{backNo}
</if>
<if test="backDt!= null">
and tpc.backDt = #{backDt}
</if>
<if test="updator!= null">
and tpc.updator = #{updator}
</if>
<if test="type!= null">
and tpc.type = #{type}
</if>
<if test="beginTime!= null">
and tpc.createDt &gt; #{beginTime}
</if>
<if test="endTime!= null">
and tpc.createDt &lt; #{endTime}
</if>
<if test="phone!= null">
and phone LIKE CONCAT("%", #{phone},"%")
</if>
</where>
order by tpc.id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryCashPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_cash tpc
left join tb_pluss_merchant_base_info tpui on tpui.userId = tpc.userId
<where>
<if test="id!= null">
and tpc.id = #{id}
</if>
<if test="userId!= null">
and tpc.userId = #{userId}
</if>
<if test="userName!= null">
and tpc.userName LIKE CONCAT("%",#{userName},"%")
</if>
<if test="merchantCode!= null">
and tpc.merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and tpc.merchantName LIKE CONCAT("%", #{merchantName},"%")
</if>
<if test="cashAmt!= null">
and tpc.cashAmt = #{cashAmt}
</if>
<if test="status!= null">
and tpc.status = #{status}
</if>
<if test="reason!= null">
and tpc.reason = #{reason}
</if>
<if test="createDt!= null">
and tpc.createDt = #{createDt}
</if>
<if test="updateDt!= null">
and tpc.updateDt = #{updateDt}
</if>
<if test="logo!= null">
and tpc.logo = #{logo}
</if>
<if test="cashNumber!= null">
and tpc.cashNumber = #{cashNumber}
</if>
<if test="backNo!= null">
and tpc.backNo = #{backNo}
</if>
<if test="backDt!= null">
and tpc.backDt = #{backDt}
</if>
<if test="updator!= null">
and tpc.updator = #{updator}
</if>
<if test="type!= null">
and tpc.type = #{type}
</if>
<if test="beginTime!= null">
and tpc.createDt &gt; #{beginTime}
</if>
<if test="endTime!= null">
and tpc.createDt &lt; #{endTime}
</if>
<if test="phone!= null">
and phone LIKE CONCAT("%", #{phone},"%")
</if>
</where>
</select>
<!-- 已经成功提现的金额/申请提现中的金额 粉丝分润-->
<select id="sumFansSuccessCash" parameterType="java.util.Map" resultType="java.lang.Double">
select IFNULL(sum(cashAmt), 0) as cashAmt
from tb_pluss_cash
where merchantCode = #{merchantCode}
and type = '0'
and (status = '1' OR status = '0')
</select>
<!-- 已经成功提现 粉丝分润-->
<select id="sumFansAreadlyCash" parameterType="java.util.Map" resultType="java.lang.Double">
select sum(cashAmt) as cashAmt
from tb_pluss_cash
where merchantCode = #{merchantCode}
and type = '0'
and status = '1'
</select>
<!-- 已经成功提现的金额/申请提现中的金额 推广分润-->
<select id="sumMerChantSuccessCash" resultType="java.lang.Double">
select sum(cashAmt) as cashAmt
from tb_pluss_cash
where userId = #{userId}
and (status = '1' OR status = '0')
</select>
<!-- 已经成功提现 推广分润 -->
<select id="sumMerChantAreadlyCash" resultType="java.lang.Double">
select sum(cashAmt) as cashAmt
from tb_pluss_cash
where userId = #{userId}
and type = '1'
and status = '1'
</select>
<select id="queryCashPage2" resultType="cn.pluss.platform.entity.Cash">
SELECT tpc.*, cr.remark, tpui.aliAccount,tpui.alias as alias, ui.phone phone, t2.cashTotalAmt from tb_pluss_cash tpc
left join tb_pluss_merchant_base_info tpui on tpui.userId = tpc.userId
LEFT JOIN tb_pluss_user_info ui ON ui.id = tpc.userId
LEFT JOIN (
SELECT sum(cashAmt) cashTotalAmt, userId FROM tb_pluss_cash
WHERE `status` = '1'
GROUP BY userId
) t2 ON tpc.userId = t2.userId
LEFT JOIN tb_pluss_common_remark cr ON cr.userId = tpc.userId AND cr.code = 'CASH'
${ew.customSqlSegment}
</select>
<select id="getCashCountData" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
IFNULL(SUM(if(`status` = 0,cashAmt,0)),0) AS inCashAmtCount,
IFNULL(SUM(if(`status` = 1,cashAmt,0)),0) AS useCashAmtCount
FROM
tb_pluss_cash
<where>
<if test="startTime != null">
and createDt <![CDATA[>=]]> #{startTime}
</if>
<if test="endTime != null">
and createDt <![CDATA[<=]]> #{endTime}
</if>
<if test="userId != null and userId != ''">
and userId = #{userId}
</if>
</where>
</select>
<select id="selectCashAmtTotal" resultType="java.math.BigDecimal">
SELECT SUM(`cashAmt`) FROM tb_pluss_cash WHERE `userId` = #{userId}
<if test="statusArr != null and statusArr.length > 0">
AND `status` IN
<foreach collection="statusArr" separator=", " close=")" item="item" open="(">
#{item}
</foreach>
</if>
</select>
</mapper>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.CashAccountMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.CashAccount">
<id column="id" property="id" />
<result column=" userId" property="userId" />
<result column="accountNo" property="accountNo" />
<result column="accountName" property="accountName" />
<result column="status" property="status" />
<result column="createTime" property="createTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.CommonMapper">
<resultMap id="count" type="Long" />
</mapper>

View 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="cn.pluss.platform.mapper.CommonRemarkMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.CommonRemark">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="remark" property="remark" />
<result column="dataId" property="dataId" />
<result column="code" property="code" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,352 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.DeviceMapper">
<insert id="saveDevice" parameterType="cn.pluss.platform.entity.Device">
insert into tb_pluss_device(name,type,introDesc,seq,status,createDt,matNo,venderName,venderModel,aisleModel,inventory,unitPrice,deviceLogo,venderCode,detail)VALUES(#{name},#{type},#{introDesc},#{seq},#{status},NOW(),#{matNo},#{venderName},#{venderModel},#{aisleModel},#{inventory},#{unitPrice},#{deviceLogo},#{venderCode},#{detail})
</insert>
<insert id="saveDeviceBatch">
insert into tb_pluss_device(name,type,introDesc,seq,status,createDt) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{name},#{type},#{introDesc},#{seq},#{status},#{createDt} )
</foreach>
</insert>
<select id="queryDevice" parameterType="cn.pluss.platform.entity.Device" resultType="cn.pluss.platform.entity.Device">
SELECT * from tb_pluss_device
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="introDesc!= null">
and introDesc = #{introDesc}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="matNo!= null">
and matNo = #{matNo}
</if>
<if test="venderName!= null">
and venderName = #{venderName}
</if>
<if test="venderModel!= null">
and venderModel = #{venderModel}
</if>
<if test="aisleModel!= null">
and aisleModel = #{aisleModel}
</if>
<if test="inventory!= null">
and inventory = #{inventory}
</if>
<if test="unitPrice!= null">
and unitPrice = #{unitPrice}
</if>
<if test="deviceLogo!= null">
and deviceLogo = #{deviceLogo}
</if>
<if test="venderCode!= null">
and venderCode = #{venderCode}
</if>
<if test="detail!= null">
and detail = #{detail}
</if>
</where>
</select>
<select id="queryDeviceList" parameterType="cn.pluss.platform.entity.Device" resultType="cn.pluss.platform.entity.Device">
SELECT * from tb_pluss_device
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="introDesc!= null">
and introDesc = #{introDesc}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="matNo!= null">
and matNo = #{matNo}
</if>
<if test="venderName!= null">
and venderName = #{venderName}
</if>
<if test="venderModel!= null">
and venderModel = #{venderModel}
</if>
<if test="aisleModel!= null">
and aisleModel = #{aisleModel}
</if>
<if test="inventory!= null">
and inventory = #{inventory}
</if>
<if test="unitPrice!= null">
and unitPrice = #{unitPrice}
</if>
<if test="deviceLogo!= null">
and deviceLogo = #{deviceLogo}
</if>
<if test="venderCode!= null">
and venderCode = #{venderCode}
</if>
<if test="detail!= null">
and detail = #{detail}
</if>
</where>
</select>
<update id="updateDevice" parameterType="cn.pluss.platform.entity.Device" >
update tb_pluss_device
<set>
<if test="name!= null">
name = #{name},
</if>
<if test="type!= null">
type = #{type},
</if>
<if test="introDesc!= null">
introDesc = #{introDesc},
</if>
<if test="seq!= null">
seq = #{seq},
</if>
<if test="status!= null">
status = #{status},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="matNo!= null">
matNo = #{matNo},
</if>
<if test="venderName!= null">
venderName = #{venderName},
</if>
<if test="venderModel!= null">
venderModel = #{venderModel},
</if>
<if test="aisleModel!= null">
aisleModel = #{aisleModel},
</if>
<if test="inventory!= null">
inventory = #{inventory},
</if>
<if test="unitPrice!= null">
unitPrice = #{unitPrice},
</if>
<if test="deviceLogo!= null">
deviceLogo = #{deviceLogo},
</if>
<if test="venderCode!= null">
venderCode = #{venderCode},
</if>
<if test="detail!= null">
detail = #{detail}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteDevice" parameterType="cn.pluss.platform.entity.Device" >
DELETE FROM tb_pluss_device where id=#{id}
</delete>
<select id="queryDevicePage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.Device">
SELECT * from tb_pluss_device
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null and name!=''">
and name LIKE CONCAT('%',#{name},'%')
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="introDesc!= null">
and introDesc = #{introDesc}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="matNo!= null">
and matNo = #{matNo}
</if>
<if test="venderName!= null and venderName!=''">
and venderName LIKE CONCAT('%',#{venderName},'%')
</if>
<if test="venderModel!= null and venderModel!=''">
and venderModel LIKE CONCAT('%',#{venderModel},'%')
</if>
<if test="aisleModel!= null">
and aisleModel = #{aisleModel}
</if>
<if test="inventory!= null">
and inventory = #{inventory}
</if>
<if test="unitPrice!= null">
and unitPrice = #{unitPrice}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!=''">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="deviceLogo!= null">
and deviceLogo = #{deviceLogo}
</if>
<if test="venderCode!= null">
and venderCode = #{venderCode}
</if>
<if test="detail!= null">
and detail = #{detail}
</if>
</where>
order by seq asc limit #{pageSize} offset #{offset}
</select>
<select id="queryDevicePageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_device
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null and name!=''.toString">
and name LIKE CONCAT('%',#{name},'%')
</if>
<if test="type!= null">
and type = #{type}
</if>
<if test="introDesc!= null">
and introDesc = #{introDesc}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!=''">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="matNo!= null">
and matNo = #{matNo}
</if>
<if test="venderName!= null and venderName!=''">
and venderName LIKE CONCAT('%',#{venderName},'%')
</if>
<if test="venderModel!= null and venderModel!='' ">
and venderModel LIKE CONCAT('%',#{venderModel},'%')
</if>
<if test="aisleModel!= null">
and aisleModel = #{aisleModel}
</if>
<if test="inventory!= null">
and inventory = #{inventory}
</if>
<if test="unitPrice!= null">
and unitPrice = #{unitPrice}
</if>
<if test="deviceLogo!= null">
and deviceLogo = #{deviceLogo}
</if>
<if test="venderCode!= null">
and venderCode = #{venderCode}
</if>
<if test="detail!= null">
and detail = #{detail}
</if>
</where>
</select>
<select id="pageDate" resultType="cn.pluss.platform.entity.Device">
SELECT id,`name`,matNo,deviceLogo,`type`,introDesc,seq,`status`,
createDt,venderName,venderCode,venderModel,aisleModel,inventory,unitPrice,detail
FROM tb_pluss_device
<where>
<if test="device.id!= null">
and id = #{device.id}
</if>
<if test="device.name != null and device.name !=''.toString ">
and name LIKE CONCAT('%',#{device.name},'%')
</if>
<if test="device.venderName!= null and device.venderName!=''">
and venderName LIKE CONCAT('%',#{device.venderName},'%')
</if>
<if test="device.venderModel!= null and device.venderModel!='' ">
and venderModel LIKE CONCAT('%',#{device.venderModel},'%')
</if>
<if test="device.status!= null">
and status = #{device.status}
</if>
<if test="device.startTime != null">
and createDt &gt;= #{device.startTime}
</if>
<if test="device.endTime!= null">
and createDt &lt;= #{device.endTime}
</if>
</where>
</select>
<select id="getDeviceId" resultType="cn.pluss.platform.entity.Device">
SELECT id,`name`,matNo,deviceLogo,`type`,introDesc,seq,`status`,
createDt,venderName,venderCode,venderModel,aisleModel,inventory,unitPrice,detail
FROM tb_pluss_device
<where>
<if test="id!= null">
and id = #{id}
</if>
</where>
</select>
</mapper>

View 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="cn.pluss.platform.mapper.DeviceBsjMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceBsj">
<id column="snNo" property="snNo"/>
<result column="deviceNo" property="deviceNo"/>
<result column="imei" property="imei"/>
<result column="iccid" property="iccid"/>
<result column="sim" property="sim"/>
<result column="simExpireTime" property="simExpireTime"/>
</resultMap>
<select id="selectLastMonthExpiredData" resultType="java.util.Map">
SELECT ds.snNo, mbi.alias, ua.userId
FROM tb_pluss_device_bsj dbsj
LEFT JOIN tb_pluss_device_stock ds ON dbsj.snNo = ds.snNo
LEFT JOIN tb_pluss_merchant_base_info mbi ON mbi.id = ds.actMercId
LEFT JOIN tb_pluss_user_app ua ON ua.userId = mbi.userId
WHERE dbsj.simExpireTime &lt;= DATE_ADD(CURRENT_TIMESTAMP, INTERVAL 1 MONTH)
</select>
</mapper>

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.DeviceDetailMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceDetail">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="venderCode" property="venderCode"/>
<result column="deviceLogo" property="deviceLogo"/>
<result column="venderName" property="venderName"/>
<result column="venderModel" property="venderModel"/>
<result column="aisleModel" property="aisleModel"/>
<result column="type" property="type"/>
<result column="typeDesc" property="typeDesc"/>
<result column="groupNo" property="groupNo"/>
<result column="introDesc" property="introDesc"/>
<result column="seq" property="seq"/>
<result column="status" property="status"/>
<result column="createDt" property="createDt"/>
<result column="unitPrice" property="unitPrice"/>
<result column="detail" property="detail"/>
</resultMap>
<select id="selectListWithStock" resultType="cn.pluss.platform.entity.DeviceDetail">
SELECT dd.id, dd.code, dd.venderCode, dd.deviceLogo, dd.venderName, dd.venderModel,
dd.aisleModel, dd.type, dd.groupNo, dd.size, dd.introDesc, dd.seq, dd.status, dd.createDt, dd.unitPrice,
dd.wholesalePrice, dd.wholesaleMinNum, dd.detail, ds.specName typeDesc
FROM tb_pluss_device_detail dd
LEFT JOIN tb_pluss_device_spec ds ON dd.type = ds.spec AND dd.`code` = ds.`code`
${ew.customSqlSegment}
</select>
<select id="selectListWithStockWithNoDetail" resultType="cn.pluss.platform.entity.DeviceDetail">
SELECT dd.id, dd.code, dd.venderCode, dd.deviceLogo, dd.venderName, dd.venderModel,
dd.aisleModel, dd.type, dd.groupNo, dd.size, dd.seq, dd.status, dd.createDt, dd.unitPrice,
dd.wholesalePrice, dd.wholesaleMinNum, dd.introDesc, ds.specName typeDesc
FROM tb_pluss_device_detail dd
LEFT JOIN tb_pluss_device_spec ds ON dd.type = ds.spec AND dd.`code` = ds.`code`
${ew.customSqlSegment}
</select>
</mapper>

View 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="cn.pluss.platform.mapper.DeviceGoodTagMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceGoodTag">
<id column="id" property="id" />
<result column="tag" property="tag" />
<result column="sort" property="sort" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.DeviceGoodsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceGoods">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="name" property="name" />
<result column="deviceLogo" property="deviceLogo" />
<result column="introDesc" property="introDesc" />
<result column="sort" property="sort" />
<result column="status" property="status" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
<select id="selectBySn" resultType="cn.pluss.platform.entity.DeviceGoods">
SELECT * FROM tb_pluss_device_goods dg LEFT JOIN tb_pluss_device_stock ds
ON dg.code = ds.code WHERE ds.snNo = #{snNo}
</select>
</mapper>

View File

@@ -0,0 +1,539 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.DeviceMerchantBuyMapper">
<insert id="saveDeviceMerchantBuy" parameterType="cn.pluss.platform.entity.DeviceMerchantBuy">
insert into tb_pluss_device_merchant_buy(orderNo, transNo, merchantCode, merchantName, venderModel, status,
payCode, payName, createDt, transDt, refundNo, refundDt, expressNo,
provinces, address, orderAmount, quantity, linkName, linkPhone,
venderCode, email, snNo,logistNo)
VALUES (#{orderNo}, #{transNo}, #{merchantCode}, #{merchantName}, #{venderModel}, #{status}, #{payCode},
#{payName}, now(), #{transDt}, #{refundNo}, #{refundDt}, #{expressNo}, #{provinces}, #{address},
#{orderAmount}, #{quantity}, #{linkName}, #{linkPhone}, #{venderCode}, #{email}, #{snNo},#{logistNo})
</insert>
<insert id="saveDeviceMerchantBuyBatch">
insert into
tb_pluss_device_merchant_buy(orderNo,transNo,merchantCode,merchantName,venderModel,status,payCode,payName,createDt,transDt,refundNo,snNo,logistNo)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{orderNo},#{transNo},#{merchantCode},#{merchantName},#{venderModel},#{status},#{payCode},#{payName},#{createDt},#{transDt},#{refundNo},#{snNo},#{logistNo})
</foreach>
</insert>
<select id="queryDeviceMerchantBuy" parameterType="cn.pluss.platform.entity.DeviceMerchantBuy"
resultType="cn.pluss.platform.entity.DeviceMerchantBuy">
SELECT * from tb_pluss_device_merchant_buy
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="transNo!= null">
and transNo = #{transNo}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="venderModel!= null">
and venderModel = #{venderModel}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="payCode!= null">
and payCode = #{payCode}
</if>
<if test="payName!= null">
and payName = #{payName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="refundNo!= null">
and refundNo = #{refundNo}
</if>
<if test="refundDt!= null">
and refundDt = #{refundDt}
</if>
<if test="expressNo!= null">
and expressNo = #{expressNo}
</if>
<if test="provinces!= null">
and provinces = #{provinces}
</if>
<if test="address!= null">
and address = #{address}
</if>
<if test="orderAmount!= null">
and orderAmount = #{orderAmount}
</if>
<if test="quantity!= null">
and quantity = #{quantity}
</if>
<if test="linkName!= null">
and linkName = #{linkName}
</if>
<if test="linkPhone!= null">
and linkPhone = #{linkPhone}
</if>
<if test="venderCode!= null">
and venderCode = #{venderCode}
</if>
<if test="email!= null">
and email = #{email}
</if>
<if test="actStatus != null">
and actStatus = #{actStatus}
</if>
<if test="snNo != null">
and snNo = #{snNo}
</if>
<if test="logistNo != null">
and logistNo = #{logistNo}
</if>
</where>
</select>
<select id="queryDeviceMerchantBuyList" parameterType="cn.pluss.platform.entity.DeviceMerchantBuy"
resultType="cn.pluss.platform.entity.DeviceMerchantBuy">
SELECT * from tb_pluss_device_merchant_buy
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="transNo!= null">
and transNo = #{transNo}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="venderModel!= null">
and venderModel = #{venderModel}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="payCode!= null">
and payCode = #{payCode}
</if>
<if test="payName!= null">
and payName = #{payName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="startTime != null">
and createDt > #{startTime}
</if>
<if test="endTime != null">
and createDt <![CDATA[ <= ]]> #{endTime}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="refundNo!= null">
and refundNo = #{refundNo}
</if>
<if test="refundDt!= null">
and refundDt = #{refundDt}
</if>
<if test="expressNo!= null">
and expressNo = #{expressNo}
</if>
<if test="provinces!= null">
and provinces = #{provinces}
</if>
<if test="address!= null">
and address = #{address}
</if>
<if test="orderAmount!= null">
and orderAmount = #{orderAmount}
</if>
<if test="quantity!= null">
and quantity = #{quantity}
</if>
<if test="linkName!= null">
and linkName = #{linkName}
</if>
<if test="linkPhone!= null">
and linkPhone = #{linkPhone}
</if>
<if test="venderCode!= null">
and venderCode = #{venderCode}
</if>
<if test="email!= null">
and email = #{email}
</if>
<if test="actStatus!= null">
and actStatus = #{actStatus}
</if>
<if test="snNo!= null">
and snNo = #{snNo}
</if>
<if test="logistNo!= null">
and logistNo = #{logistNo}
</if>
</where>
</select>
<update id="updateDeviceMerchantBuy" parameterType="cn.pluss.platform.entity.DeviceMerchantBuy">
update tb_pluss_device_merchant_buy
<set>
<if test="orderNo!= null">
orderNo = #{orderNo},
</if>
<if test="transNo!= null">
transNo = #{transNo},
</if>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="merchantName!= null">
merchantName = #{merchantName},
</if>
<if test="venderModel!= null">
venderModel = #{venderModel},
</if>
<if test="status!= null">
status = #{status},
</if>
<if test="payCode!= null">
payCode = #{payCode},
</if>
<if test="payName!= null">
payName = #{payName},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="transDt!= null">
transDt = #{transDt},
</if>
<if test="refundNo!= null">
refundNo = #{refundNo},
</if>
<if test="refundDt!= null">
refundDt = #{refundDt},
</if>
<if test="expressNo!= null">
expressNo = #{expressNo},
</if>
<if test="provinces!= null">
provinces = #{provinces},
</if>
<if test="address!= null">
address = #{address},
</if>
<if test="orderAmount!= null">
orderAmount = #{orderAmount},
</if>
<if test="quantity!= null">
quantity = #{quantity},
</if>
<if test="linkName!= null">
linkName = #{linkName},
</if>
<if test="linkPhone!= null">
linkPhone = #{linkPhone},
</if>
<if test="venderCode!= null">
venderCode = #{venderCode},
</if>
<if test="email!= null">
email = #{email},
</if>
<if test="actStatus!= null">
actStatus = #{actStatus},
</if>
<if test="snNo!= null">
snNo = #{snNo},
</if>
<if test="logistNo!= null">
logistNo = #{logistNo}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteDeviceMerchantBuy" parameterType="cn.pluss.platform.entity.DeviceMerchantBuy">
DELETE
FROM tb_pluss_device_merchant_buy
where id = #{id}
</delete>
<select id="queryDeviceMerchantBuyPage" parameterType="java.util.Map"
resultType="cn.pluss.platform.entity.DeviceMerchantBuy">
SELECT dmb.*,mbi.alias,doi.userId, dg.`name`,doi.deviceType
from tb_pluss_device_merchant_buy dmb
LEFT JOIN tb_pluss_merchant_base_info mbi on mbi.merchantCode = dmb.merchantCode
LEFT JOIN tb_pluss_device_order_info doi ON doi.orderNo = dmb.orderNo
LEFT JOIN tb_pluss_qr_code qc on dmb.orderNo = qc.orderNo
LEFT JOIN tb_pluss_device_detail dd ON dd.type = doi.deviceType AND dd.`code` = doi.`code`
LEFT JOIN tb_pluss_device_goods dg ON dg.`code` = dd.`code`
<where>
<if test="id!= null">
and dmb.id = #{id}
</if>
<if test="alias!=null">
and mbi.alias like concat("%",#{alias},"%")
</if>
<if test="userId != null and userId != ''">
and mbi.userId = #{userId}
</if>
<if test="orderNo!= null and orderNo!=''">
and dmb.orderNo LIKE CONCAT('%',#{orderNo},'%')
</if>
<if test="transNo!= null and transNo!=''">
and dmb.transNo LIKE CONCAT('%',#{transNo},'%')
</if>
<if test="merchantCode!= null">
and dmb.merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null and merchantName!=''">
and dmb.merchantName LIKE CONCAT('%',#{merchantName},'%')
</if>
<if test="venderModel!= null">
and dmb.venderModel = #{venderModel}
</if>
<if test="status!= null and status!=''">
and dmb.status = #{status}
</if>
<if test="payCode!= null">
and dmb.payCode = #{payCode}
</if>
<if test="payName!= null">
and dmb.payName = #{payName}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(dmb.createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!=''">
<![CDATA[
and DATE_FORMAT(dmb.createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="createDt!= null">
and dmb.createDt = #{createDt}
</if>
<if test="transDt!= null">
and dmb.transDt = #{transDt}
</if>
<if test="refundNo!= null">
and dmb.refundNo = #{refundNo}
</if>
<if test="refundDt!= null">
and dmb.refundDt = #{refundDt}
</if>
<if test="expressNo!= null">
and dmb.expressNo = #{expressNo}
</if>
<if test="provinces!= null">
and dmb.provinces = #{provinces}
</if>
<if test="address!= null">
and dmb.address = #{address}
</if>
<if test="orderAmount!= null">
and dmb.orderAmount = #{orderAmount}
</if>
<if test="quantity!= null">
and dmb.quantity = #{quantity}
</if>
<if test="linkName!= null">
and dmb.linkName = #{linkName}
</if>
<if test="linkPhone!= null">
and dmb.linkPhone = #{linkPhone}
</if>
<if test="venderCode!= null">
and dmb.venderCode = #{venderCode}
</if>
<if test="email!= null">
and dmb.email = #{email}
</if>
<if test="actStatus != null ">
and dmb.actStatus = #{actStatus}
</if>
<if test="snNo != null">
and dmb.snNo = #{snNo}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryDeviceMerchantBuyPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_device_merchant_buy dmb LEFT JOIN tb_pluss_merchant_base_info mbi on
mbi.merchantCode = dmb.merchantCode
<where>
<if test="id!= null">
and dmb.id = #{id}
</if>
<if test="alias!= null">
and mbi.alias like concat("%",#{alias},"%")
</if>
<if test="orderNo!= null and orderNo!=''">
and dmb.orderNo LIKE CONCAT('%',#{orderNo},'%')
</if>
<if test="transNo!= null and transNo!=''">
and dmb.transNo LIKE CONCAT('%',#{transNo},'%')
</if>
<if test="merchantCode!= null">
and dmb.merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null and merchantName!=''">
and dmb.merchantName LIKE CONCAT('%',#{merchantName},'%')
</if>
<if test="venderModel!= null">
and dmb.venderModel = #{venderModel}
</if>
<if test="status!= null and status!=''">
and dmb.status = #{status}
</if>
<if test="payCode!= null">
and dmb.payCode = #{payCode}
</if>
<if test="payName!= null">
and dmb.payName = #{payName}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(dmb.createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!=''">
<![CDATA[
and DATE_FORMAT(dmb.createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="createDt!= null">
and dmb.createDt = #{createDt}
</if>
<if test="transDt!= null">
and dmb.transDt = #{transDt}
</if>
<if test="refundNo!= null">
and dmb.refundNo = #{refundNo}
</if>
<if test="refundDt!= null">
and dmb.refundDt = #{refundDt}
</if>
<if test="expressNo!= null">
and dmb.expressNo = #{expressNo}
</if>
<if test="provinces!= null">
and dmb.provinces = #{provinces}
</if>
<if test="address!= null">
and dmb.address = #{address}
</if>
<if test="orderAmount!= null">
and dmb.orderAmount = #{orderAmount}
</if>
<if test="quantity!= null">
and dmb.quantity = #{quantity}
</if>
<if test="linkName!= null">
and dmb.linkName = #{linkName}
</if>
<if test="linkPhone!= null">
and dmb.linkPhone = #{linkPhone}
</if>
<if test="venderCode!= null">
and dmb.venderCode = #{venderCode}
</if>
<if test="email!= null">
and dmb.email = #{email}
</if>
<if test="actStatus != null ">
and dmb.actStatus = #{actStatus}
</if>
<if test="snNo != null">
and dmb.snNo = #{snNo}
</if>
</where>
</select>
<select id="deviceOrderShowPage" parameterType="java.util.Map"
resultType="cn.pluss.platform.vo.DeviceMerchantBuyVO">
SELECT dmb.orderNo as orderNo,(dmb.orderAmount / dmb.quantity) as unitPrice,dmb.transNo as
transNo,dmb.orderAmount as orderAmount,dmb.quantity as quantity,dmb.merchantName as merchantName,dmb.venderModel
as venderModel,dmb.payCode as payCode,dmb.payName as payName,
dmb.createDt as createDt,dmb.transDt as transDt,dmb.provinces as provinces,dmb.address as address,dmb.linkName
aslinkName,dmb.linkPhone as linkPhone,dmb.expressNo as expressNo,
dmb.actStatus as actStatus,dmb.snNo as snNo,
IFNULL(pd.deviceLogo, dg.deviceLogo) as deviceLogo,
IFNULL(pd.introDesc, dg.introDesc) as introDesc,
IFNULL(pd.aisleModel, dd.aisleModel) as aisleModel,
IFNULL(pd.`name`, dg.`name`) as name,
IFNULL(pd.venderName, dd.`venderName`) as venderName,
doi.orderType
FROM tb_pluss_device_merchant_buy dmb
LEFT JOIN tb_pluss_device_order_info doi ON dmb.orderNo = doi.orderNo
LEFT JOIN tb_pluss_device pd ON dmb.venderCode=pd.venderCode
LEFT JOIN tb_pluss_merchant_base_info mbi ON dmb.merchantCode = mbi.merchantCode
LEFT JOIN tb_pluss_user_app ua ON doi.userId = ua.userId
LEFT JOIN tb_pluss_user_app ua2 ON mbi.userId = ua2.userId
LEFT JOIN tb_pluss_device_detail dd ON dd.code = doi.code AND dd.type = doi.deviceType
LEFT JOIN tb_pluss_device_goods dg ON dg.code = doi.code
<!-- 此处防止有的非商户订单 -->
WHERE (ua.userId = #{userId} OR ua2.userId = #{userId})
<if test="status!=null and status!=''">
and dmb.`status`= #{status}
</if>
order by dmb.id desc limit #{pageSize} offset #{offset}
</select>
<select id="deviceOrderShowPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(dmb.id)
FROM tb_pluss_device_merchant_buy dmb
LEFT JOIN tb_pluss_device pd ON dmb.venderCode=pd.venderCode
LEFT JOIN tb_pluss_merchant_base_info mbi ON dmb.merchantCode=mbi.merchantCode
LEFT JOIN tb_pluss_user_app ua ON mbi.userId=ua.userId
WHERE ua.userId=#{userId}
<if test="status!=null and status!=''">
and dmb.`status`=#{status}
</if>
</select>
<select id="selectDeviceMerchantBuyPage" resultType="cn.pluss.platform.entity.DeviceMerchantBuy">
SELECT dmb.*, mbi.alias, doi.userId, dg.`name`, doi.deviceType
from tb_pluss_device_merchant_buy dmb
LEFT JOIN tb_pluss_merchant_base_info mbi on mbi.merchantCode = dmb.merchantCode
LEFT JOIN tb_pluss_device_order_info doi ON doi.orderNo = dmb.orderNo
LEFT JOIN tb_pluss_device_detail dd ON dd.type = doi.deviceType AND dd.`code` = doi.`code`
LEFT JOIN tb_pluss_device_goods dg ON dg.`code` = dd.`code`
${ew.customSqlSegment}
</select>
</mapper>

View File

@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.DeviceMerchantBuyDetailMapper">
<insert id="saveDeviceMerchantBuyDetail" parameterType="cn.pluss.platform.entity.DeviceMerchantBuyDetail">
insert into tb_pluss_device_merchant_buy_detail(orderNo,soleCode)VALUES(#{orderNo},#{soleCode})
</insert>
<insert id="saveDeviceMerchantBuyDetailBatch">
insert into tb_pluss_device_merchant_buy_detail(orderNo,soleCode) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{orderNo},#{soleCode} )
</foreach>
</insert>
<select id="queryDeviceMerchantBuyDetail" parameterType="cn.pluss.platform.entity.DeviceMerchantBuyDetail" resultType="cn.pluss.platform.entity.DeviceMerchantBuyDetail">
SELECT * from tb_pluss_device_merchant_buy_detail
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="soleCode!= null">
and soleCode = #{soleCode}
</if>
</where>
</select>
<select id="queryDeviceMerchantBuyDetailList" parameterType="cn.pluss.platform.entity.DeviceMerchantBuyDetail" resultType="cn.pluss.platform.entity.DeviceMerchantBuyDetail">
SELECT * from tb_pluss_device_merchant_buy_detail
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="soleCode!= null">
and soleCode = #{soleCode}
</if>
</where>
</select>
<update id="updateDeviceMerchantBuyDetail" parameterType="cn.pluss.platform.entity.DeviceMerchantBuyDetail" >
update tb_pluss_device_merchant_buy_detail
<set>
<if test="orderNo!= null">
orderNo = #{orderNo},
</if>
<if test="soleCode!= null">
soleCode = #{soleCode}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteDeviceMerchantBuyDetail" parameterType="cn.pluss.platform.entity.DeviceMerchantBuyDetail" >
DELETE FROM tb_pluss_device_merchant_buy_detail where id=#{id}
</delete>
<select id="queryDeviceMerchantBuyDetailPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.DeviceMerchantBuyDetail">
SELECT * from tb_pluss_device_merchant_buy_detail
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="soleCode!= null">
and soleCode = #{soleCode}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryDeviceMerchantBuyDetailPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_device_merchant_buy_detail
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="soleCode!= null">
and soleCode = #{soleCode}
</if>
</where>
</select>
<select id="queryDeviceMerchantBuyDetailVO" resultType="cn.pluss.platform.vo.DeviceMerchantBuyDetailVO">
select mbd.orderNo as orderNo,mbd.soleCode as soleCode,IFNULL(dsu.status,0) as status from tb_pluss_device_merchant_buy_detail mbd
LEFT JOIN tb_pluss_device_sign_unbind dsu ON mbd.orderNo=dsu.orderNo and mbd.soleCode=dsu.soleCode
where mbd.orderNo=#{orderNo}
</select>
</mapper>

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.DeviceOperateInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceOperateInfo">
<id column="id" property="id" />
<result column="deviceNo" property="deviceNo" />
<result column="type" property="type" />
<result column="userId" property="userId" />
<result column="createTime" property="createTime" />
<result column="remark" property="remark" />
</resultMap>
<select id="selectListVo" resultType="cn.pluss.platform.vo.DeviceOperateInfoVO">
SELECT doi.*,
ua.userName,
ui.phone,
mbi.alias as 'merchantName'
FROM tb_pluss_device_operate_info doi
left join tb_pluss_user_app ua on doi.userId = ua.userId
left join tb_pluss_user_info ui on doi.userId = ui.id
left join tb_pluss_merchant_base_info mbi on doi.userId = mbi.userId
<where>
<if test="snNo != null and snNo != ''">
and deviceNo = #{snNo}
</if>
</where>
order by doi.id desc
</select>
<select id="pageInfo" resultType="cn.pluss.platform.vo.DeviceOperateInfoVO">
SELECT doi.*,
ua.userName,
ui.phone,
mbi.alias as 'merchantName'
FROM tb_pluss_device_operate_info doi
left join tb_pluss_user_app ua on doi.userId = ua.userId
left join tb_pluss_user_info ui on doi.userId = ui.id
left join tb_pluss_merchant_base_info mbi on doi.userId = mbi.userId
<where>
<if test="condition != null and condition.deviceNo != null and condition.deviceNo != ''">
and doi.deviceNo = #{condition.deviceNo}
</if>
</where>
order by doi.id desc
</select>
</mapper>

View 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="cn.pluss.platform.mapper.DeviceOrderInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceOrderInfo">
<id column="id" property="id" />
<result column="orderNo" property="orderNo" />
<result column="userId" property="userId" />
<result column="code" property="code" />
<result column="type" property="type" />
<result column="groupNo" property="groupNo" />
<result column="num" property="num" />
<result column="sumPrice" property="sumPrice" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,275 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.DeviceSignUnbindMapper">
<insert id="saveDeviceSignUnbind" parameterType="cn.pluss.platform.entity.DeviceSignUnbind">
insert into tb_pluss_device_sign_unbind(orderNo, merchantCode, merchantName, mchId, status, soleCode,
venderModel, sn, createDt, venderCode, reason)
VALUES (#{orderNo}, #{merchantCode}, #{merchantName}, #{mchId}, #{status}, #{soleCode}, #{venderModel}, #{sn},
#{createDt}, #{venderCode}, #{reason})
</insert>
<insert id="saveDeviceSignUnbindBatch">
insert into tb_pluss_device_sign_unbind(orderNo,merchantCode,merchantName,mchId,status) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{orderNo},#{merchantCode},#{merchantName},#{mchId},#{status} )
</foreach>
</insert>
<select id="queryDeviceSignUnbind" parameterType="cn.pluss.platform.entity.DeviceSignUnbind"
resultType="cn.pluss.platform.entity.DeviceSignUnbind">
SELECT * from tb_pluss_device_sign_unbind
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="mchId!= null">
and mchId = #{mchId}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="soleCode!= null">
and soleCode = #{soleCode}
</if>
<if test="venderModel!= null">
and venderModel = #{venderModel}
</if>
<if test="sn!= null">
and sn = #{sn}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="venderCode!= null">
and venderCode = #{venderCode}
</if>
<if test="reason!= null">
and reason = #{reason}
</if>
</where>
</select>
<select id="queryDeviceSignUnbindList" parameterType="cn.pluss.platform.entity.DeviceSignUnbind"
resultType="cn.pluss.platform.entity.DeviceSignUnbind">
SELECT * from tb_pluss_device_sign_unbind
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="mchId!= null">
and mchId = #{mchId}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="soleCode!= null">
and soleCode = #{soleCode}
</if>
<if test="venderModel!= null">
and venderModel = #{venderModel}
</if>
<if test="sn!= null">
and sn = #{sn}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="venderCode!= null">
and venderCode = #{venderCode}
</if>
<if test="reason!= null">
and reason = #{reason}
</if>
</where>
</select>
<update id="updateDeviceSignUnbind" parameterType="cn.pluss.platform.entity.DeviceSignUnbind">
update tb_pluss_device_sign_unbind
<set>
<if test="orderNo!= null">
orderNo = #{orderNo},
</if>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="merchantName!= null">
merchantName = #{merchantName},
</if>
<if test="mchId!= null">
mchId = #{mchId},
</if>
<if test="status!= null">
status = #{status},
</if>
<if test="soleCode!= null">
soleCode = #{soleCode},
</if>
<if test="venderModel!= null">
venderModel = #{venderModel},
</if>
<if test="sn!= null">
sn = #{sn},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="venderCode!= null">
venderCode = #{venderCode},
</if>
<if test="reason!= null">
reason = #{reason}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteDeviceSignUnbind" parameterType="cn.pluss.platform.entity.DeviceSignUnbind">
DELETE
FROM tb_pluss_device_sign_unbind
where id = #{id}
</delete>
<select id="queryDeviceSignUnbindPage" parameterType="java.util.Map"
resultType="cn.pluss.platform.entity.DeviceSignUnbind">
SELECT su.*,mbi.userId as userId from tb_pluss_device_sign_unbind su
left join tb_pluss_merchant_base_info mbi on su.merchantCode = mbi.merchantCode
<where>
<if test="id!= null">
and su.id = #{id}
</if>
<if test="userId != null">
and mbi.userId = #{userId}
</if>
<if test="orderNo!= null and orderNo!=''">
and su.orderNo LIKE CONCAT('%',#{orderNo},'%')
</if>
<if test="merchantCode!= null">
and su.merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null and merchantName!=''">
and su.merchantName LIKE CONCAT('%',#{merchantName},'%')
</if>
<if test="mchId!= null">
and su.mchId = #{mchId}
</if>
<if test="status!= null and status!=''">
and su.status = #{status}
</if>
<if test="soleCode!= null">
and su.soleCode = #{soleCode}
</if>
<if test="venderModel!= null">
and su.venderModel = #{venderModel}
</if>
<if test="sn!= null">
and su.sn = #{sn}
</if>
<if test="createDt!= null">
and su.createDt = #{createDt}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(su.createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!=''">
<![CDATA[
and DATE_FORMAT(su.createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="venderCode!= null">
and su.venderCode = #{venderCode}
</if>
<if test="reason!= null">
and su.reason = #{reason}
</if>
</where>
order by su.id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryDeviceSignUnbindPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_device_sign_unbind su
left join tb_pluss_merchant_base_info mbi on su.merchantCode = mbi.merchantCode
<where>
<if test="id!= null">
and su.id = #{id}
</if>
<if test="userId != null">
and mbi.userId = #{userId}
</if>
<if test="orderNo!= null and orderNo!=''">
and su.orderNo LIKE CONCAT('%',#{orderNo},'%')
</if>
<if test="merchantCode!= null">
and su.merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null and merchantName!=''">
and su.merchantName LIKE CONCAT('%',#{merchantName},'%')
</if>
<if test="mchId!= null">
and su.mchId = #{mchId}
</if>
<if test="status!= null and status!=''">
and su.status = #{status}
</if>
<if test="soleCode!= null">
and su.soleCode = #{soleCode}
</if>
<if test="venderModel!= null">
and su.venderModel = #{venderModel}
</if>
<if test="sn!= null">
and su.sn = #{sn}
</if>
<if test="createDt!= null">
and su.createDt = #{createDt}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(su.createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!=''">
<![CDATA[
and DATE_FORMAT(su.createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="venderCode!= null">
and su.venderCode = #{venderCode}
</if>
<if test="reason!= null">
and su.reason = #{reason}
</if>
</where>
</select>
<select id="selectPageWithMerchantInfo" resultType="cn.pluss.platform.entity.DeviceSignUnbind">
SELECT su.*,mbi.userId as userId
FROM tb_pluss_device_sign_unbind su
LEFT JOIN tb_pluss_merchant_base_info mbi on su.merchantCode = mbi.merchantCode
</select>
</mapper>

View 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="cn.pluss.platform.mapper.DeviceSpecMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceSpec">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="spec" property="spec" />
<result column="specName" property="specName" />
<result column="specDesc" property="specDesc" />
<result column="type" property="type" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
<result column="creator" property="creator" />
<result column="updater" property="updater" />
<result column="postageFlag" property="postageFlag" />
<result column="weight" property="weight" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.DeviceStockGroupMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceStockGroup">
<id column="id" property="id" />
<result column="groupCode" property="groupCode" />
<result column="groupName" property="groupName" />
<result column="desc" property="desc" />
<result column="sort" property="sort" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
<result column="creator" property="creator" />
<result column="updater" property="updater" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,224 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.DeviceStockMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceStock">
<id column="id" property="id"/>
<result column="snNo" property="snNo"/>
<result column="orderNo" property="orderNo"/>
<result column="price" property="price"/>
<result column="type" property="type"/>
<result column="groupNo" property="groupNo"/>
<result column="buyMercName" property="buyMercName"/>
<result column="buyMercId" property="buyMercId"/>
<result column="actMercName" property="actMercName"/>
<result column="actMercId" property="actMercId"/>
<result column="status" property="status"/>
<result column="createTime" property="createTime"/>
<result column="createBy" property="createBy"/>
<result column="delFlag" property="delFlag"/>
<result column="remarks" property="remarks"/>
</resultMap>
<select id="selectStockInfoList" resultType="java.util.Map">
SELECT dd.code, ds.groupNo, dd.size, count(1) count FROM tb_pluss_device_stock ds
LEFT JOIN tb_pluss_device_detail dd ON ds.groupNo = dd.groupNo AND dd.`code` = ds.`code`
WHERE ds.groupNo IN
<foreach collection="groupNoList" item="groupNo" close=")" separator="," open="(">
#{groupNo}
</foreach>
GROUP BY dd.groupNo, dd.code, dd.size;
</select>
<select id="selectSoldStockList" resultType="java.util.Map">
SELECT doi.groupNo, SUM(doi.num * dd.size) soldCount FROM tb_pluss_device_order_info doi
LEFT JOIN tb_pluss_device_detail dd ON doi.groupNo = dd.groupNo AND dd.`code` = doi.`code`
WHERE dd.groupNo IN
<foreach collection="groupNoList" item="groupNo" close=")" separator="," open="(">
#{groupNo}
</foreach>
GROUP BY groupNo;
</select>
<select id="getStockTypeNumList" resultType="cn.pluss.platform.vo.DeviceStockVO"
parameterType="cn.pluss.platform.dto.DeviceStockDTO">
SELECT
dt.`code`,
dt.`name` as deviceName,
IFNULL(ds.totalNum,0) as totalNum,
IFNULL(ds.bindNum,0) as bindNum,
IFNULL(ds.unBindNum,0) as unBindNum,
dg.deviceLogo
FROM tb_pluss_device_type dt
LEFT JOIN tb_pluss_device_goods dg ON dt.`code` = dg.`code`
LEFT JOIN (
SELECT
count(1) as totalNum,
`code`,
SUM(IF( `status` = 3, 1, 0 )) AS bindNum,
SUM(IF( `status` != 3 or `status` is null, 1, 0)) AS unBindNum
FROM
tb_pluss_device_stock
WHERE
<choose>
<when test='pType == "2"'>
belongUserId = #{userId} or belongUserId in (select userId from tb_pluss_user_app where pidArr like
CONCAT('%,',#{userId}))
</when>
<otherwise>
belongUserId = #{userId}
</otherwise>
</choose>
GROUP BY `code` ) ds
ON dt.`code` = ds.`code`
WHERE dt.showFlag = 1
</select>
<select id="pageInfo" parameterType="cn.pluss.platform.dto.DeviceStockDTO"
resultType="cn.pluss.platform.vo.DeviceStockVO">
SELECT ds.*, mbi.userId actUserId, mbi2.userId buyUserId,
dt.name as deviceName,
dg.deviceLogo,
ue.userName as extractName,
ub.userName as belongName
FROM tb_pluss_device_stock ds
left join tb_pluss_device_type dt on ds.`code` = dt.`code`
left join tb_pluss_device_goods dg on ds.`code` = dg.`code`
left join tb_pluss_user_app ue on ds.extractUserId = ue.userId
left join tb_pluss_user_app ub on ds.belongUserId = ub.userId
LEFT JOIN tb_pluss_merchant_base_info mbi ON mbi.id = ds.actMercId
LEFT JOIN tb_pluss_merchant_base_info mbi2 ON mbi2.id = ds.buyMercId
<where>
<if test="dto.code != null and dto.code != ''">
and ds.`code` = #{dto.code}
</if>
<if test="dto.userId != null">
<choose>
<when test="dto.pType != null">
<choose>
<when test='dto.pType == "2"'>
and (belongUserId = #{dto.userId} or belongUserId in (select userId from tb_pluss_user_app
where pidArr like CONCAT('%,',#{dto.userId})))
</when>
<otherwise>
and belongUserId = #{dto.userId}
</otherwise>
</choose>
</when>
<otherwise>
and ds.belongUserId = #{dto.userId}
</otherwise>
</choose>
</if>
<if test="dto.extractUserId != null">
and ds.extractUserId = #{dto.extractUserId}
</if>
<if test="dto.startDate != null and dto.startDate != ''">
and DATE_FORMAT(ds.inStockTime,'%Y-%m-%d') <![CDATA[ >= ]]> #{dto.startDate}
</if>
<if test="dto.endDate != null and dto.endDate != ''">
and DATE_FORMAT(ds.inStockTime,'%Y-%m-%d') <![CDATA[ <= ]]> #{dto.endDate}
</if>
<if test="dto.startSnNo != null and dto.startSnNo != ''">
and ds.deviceNo <![CDATA[ >= ]]> #{dto.startSnNo}
</if>
<if test="dto.endSnNo != null and dto.endSnNo != ''">
and ds.deviceNo <![CDATA[ <= ]]> #{dto.endSnNo}
</if>
<if test="dto.startDeviceNo != null and dto.startDeviceNo != ''">
and ds.snNo <![CDATA[ >= ]]> #{dto.startDeviceNo}
</if>
<if test="dto.endDeviceNo != null and dto.endDeviceNo != ''">
and ds.snNo <![CDATA[ <= ]]> #{dto.endDeviceNo}
</if>
<if test="dto.type != null and dto.type != ''">
and ds.type = #{dto.type}
</if>
<if test="dto.buyMercName != null and dto.buyMercName != ''">
and ds.buyMercName = #{dto.buyMercName}
</if>
<if test="dto.actMercName != null and dto.actMercName != ''">
and ds.actMercName = #{dto.actMercName}
</if>
<if test="dto.actUserId != null and dto.actUserId != ''">
and mbi.userId = #{dto.actUserId}
</if>
<if test="dto.deviceNo != null and dto.deviceNo != ''">
and ds.deviceNo = #{dto.deviceNo}
</if>
<if test="dto.snNo != null and dto.snNo != ''">
and (ds.snNo like CONCAT('%',#{dto.snNo},'%') or ds.deviceNo like CONCAT('%',#{dto.snNo},'%') )
</if>
<if test="dto.bindStatus != '-2'">
<choose>
<when test="dto.bindStatus == null or dto.bindStatus == '' or dto.bindStatus == '-1'">
and ds.status in ('1','2')
</when>
<otherwise>
and ds.status = '3'
</otherwise>
</choose>
</if>
</where>
order by ds.id desc
</select>
<select id="detail" parameterType="cn.pluss.platform.dto.DeviceStockDTO"
resultType="cn.pluss.platform.vo.DeviceStockVO">
SELECT ds.*,
ua1.userName as belongName,
ui1.phone as belongPhone,
ua2.userName as extractName,
ui2.phone as extractPhone
FROM tb_pluss_device_stock ds
left join tb_pluss_user_app ua1 on ds.belongUserId = ua1.userId
left join tb_pluss_user_info ui1 on ds.belongUserId = ui1.id
left join tb_pluss_user_app ua2 on ds.extractUserId = ua2.userId
left join tb_pluss_user_info ui2 on ds.extractUserId = ui2.id
<where>
ds.`snNo` = #{snNo}
</where>
</select>
<select id="getMercInfo" parameterType="cn.pluss.platform.dto.DeviceStockDTO"
resultType="cn.pluss.platform.vo.DeviceStockVO">
SELECT ds.actMercName,
ui.phone as mercPhone,
IFNULL(ds.bindTime,ds.updateTime) as bindTime
FROM tb_pluss_device_stock ds
left join tb_pluss_merchant_base_info mbi on ds.actMercId = mbi.id
left join tb_pluss_user_info ui on mbi.userId = ui.id
<where>
ds.`snNo` = #{snNo}
</where>
</select>
<select id="pageDeviceStock" resultType="cn.pluss.platform.vo.DeviceStockVO">
SELECT ds.*, dt.`name` deviceName, spec.specName typeDesc, dg.deviceLogo, dt.payCodeFlag, mcp.name cashPlaceName
FROM tb_pluss_device_stock ds
LEFT JOIN tb_pluss_merchant_base_info mbi ON ds.actMercId = mbi.id
LEFT JOIN tb_pluss_device_type dt ON dt.`code` = ds.`code`
LEFT JOIN tb_pluss_device_spec spec ON ds.`code` = spec.`code` AND ds.type = spec.spec
LEFT JOIN tb_pluss_merchant_cash_pay_code mcpc ON mcpc.payCode = ds.snNo
LEFT JOIN tb_pluss_merchant_cash_place mcp ON mcpc.cashPlaceId = mcp.id
LEFT JOIN tb_pluss_device_goods dg ON dg.`code` = ds.`code`
<where>
<if test="userId != null">
AND mbi.userId = #{userId}
</if>
<if test="cashPlaceId != null">
AND mcpc.cashPlaceId = #{cashPlaceId}
</if>
</where>
</select>
</mapper>

View 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="cn.pluss.platform.mapper.DeviceTransferDetailMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceTransferDetail">
<id column="id" property="id" />
<result column="tid" property="tid" />
<result column="deviceNo" property="deviceNo" />
<result column="createTime" property="createTime" />
<result column="batchNo" property="batchNo" />
</resultMap>
<select id="selectListByTid" resultType="cn.pluss.platform.vo.DeviceTransferDetailVO">
SELECT dtd.*,
ds.snNo,
dt.name as deviceName,
IF(ds.status = '3',ds.actMercName,'未绑定') as bindDesc,
ds.inStockTime
from tb_pluss_device_transfer_detail dtd
left join tb_pluss_device_stock ds on dtd.deviceNo = ds.snNo
left join tb_pluss_device_type dt on ds.`code` = dt.`code`
where dtd.tid = #{tid}
</select>
</mapper>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.DeviceTransferMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceTransfer">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="acceptUserId" property="acceptUserId" />
<result column="status" property="status" />
<result column="transferTime" property="transferTime" />
<result column="acceptTime" property="acceptTime" />
<result column="batchNo" property="batchNo" />
<result column="remark" property="remark" />
</resultMap>
<select id="pageInfo" parameterType="cn.pluss.platform.dto.DeviceTransferDTO" resultType="cn.pluss.platform.vo.DeviceTransferVO">
SELECT
dt.*,
ui1.phone,
ua1.userName,
ui2.phone as acceptPhone,
ua2.userName as acceptName
FROM tb_pluss_device_transfer dt
left join tb_pluss_user_info ui1 on dt.userId = ui1.id
left join tb_pluss_user_app ua1 on dt.userId = ua1.userId
left join tb_pluss_user_info ui2 on dt.acceptUserId = ui2.id
left join tb_pluss_user_app ua2 on dt.acceptUserId = ua2.userId
<where>
<if test="dto.userId != null">
and dt.userId = #{dto.userId}
</if>
<if test="dto.acceptUserId != null">
and dt.acceptUserId = #{dto.acceptUserId}
</if>
</where>
</select>
<select id="selectByIdVo" resultType="cn.pluss.platform.vo.DeviceTransferVO">
SELECT
dt.*,
ui1.phone,
ua1.userName,
ui2.phone as acceptPhone,
ua2.userName as acceptName
FROM tb_pluss_device_transfer dt
left join tb_pluss_user_info ui1 on dt.userId = ui1.id
left join tb_pluss_user_app ua1 on dt.userId = ua1.userId
left join tb_pluss_user_info ui2 on dt.acceptUserId = ui2.id
left join tb_pluss_user_app ua2 on dt.acceptUserId = ua2.userId
where dt.id = #{id}
</select>
</mapper>

View 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="cn.pluss.platform.mapper.DeviceTypeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceType">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="name" property="name" />
<result column="desc" property="desc" />
<result column="weight" property="weight" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
<result column="creator" property="creator" />
<result column="updater" property="updater" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.DeviceVoiceBoxMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceVoiceBox">
<id column="id" property="id" />
<result column="boxName" property="boxName" />
<result column="boxNo" property="boxNo" />
<result column="buyMercName" property="buyMercName" />
<result column="buyMercId" property="buyMercId" />
<result column="orderNo" property="orderNo" />
<result column="actMercName" property="actMercName" />
<result column="actMercId" property="actMercId" />
<result column="status" property="status" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.DeviceVoiceBoxMsgMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.DeviceVoiceBoxMsg">
<id column="id" property="id" />
<result column="requestId" property="requestId" />
<result column="msgId" property="msgId" />
<result column="body" property="body" />
<result column="createTime" property="createTime" />
<result column="deviceNo" property="deviceNo" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.DictMapper">
<select id="getDictByCode" resultType="cn.pluss.platform.entity.Dict">
SELECT d1.id, d1.pid, d1.sort, d1.code, d1.name, d1.desc, d1.value, d1.createTime, d1.updateTime, d2.code pCode FROM tb_pluss_dict d1 LEFT JOIN tb_pluss_dict d2 ON d1.pId = d2.id
<where>
d2.code IN
<foreach collection="codeList" item="item" close=")" open="(" separator=",">
#{item}
</foreach>
</where>
ORDER BY sort
</select>
<select id="selectDictPage" resultType="cn.pluss.platform.entity.Dict">
select id,pid,sort,code,name,describes,codeValue,createTime,updateTime
from tb_pluss_dict
order by sort
</select>
<select id="selectMaxSortElem" resultType="cn.pluss.platform.entity.Dict">
SELECT MAX(t.sort) sort, t2.id FROM tb_pluss_dict t LEFT JOIN tb_pluss_dict t2 ON t.pid = t2.id
WHERE t2.code = #{code} GROUP BY t2.id
</select>
<select id="selectByNameAndPCode" resultType="cn.pluss.platform.entity.Dict">
SELECT
d1.code, d1.name, d1.desc, d1.value, d1.createTime, d1.updateTime
FROM tb_pluss_dict d1 LEFT JOIN tb_pluss_dict d2 ON d1.pid = d2.id
WHERE d2.code = #{code} AND d1.name = #{name}
</select>
</mapper>

View 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="cn.pluss.platform.mapper.EncryptKeyMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.EncryptKey">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="code" property="code" />
<result column="desc" property="desc" />
<result column="priKey" property="priKey" />
<result column="pubKey" property="pubKey" />
<result column="version" property="version" />
<result column="status" property="status" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.ExtraLevelBenefitMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.ExtraLevelBenefit">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="maxCount" property="maxCount" />
<result column="useCount" property="useCount" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,752 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.FansMapper">
<insert id="saveFans" parameterType="cn.pluss.platform.entity.Fans">
insert into tb_pluss_fans(userId,logo,nickName,consumMoney,merchantCode,merchantName,consumAddress,consumTime,orderNumber,createDt,lastMerchantCode,shareMoney,lastconsumTime,lastOrderNumber,payWay,isUse)VALUES(#{userId},#{logo},#{nickName},#{consumMoney},#{merchantCode},#{merchantName},#{consumAddress},#{consumTime},#{orderNumber},now(),#{lastMerchantCode},#{shareMoney},#{lastconsumTime},#{lastOrderNumber},#{payWay},#{isUse})
</insert>
<select id="queryFans" parameterType="cn.pluss.platform.entity.Fans" resultType="cn.pluss.platform.entity.Fans">
SELECT * from tb_pluss_fans
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="consumMoney!= null">
and consumMoney = #{consumMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="consumAddress!= null">
and consumAddress = #{consumAddress}
</if>
<if test="consumTime!= null">
and consumTime = #{consumTime}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="lastMerchantCode!= null">
and lastMerchantCode = #{lastMerchantCode}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="lastconsumTime!= null">
and lastconsumTime = #{lastconsumTime}
</if>
<if test="lastOrderNumber!= null">
and lastOrderNumber = #{lastOrderNumber}
</if>
<if test="payWay!= null">
and payWay = #{payWay}
</if>
<if test="isUse!= null">
and isUse = #{isUse}
</if>
</where>
</select>
<!-- queryFansTodayCount -->
<select id="queryFansTodayCount" parameterType="cn.pluss.platform.entity.Fans" resultType="java.lang.Double">
select sum(shareMoney) from tb_pluss_fans
<where>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="stTime!= null">
and createDt &gt;= #{stTime}
</if>
<if test="endTime!= null">
and createDt &lt;= #{endTime}
</if>
</where>
<!-- <where>
<if test="stTime!= null">
and createDt &gt;= #{stTime}
</if>
<if test="endTime!= null">
and createDt &lt;= #{endTime}
</if>
</where> -->
</select>
<select id="queryFansList" parameterType="cn.pluss.platform.entity.Fans" resultType="cn.pluss.platform.entity.Fans">
SELECT * from tb_pluss_fans
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null">
and nickName like concat("%",#{nickName},"%")
</if>
<if test="consumMoney!= null">
and consumMoney = #{consumMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="consumAddress!= null">
and consumAddress = #{consumAddress}
</if>
<if test="consumTime!= null">
and consumTime = #{consumTime}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="stTime!= null">
and createDt &gt;= #{stTime}
</if>
<if test="endTime!= null">
and createDt &lt;= #{endTime}
</if>
<if test="lastMerchantCode!= null">
and lastMerchantCode = #{lastMerchantCode}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="lastconsumTime!= null">
and lastconsumTime = #{lastconsumTime}
</if>
<if test="lastOrderNumber!= null">
and lastOrderNumber = #{lastOrderNumber}
</if>
<if test="payWay!= null">
and payWay = #{payWay}
</if>
<if test="isUse!= null">
and isUse = #{isUse}
</if>
</where>
</select>
<update id="updateFans" parameterType="cn.pluss.platform.entity.Fans">
update tb_pluss_fans
<set>
<if test="userId!= null">
userId = #{userId},
</if>
<if test="logo!= null">
logo = #{logo},
</if>
<if test="nickName!= null">
nickName = #{nickName},
</if>
<if test="consumMoney!= null">
consumMoney = #{consumMoney},
</if>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="merchantName!= null">
merchantName = #{merchantName},
</if>
<if test="consumAddress!= null">
consumAddress = #{consumAddress},
</if>
<if test="consumTime!= null">
consumTime = #{consumTime},
</if>
<if test="orderNumber!= null">
orderNumber = #{orderNumber},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="lastMerchantCode!= null">
lastMerchantCode = #{lastMerchantCode},
</if>
<if test="shareMoney!= null">
shareMoney = #{shareMoney},
</if>
<if test="lastconsumTime!= null">
lastconsumTime = #{lastconsumTime},
</if>
<if test="lastOrderNumber!= null">
lastOrderNumber = #{lastOrderNumber},
</if>
<if test="payWay!= null">
payWay = #{payWay},
</if>
<if test="isUse!= null">
isUse = #{isUse}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteFans" parameterType="cn.pluss.platform.entity.Fans">
DELETE FROM tb_pluss_fans where id=#{id}
</delete>
<select id="queryFansPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.Fans">
SELECT * from tb_pluss_fans
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null">
and nickName like CONCAT("%",#{nickName},"%")
</if>
<if test="consumMoney!= null">
and consumMoney = #{consumMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="consumAddress!= null">
and consumAddress = #{consumAddress}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="lastMerchantCode!= null">
and lastMerchantCode = #{lastMerchantCode}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="lastconsumTime!= null">
and lastconsumTime = #{lastconsumTime}
</if>
<if test="lastOrderNumber!= null">
and lastOrderNumber = #{lastOrderNumber}
</if>
<if test="payWay!= null">
and payWay = #{payWay}
</if>
<if test="payWay!= null">
and payWay = #{payWay}
</if>
<if test="startTime!= null">
and createDt &gt; #{startTime}
</if>
<if test="endTime!= null">
and createDt &lt; #{endTime}
</if>
<if test="isUse!= null">
and isUse = #{isUse}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryFansPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_fans
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null and nickName!= ''">
and nickName like CONCAT("%",#{nickName},"%")
</if>
<if test="consumMoney!= null">
and consumMoney = #{consumMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="consumAddress!= null">
and consumAddress = #{consumAddress}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="lastMerchantCode!= null">
and lastMerchantCode = #{lastMerchantCode}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="lastconsumTime!= null">
and lastconsumTime = #{lastconsumTime}
</if>
<if test="lastOrderNumber!= null">
and lastOrderNumber = #{lastOrderNumber}
</if>
<if test="payWay!= null">
and payWay = #{payWay}
</if>
<if test="isUse!= null">
and isUse = #{isUse}
</if>
<if test="startTime != null ">
<![CDATA[
and DATE_FORMAT(consumTime, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime != null ">
<![CDATA[
and DATE_FORMAT(consumTime, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<select id="queryFansNoPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_fans
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null and nickName!= ''">
and nickName like CONCAT("%",#{nickName},"%")
</if>
<if test="consumMoney!= null">
and consumMoney = #{consumMoney}
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="consumAddress!= null">
and consumAddress = #{consumAddress}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="lastMerchantCode!= null">
and lastMerchantCode = #{lastMerchantCode}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="lastconsumTime!= null">
and lastconsumTime = #{lastconsumTime}
</if>
<if test="lastOrderNumber!= null">
and lastOrderNumber = #{lastOrderNumber}
</if>
<if test="payWay!= null">
and payWay = #{payWay}
</if>
<if test="isUse!= null">
and isUse = #{isUse}
</if>
<if test="startTime != null ">
<![CDATA[
and DATE_FORMAT(consumTime, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime != null ">
<![CDATA[
and DATE_FORMAT(consumTime, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<select id="sumConsumMoneyByMerchantCode" parameterType="java.util.Map" resultType="java.lang.Double">
select sum(consumMoney) from tb_pluss_fans
where merchantCode=#{merchantCode} and consumTime &gt; #{startTime} and consumTime &lt; #{endTime}
</select>
<!--获取当天的粉丝集合 -->
<select id="queryNowDateFansList" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.Fans">
select * From tb_pluss_fans where userId = #{userId} and date(consumTime) = curdate() order by consumTime desc
</select>
<select id="queryFansPageManage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.Fans">
SELECT * from tb_pluss_fans
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null">
and nickName like CONCAT("%",#{nickName},"%")
</if>
<if test="consumMoney!= null">
and consumMoney = #{consumMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="consumAddress!= null">
and consumAddress = #{consumAddress}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="lastMerchantCode!= null">
and lastMerchantCode = #{lastMerchantCode}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="lastconsumTime!= null">
and lastconsumTime = #{lastconsumTime}
</if>
<if test="lastOrderNumber!= null">
and lastOrderNumber = #{lastOrderNumber}
</if>
<if test="payWay!= null">
and payWay = #{payWay}
</if>
<if test="isUse!= null">
and isUse = #{isUse}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryFansPageCountManage" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_fans
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null">
and nickName like CONCAT("%",#{nickName},"%")
</if>
<if test="consumMoney!= null">
and consumMoney = #{consumMoney}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="consumAddress!= null">
and consumAddress = #{consumAddress}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="lastMerchantCode!= null">
and lastMerchantCode = #{lastMerchantCode}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="lastconsumTime!= null">
and lastconsumTime = #{lastconsumTime}
</if>
<if test="lastOrderNumber!= null">
and lastOrderNumber = #{lastOrderNumber}
</if>
<if test="payWay!= null">
and payWay = #{payWay}
</if>
<if test="isUse!= null">
and isUse = #{isUse}
</if>
</where>
</select>
<!--查询某一粉丝最后一次的消费记录 -->
<select id="queryLastFansByUserId" resultType="cn.pluss.platform.entity.Fans">
select * from tb_pluss_fans WHERE userId=#{userId} ORDER BY consumTime desc limit 1
</select>
<select id="queryFansConsumPage" parameterType="java.util.Map" resultType="cn.pluss.platform.vo.FansConsumVO">
select pf.id as id,pf.userId as userId,pf.logo as logo,pf.nickName as nickName,pf.consumMoney as
consumMoney,pf.merchantCode as merchantCode,mbi.merchantName as
lastMerchantName,pf.lastMerchantCode,pf.merchantName as
merchantName,pf.shareMoney,pf.consumTime,pf.lastconsumTime,pf.orderNumber,pf.lastOrderNumber,pf.createDt,pf.payWay
from tb_pluss_fans pf left join tb_pluss_merchant_base_info mbi on mbi.merchantCode=pf.lastMerchantCode
<where>
<if test="merchantName!=null and merchantName!=''">
and pf.merchantName like concat("%",#{merchantName},"%")
</if>
<if test="nickName!=null and nickName!=''">
and pf.nickName like concat("%",#{nickName},"%")
</if>
<if test="merchantCode!=null and merchantCode!=''">
and pf.merchantCode like concat("%",#{merchantCode},"%")
</if>
<if test="lastMerchantName!=null and lastMerchantName!=''">
and mbi.merchantName like concat("%",#{lastMerchantName},"%")
</if>
<if test="orderNumber!=null and orderNumber!=''">
and pf.orderNumber like concat("%",#{orderNumber},"%")
</if>
<if test="lastOrderNumber!=null and lastOrderNumber!=''">
and pf.lastOrderNumber like concat("%",#{lastOrderNumber},"%")
</if>
<if test="startTime!= null">
<![CDATA[
and DATE_FORMAT(pf.consumTime, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null">
<![CDATA[
and DATE_FORMAT(pf.consumTime, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
order by pf.id DESC limit #{pageSize} offset #{offset}
</select>
<select id="queryFansNoConsumPage" parameterType="java.util.Map" resultType="cn.pluss.platform.vo.FansConsumVO">
select pf.id as id,pf.userId as userId,pf.logo as logo,pf.nickName as nickName,pf.consumMoney as
consumMoney,pf.merchantCode as merchantCode,mbi.merchantName as
lastMerchantName,pf.lastMerchantCode,pf.merchantName as
merchantName,pf.shareMoney,pf.consumTime,pf.lastconsumTime,pf.orderNumber,pf.lastOrderNumber,pf.createDt,pf.payWay
from tb_pluss_fans pf left join tb_pluss_merchant_base_info mbi on mbi.merchantCode=pf.lastMerchantCode
<where>
<if test="merchantName!=null and merchantName!=''">
and pf.merchantName like concat("%",#{merchantName},"%")
</if>
<if test="nickName!=null and nickName!=''">
and pf.nickName like concat("%",#{nickName},"%")
</if>
<if test="merchantCode!=null and merchantCode!=''">
and pf.merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="lastMerchantName!=null and lastMerchantName!=''">
and mbi.merchantName like concat("%",#{lastMerchantName},"%")
</if>
<if test="orderNumber!=null and orderNumber!=''">
and pf.orderNumber like concat("%",#{orderNumber},"%")
</if>
<if test="lastOrderNumber!=null and lastOrderNumber!=''">
and pf.lastOrderNumber like concat("%",#{lastOrderNumber},"%")
</if>
<if test="startTime!= null">
<![CDATA[
and DATE_FORMAT(pf.consumTime, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null">
<![CDATA[
and DATE_FORMAT(pf.consumTime, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
order by pf.id DESC limit #{pageSize} offset #{offset}
</select>
<select id="queryFansConsumPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select count(pf.id) from tb_pluss_fans pf left join tb_pluss_merchant_base_info mbi on
mbi.merchantCode=pf.lastMerchantCode
<where>
<if test="merchantName!=null and merchantName!=''">
and pf.merchantName like concat("%",#{merchantName},"%")
</if>
<if test="nickName!=null and nickName!=''">
and pf.nickName like concat("%",#{nickName},"%")
</if>
<if test="merchantCode!=null and merchantCode!=''">
and pf.merchantCode like concat("%",#{merchantCode},"%")
</if>
<if test="lastMerchantName!=null and lastMerchantName!=''">
and mbi.merchantName like concat("%",#{lastMerchantName},"%")
</if>
<if test="orderNumber!=null and orderNumber!=''">
and pf.orderNumber like concat("%",#{orderNumber},"%")
</if>
<if test="lastOrderNumber!=null and lastOrderNumber!=''">
and pf.lastOrderNumber like concat("%",#{lastOrderNumber},"%")
</if>
<if test="startTime!= null">
<![CDATA[
and DATE_FORMAT(pf.consumTime, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null">
<![CDATA[
and DATE_FORMAT(pf.consumTime, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<select id="queryFansNoConsumPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select count(pf.id) from tb_pluss_fans pf left join tb_pluss_merchant_base_info mbi on
mbi.merchantCode=pf.lastMerchantCode
<where>
<if test="merchantName!=null and merchantName!=''">
and pf.merchantName like concat("%",#{merchantName},"%")
</if>
<if test="nickName!=null and nickName!=''">
and pf.nickName like concat("%",#{nickName},"%")
</if>
<if test="merchantCode!=null and merchantCode!=''">
and pf.merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="lastMerchantName!=null and lastMerchantName!=''">
and mbi.merchantName like concat("%",#{lastMerchantName},"%")
</if>
<if test="orderNumber!=null and orderNumber!=''">
and pf.orderNumber like concat("%",#{orderNumber},"%")
</if>
<if test="lastOrderNumber!=null and lastOrderNumber!=''">
and pf.lastOrderNumber like concat("%",#{lastOrderNumber},"%")
</if>
<if test="startTime!= null">
<![CDATA[
and DATE_FORMAT(pf.consumTime, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null">
<![CDATA[
and DATE_FORMAT(pf.consumTime, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<select id="queryFansSumConsumMoney" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(consumMoney) from tb_pluss_fans
<where>
<if test="lastMerchantCode!= null">
and lastMerchantCode = #{lastMerchantCode}
</if>
<if test="startTime!= null">
and createDt &gt; #{startTime}
</if>
<if test="endTime!= null">
and createDt &lt; #{endTime}
</if>
</where>
</select>
<select id="queryFansSumShareMoney" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(shareMoney) from tb_pluss_fans
<where>
<if test="lastMerchantCode!= null">
and lastMerchantCode = #{lastMerchantCode}
</if>
<if test="startTime!= null">
and createDt &gt; #{startTime}
</if>
<if test="endTime!= null">
and createDt &lt; #{endTime}
</if>
</where>
</select>
<select id="selectGroupData" resultType="cn.pluss.platform.entity.Fans">
SELECT
SUM( shareMoney ) shareMoney,
lastMerchantCode
FROM
tb_pluss_fans
where lastMerchantCode IN
<foreach collection="lastMerchantCodeList" close=")" separator="," open="(" item="item">
#{item}
</foreach>
GROUP BY lastMerchantCode
</select>
</mapper>

View File

@@ -0,0 +1,264 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.FansConsumReturnMapper">
<insert id="saveFansConsumReturn" parameterType="cn.pluss.platform.entity.FansConsumReturn">
insert into tb_pluss_fans_consum_return(logo,nickName,consumMony,merchantCode,merchantName,returnMoney,consumTime,orderNumber,createDt)VALUES(#{logo},#{nickName},#{consumMony},#{merchantCode},#{merchantName},#{returnMoney},#{consumTime},#{orderNumber},#{createDt})
</insert>
<insert id="saveFansConsumReturnBatch">
insert into tb_pluss_fans_consum_return(logo,nickName,consumMony,merchantCode,merchantName,returnMoney,consumTime,orderNumber,createDt) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{logo},#{nickName},#{consumMony},#{merchantCode},#{merchantName},#{returnMoney},#{consumTime},#{orderNumber},#{createDt} )
</foreach>
</insert>
<select id="queryFansConsumReturn" parameterType="cn.pluss.platform.entity.FansConsumReturn" resultType="cn.pluss.platform.entity.FansConsumReturn">
SELECT * from tb_pluss_fans_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="consumMony!= null">
and consumMony = #{consumMony}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
and consumTime &gt; #{startTime} and consumTime &lt; #{endTime}
</where>
</select>
<select id="queryFansConsumReturnList" parameterType="cn.pluss.platform.entity.FansConsumReturn" resultType="cn.pluss.platform.entity.FansConsumReturn">
SELECT * from tb_pluss_fans_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="consumMony!= null">
and consumMony = #{consumMony}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="consumTime!= null">
and consumTime = #{consumTime}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
</select>
<update id="updateFansConsumReturn" parameterType="cn.pluss.platform.entity.FansConsumReturn" >
update tb_pluss_fans_consum_return
<set>
<if test="logo!= null">
logo = #{logo},
</if>
<if test="nickName!= null">
nickName = #{nickName},
</if>
<if test="consumMony!= null">
consumMony = #{consumMony},
</if>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="merchantName!= null">
merchantName = #{merchantName},
</if>
<if test="returnMoney!= null">
returnMoney = #{returnMoney},
</if>
<if test="consumTime!= null">
consumTime = #{consumTime}
</if>
<if test="orderNumber!= null">
orderNumber = #{orderNumber},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
</set>
where id=#{id}
</update>
<delete id="deleteFansConsumReturn" parameterType="cn.pluss.platform.entity.FansConsumReturn" >
DELETE FROM tb_pluss_fans_consum_return where id=#{id}
</delete>
<select id="queryFansConsumReturnPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.FansConsumReturn">
SELECT * from tb_pluss_fans_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null">
and nickName like CONCAT("%",#{nickName},"%")
</if>
<if test="consumMony!= null">
and consumMony = #{consumMony}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="startTime!= null">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryFansConsumReturnPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_fans_consum_return
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="nickName!= null">
and nickName like CONCAT("%",#{nickName},"%")
</if>
<if test="consumMony!= null">
and consumMony = #{consumMony}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="returnMoney!= null">
and returnMoney = #{returnMoney}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="startTime!= null">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<!-- 统计粉丝消费金额 统计粉丝消费奖励金额 -->
<select id="sumFansConsumReturnInfo" resultType="cn.pluss.platform.vo.FansInfoCountVO">
select (SELECT IFNULL(SUM(consumMoney),0) FROM tb_pluss_fans WHERE lastMerchantCode=#{merchantCode} AND date(createDt) = curdate()) AS fansConsumMonyNowDayCount,(select IFNULL(SUM(shareMoney),0) from tb_pluss_fans where lastMerchantCode=#{merchantCode} AND date(createDt) = curdate()) as fansReturnMoneyNowDayCount
</select>
<!-- 可提现总金额(提现规则 超过一个月的时间) -->
<select id="sumFansAllowCashMoney" parameterType="java.util.Map" resultType="java.lang.Double">
select IFNULL(sum(shareMoney),0) as returnMoney from tb_pluss_fans where lastMerchantCode=#{merchantCode} and createDt &lt;= (SELECT DATE_ADD(now(),INTERVAL -1 DAY))
</select>
<!--不可提现金额 (为超过一个月 不可提现) -->
<select id="sumFansNotAllowCashMoney" parameterType="java.util.Map" resultType="java.lang.Double">
select IFNULL(sum(shareMoney),0) as returnMoney from tb_pluss_fans where lastMerchantCode=#{merchantCode} and createDt &gt; (SELECT DATE_ADD(now(),INTERVAL -1 DAY))
</select>
<!-- 今日分润 -->
<select id="sumNowDayShareMoney" parameterType="java.util.Map" resultType="java.lang.Double">
select IFNULL(sum(shareMoney),0) as returnMoney From tb_pluss_fans where lastMerchantCode=#{merchantCode} and createDt &gt; #{startTime} and createDt &lt; #{endTime}
</select>
<!-- 今日奖励 -->
<select id="sumNowReturnMoney" parameterType="java.util.Map" resultType="java.lang.Double">
select IFNULL(sum(shareMoney),0) as returnMoney From tb_pluss_fans where lastMerchantCode=#{merchantCode} and createDt &gt; #{startTime} and createDt &lt; #{endTime}
</select>
<!-- 累计总分润 -->
<select id="sumAllShareMoney" parameterType="java.util.Map" resultType="java.lang.Double">
select IFNULL(sum(shareMoney),0) as returnMoney From tb_pluss_fans where lastMerchantCode=#{merchantCode}
</select>
<!-- 累计总分润 -->
<select id="sumShareMoney" parameterType="java.util.Map" resultType="java.lang.Double">
select IFNULL(sum(returnMoney),0) as returnMoney From tb_pluss_fans_consum_return
</select>
<select id="sumReturnMoneyByTime" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(returnMoney) from tb_pluss_fans_consum_return
<where>
<if test="startTime!= null">
and consumTime &gt; #{startTime}
</if>
<if test="endTime!= null">
and consumTime &lt; #{endTime}
</if>
<if test="childList!= null">
and merchantCode in
(
<foreach collection="childList" item="item" index="index" separator=",">
#{merchantCode}
</foreach>
)
</if>
</where>
</select>
</mapper>

View 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="cn.pluss.platform.mapper.GuideLabelMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.GuideLabel">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="status" property="status" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.HelpVideoMapper">
<insert id="saveHelpVideo" parameterType="cn.pluss.platform.entity.HelpVideo">
insert into tb_pluss_help_video(name,createDt,content,videoUrl,type)VALUES(#{name},NOW(),#{content},#{videoUrl},#{type})
</insert>
<insert id="saveHelpVideoBatch">
insert into tb_pluss_help_video(name,createDt,content,videoUrl,type) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{name},#{createDt},#{content},#{videoUrl},#{type} )
</foreach>
</insert>
<select id="queryHelpVideo" parameterType="cn.pluss.platform.entity.HelpVideo" resultType="cn.pluss.platform.entity.HelpVideo">
SELECT * from tb_pluss_help_video
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="videoUrl!= null">
and videoUrl = #{videoUrl}
</if>
<if test="type!= null">
and type = #{type}
</if>
</where>
</select>
<select id="queryHelpVideoList" parameterType="cn.pluss.platform.entity.HelpVideo" resultType="cn.pluss.platform.entity.HelpVideo">
SELECT * from tb_pluss_help_video
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="videoUrl!= null">
and videoUrl = #{videoUrl}
</if>
<if test="type!= null">
and type = #{type}
</if>
</where>
</select>
<update id="updateHelpVideo" parameterType="cn.pluss.platform.entity.HelpVideo" >
update tb_pluss_help_video
<set>
<if test="name!= null">
name = #{name},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="content!= null">
content = #{content},
</if>
<if test="videoUrl!= null">
videoUrl = #{videoUrl},
</if>
<if test="type!= null">
type = #{type}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteHelpVideo" parameterType="cn.pluss.platform.entity.HelpVideo" >
DELETE FROM tb_pluss_help_video where id=#{id}
</delete>
<select id="queryHelpVideoPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.HelpVideo">
SELECT * from tb_pluss_help_video
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name like CONCAT("%",#{name},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="videoUrl!= null">
and videoUrl = #{videoUrl}
</if>
<if test="type!= null">
and type = #{type}
</if>
</where>
order by sort limit #{pageSize} offset #{offset}
</select>
<select id="queryHelpVideoPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_help_video
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="content!= null">
and content = #{content}
</if>
<if test="videoUrl!= null">
and videoUrl = #{videoUrl}
</if>
<if test="type!= null">
and type = #{type}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,951 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.HomeMapper">
<select id="queryMerchantBaseInfoPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_merchant_base_info
</select>
<select id="queryMerchantFansCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM tb_pluss_fans pf
LEFT JOIN tb_pluss_merchant_base_info mbi
ON mbi.merchantCode = pf.merchantCode
<where>
pf.nickName is not null and pf.nickName!=''
<if test="merchantCode!=null and merchantCode!=''">
and mbi.bindingCode =( SELECT bindingCode FROM tb_pluss_merchant_base_info WHERE merchantCode = #{merchantCode})
</if>
</where>
</select>
<select id="queryTodayFanCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_fans
<where>
nickName is not null and nickName!=''
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="stTime != null ">
<![CDATA[
and DATE_FORMAT(consumTime, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{stTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime != null ">
<![CDATA[
and DATE_FORMAT(consumTime, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<select id="getOrderFeeSum1" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(consumeFee) from tb_pluss_merchant_order
<where>
<include refid="commom_where_if"/>
</where>
</select>
<select id="queryMerchantOrderPageCount"
parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(1) from tb_pluss_merchant_order
<where>
<include refid="commom_where_if"/>
<if test="stTime != null ">
<![CDATA[
and DATE_FORMAT(transDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{stTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime != null ">
<![CDATA[
and DATE_FORMAT(transDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
</select>
<select id="manageQueryMerchantMenberPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(1) from tb_pluss_merchant_menber mm LEFT JOIN tb_pluss_merchant_base_info mbi on mbi.merchantCode = mm.merchantCode
<where>
<if test="merchantCode!= null">
and mbi.merchantCode in (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode =(SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="nickName == null">
and mm.nickName !='null'
</if>
</where>
</select>
<select id="manageMerchantMenberSum" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT SUM(mm.usableRechargeFee+mm.usableGiveFee)
FROM tb_pluss_merchant_menber mm
LEFT JOIN tb_pluss_merchant_base_info mbi ON mbi.merchantCode = mm.merchantCode
WHERE mm.merchantCode in (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</select>
<select id="queryFansList" parameterType="cn.pluss.platform.entity.Fans" resultType="cn.pluss.platform.entity.Fans">
SELECT * from tb_pluss_fans
<where>
lastMerchantCode IS NOT NULL
<if test="merchantCode!= null">
and lastMerchantCode in (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode =(SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
</where>
</select>
<select id="getToDayTransSum1" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(consumeFee) from tb_pluss_merchant_order
<where>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="consumeFee!= null">
and consumeFee = #{consumeFee}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="endTime != null">
and createDt <![CDATA[<=]]> #{endTime}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="stTime!= null">
and transDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and transDt <![CDATA[<=]]> #{endTime}
</if>
</where>
</select>
<select id="toDayTransZfbSum" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(consumeFee) from tb_pluss_merchant_order
<where>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="consumeFee!= null">
and consumeFee = #{consumeFee}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="endTime != null">
and createDt &lt;= #{endTime}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="stTime!= null">
and transDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and transDt <![CDATA[<=]]> #{endTime}
</if>
and (payTypeCode='leshuaPay0' or payTypeCode= 'aliPay' or payTypeCode='sxfPay0')
</where>
</select>
<select id="toDayTransWxSum" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(consumeFee) from tb_pluss_merchant_order
<where>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="consumeFee!= null">
and consumeFee = #{consumeFee}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="endTime != null">
and createDt &lt;= #{endTime}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="stTime!= null">
and transDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and transDt <![CDATA[<=]]> #{endTime}
</if>
and (payTypeCode='leshuaPay1' or payTypeCode= 'wechatPay' or payTypeCode='sxfPay1')
</where>
</select>
<select id="toDayTransYsfSum" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(consumeFee) from tb_pluss_merchant_order
<where>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="consumeFee!= null">
and consumeFee = #{consumeFee}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="endTime != null">
and createDt &lt;= #{endTime}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="stTime!= null">
and transDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and transDt <![CDATA[<=]]> #{endTime}
</if>
and payTypeCode='sxfPay2'
</where>
</select>
<select id="toDayTransZfbCount"
parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_merchant_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNumber!= null">
and orderNumber like CONCAT("%",#{orderNumber},"%")
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="payTypeCode!= null">
and payTypeCode = #{payTypeCode}
</if>
<if test="payTypeName!= null">
and payTypeName = #{payTypeName}
</if>
<if test="consumeFee!= null">
and consumeFee = #{consumeFee}
</if>
<if test="transNo!= null">
and transNo like CONCAT("%",#{transNo},"%")
</if>
<if test="memberCode!= null">
and memberCode like CONCAT("%",#{memberCode},"%")
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName like CONCAT("%",#{storeName},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
<if test="enterFee!= null">
and enterFee = #{enterFee}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aisleSwitch!= null">
and aisleSwitch = #{aisleSwitch}
</if>
<if test="leshuaMerchantRefundId!= null">
and leshuaMerchantRefundId = #{leshuaMerchantRefundId}
</if>
<if test="leshuaTransNo!= null">
and leshuaTransNo = #{leshuaTransNo}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="promoteruserId!= null">
and promoteruserId = #{promoteruserId}
</if>
<if test="userImg!= null">
and userImg = #{userImg}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="remark!= null">
and remark = #{remark}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="stTime!= null">
and transDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and transDt <![CDATA[<=]]> #{endTime}
</if>
and (payTypeCode='leshuaPay0' or payTypeCode= 'aliPay' or payTypeCode='sxfPay0')
</where>
</select>
<!-- 今日微信收款笔数 -->
<select id="toDayTransWxCount"
parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_merchant_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNumber!= null">
and orderNumber like CONCAT("%",#{orderNumber},"%")
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="payTypeCode!= null">
and payTypeCode = #{payTypeCode}
</if>
<if test="payTypeName!= null">
and payTypeName = #{payTypeName}
</if>
<if test="consumeFee!= null">
and consumeFee = #{consumeFee}
</if>
<if test="transNo!= null">
and transNo like CONCAT("%",#{transNo},"%")
</if>
<if test="memberCode!= null">
and memberCode like CONCAT("%",#{memberCode},"%")
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName like CONCAT("%",#{storeName},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
<if test="enterFee!= null">
and enterFee = #{enterFee}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aisleSwitch!= null">
and aisleSwitch = #{aisleSwitch}
</if>
<if test="leshuaMerchantRefundId!= null">
and leshuaMerchantRefundId = #{leshuaMerchantRefundId}
</if>
<if test="leshuaTransNo!= null">
and leshuaTransNo = #{leshuaTransNo}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="promoteruserId!= null">
and promoteruserId = #{promoteruserId}
</if>
<if test="userImg!= null">
and userImg = #{userImg}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="remark!= null">
and remark = #{remark}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="stTime!= null">
and transDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and transDt <![CDATA[<=]]> #{endTime}
</if>
and (payTypeCode='leshuaPay1' or payTypeCode= 'wechatPay' or payTypeCode='sxfPay1')
</where>
</select>
<select id="toDayTransYsfCount"
parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(1) from tb_pluss_merchant_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNumber!= null">
and orderNumber like CONCAT("%",#{orderNumber},"%")
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="payTypeCode!= null">
and payTypeCode = #{payTypeCode}
</if>
<if test="payTypeName!= null">
and payTypeName = #{payTypeName}
</if>
<if test="consumeFee!= null">
and consumeFee = #{consumeFee}
</if>
<if test="transNo!= null">
and transNo like CONCAT("%",#{transNo},"%")
</if>
<if test="memberCode!= null">
and memberCode like CONCAT("%",#{memberCode},"%")
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName like CONCAT("%",#{storeName},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
<if test="enterFee!= null">
and enterFee = #{enterFee}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aisleSwitch!= null">
and aisleSwitch = #{aisleSwitch}
</if>
<if test="leshuaMerchantRefundId!= null">
and leshuaMerchantRefundId = #{leshuaMerchantRefundId}
</if>
<if test="leshuaTransNo!= null">
and leshuaTransNo = #{leshuaTransNo}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="promoteruserId!= null">
and promoteruserId = #{promoteruserId}
</if>
<if test="userImg!= null">
and userImg = #{userImg}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="remark!= null">
and remark = #{remark}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="stTime!= null">
and transDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and transDt <![CDATA[<=]]> #{endTime}
</if>
and payTypeCode='sxfPay2'
</where>
</select>
<select id="queryMerchantOrderPage"
parameterType="java.util.Map"
resultType="cn.pluss.platform.entity.MerchantOrder">
SELECT * from tb_pluss_merchant_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="orderNumber!= null">
and orderNumber like CONCAT("%",#{orderNumber},"%")
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName like CONCAT("%",#{merchantName},"%")
</if>
<if test="payTypeCode!= null">
and payTypeCode = #{payTypeCode}
</if>
<if test="payTypeName!= null">
and payTypeName = #{payTypeName}
</if>
<if test="consumeFee!= null">
and consumeFee = #{consumeFee}
</if>
<if test="transNo!= null">
and transNo like CONCAT("%",#{transNo},"%")
</if>
<if test="memberCode!= null">
and memberCode like CONCAT("%",#{memberCode},"%")
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName like CONCAT("%",#{storeName},"%")
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="shareMoney!= null">
and shareMoney = #{shareMoney}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
<if test="enterFee!= null">
and enterFee = #{enterFee}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aisleSwitch!= null">
and aisleSwitch = #{aisleSwitch}
</if>
<if test="leshuaMerchantRefundId!= null">
and leshuaMerchantRefundId = #{leshuaMerchantRefundId}
</if>
<if test="leshuaTransNo!= null">
and leshuaTransNo = #{leshuaTransNo}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="promoteruserId!= null">
and promoteruserId = #{promoteruserId}
</if>
<if test="userImg!= null">
and userImg = #{userImg}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="startTime != null">
and createDt <![CDATA[>=]]> #{startTime}
</if>
<if test="remark!= null">
and remark = #{remark}
</if>
<if test="endTime != null">
and createDt <![CDATA[<=]]> #{endTime}
</if>
<if test="transDt!= null">
and transDt = #{transDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="stTime!= null">
and transDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and transDt <![CDATA[<=]]> #{endTime}
</if>
</where>
<!-- order by id desc limit #{pageSize} offset #{offset} -->
</select>
<select id="queryFansTodayCount" parameterType="cn.pluss.platform.entity.Fans" resultType="java.lang.Double">
select sum(shareMoney) from tb_pluss_fans
<where>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="stTime!= null">
and createDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and createDt <![CDATA[<=]]> #{endTime}
</if>
</where>
</select>
<select id="queryMerchantMenberPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_merchant_menber
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="nickName== null">
and nickName !='null'
</if>
<if test="merchantCode!= null">
and merchantCode IN (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode = (SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="status!= null">
and status = #{status}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="stTime!= null">
and createDt <![CDATA[>=]]> #{stTime}
</if>
<if test="endTime!= null">
and createDt <![CDATA[<=]]> #{endTime}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="keyWord!=null">
and (
<if test="nickName!= null">
nickName like CONCAT("%",#{nickName},"%")
</if>
<if test="phone!= null">
or phone like CONCAT("%",#{phone},"%")
</if>
)
</if>
<if test="openid!= null">
and openid = #{openid}
</if>
<if test="alipayUserId!= null">
and alipayUserId = #{alipayUserId}
</if>
<if test="comsumeMoney!= null">
and comsumeMoney = #{comsumeMoney}
</if>
<if test="profitMoney!= null">
and profitMoney = #{profitMoney}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="totalRechargeFee!= null">
and totalRechargeFee = #{totalRechargeFee}
</if>
<if test="usableRechargeFee!= null">
and usableRechargeFee = #{usableRechargeFee}
</if>
<if test="totalGiveFee!= null">
and totalGiveFee = #{totalGiveFee}
</if>
<if test="usableGiveFee!= null">
and usableGiveFee = #{usableGiveFee}
</if>
<if test="cardNo!= null">
and cardNo = #{cardNo}
</if>
<if test="birthdayDt!= null">
and birthdayDt = #{birthdayDt}
</if>
<if test="memberName!= null">
and memberName Like CONCAT('%',#{memberName},'%')
</if>
<if test="provinces!= null">
and provinces = #{provinces}
</if>
<if test="sex!= null">
and sex = #{sex}
</if>
<if test="bindingUrl!= null">
and bindingUrl = #{bindingUrl}
</if>
<if test="appOpenId!= null">
and appOpenId = #{appOpenId}
</if>
</where>
</select>
<select id="queryMerchantProfitSumPrice" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(price) from tb_pluss_merchant_profit profit
<where>
<if test="id!= null">
and profit.id = #{id}
</if>
<if test="agentStaffId != null">
and profit.agentStaffId = #{agentStaffId}
</if>
<if test="userId!= null">
and profit.userId = #{userId}
</if>
<if test="type!= null">
and profit.type = #{type}
</if>
<if test="price!= null">
and profit.price = #{price}
</if>
<if test="orderNumber!= null">
and profit.orderNumber = #{orderNumber}
</if>
<if test="merchantName!= null">
and profit.merchantName = #{merchantName}
</if>
<if test="agentStaffId != null">
and profit.agentStaffId = #{agentStaffId}
</if>
<if test="consumeFee!= null">
and profit.consumeFee = #{consumeFee}
</if>
<if test="createDt!= null">
and profit.createDt = #{createDt}
</if>
<if test="stTime!= null">
and profit.createDt <![CDATA[>=]]> #{stTime}
</if>
<if test="enTime!= null">
and profit.createDt <![CDATA[<=]]> #{enTime}
</if>
<if test="orderDt!= null">
and profit.orderDt = #{orderDt}
</if>
<if test="status!= null">
and profit.status = #{status}
</if>
<if test="startTime!= null">
and profit.createDt <![CDATA[>]]> #{startTime}
</if>
<if test="endTime!= null">
and profit.createDt <![CDATA[<]]> #{endTime}
</if>
<if test="payTypeCode!= null">
and profit.payTypeCode = #{payTypeCode}
</if>
<if test="payTypeName!= null">
and profit.payTypeName = #{payTypeName}
</if>
<if test="merchantLogo!= null">
and profit.merchantLogo = #{merchantLogo}
</if>
<if test="level!= null">
and profit.level = #{level}
</if>
<if test="merchantParentId!= null">
and profit.merchantParentId = #{merchantParentId}
</if>
<if test="merchantParentName!= null">
and profit.merchantParentName = #{merchantParentName}
</if>
<if test="merchantParentLogo!= null">
and profit.merchantParentLogo = #{merchantParentLogo}
</if>
<if test="startTime!= null">
and profit.createDt <![CDATA[>]]> #{startTime}
</if>
<if test="endTime!= null">
and profit.createDt <![CDATA[<]]> #{endTime}
</if>
<if test="merchantCodeList!= null">
and profit.merchantCode in
<foreach collection="merchantCodeList" item="item" open="(" close=")" index="index" separator=",">
#{item}
</foreach>
</if>
<if test="phone!= null">
and profit.phone = #{phone}
</if>
<if test="userName!= null">
and profit.userName = #{userName}
</if>
<if test="merchantParentLevel!= null">
and profit.merchantParentLevel = #{merchantParentLevel}
</if>
<if test="merchantParentPhone!= null">
and profit.merchantParentPhone = #{merchantParentPhone}
</if>
<if test="retype!= null">
and profit.type !=4
</if>
</where>
</select>
<select id="queryUserAppPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_user_app
<where>
userType = 'promoter'
<if test="parentId!= null">
and parentId = #{parentId}
</if>
</where>
</select>
<select id="queryMerchantCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(*)
FROM tb_pluss_merchant_base_info
WHERE userId IN (SELECT userId
FROM tb_pluss_user_app
<where>
userType = 'promoter'
<if test="parentId!= null">
and parentId = #{parentId}
</if>
</where>)
</select>
<sql id="commom_where_if">
<if test="merchantCode!= null">
and merchantCode in (SELECT merchantCode
FROM tb_pluss_merchant_base_info
WHERE bindingCode =(SELECT bindingCode
FROM tb_pluss_merchant_base_info
where merchantCode = #{merchantCode}))
</if>
<choose>
<when test="status != null and status != ''">
and status = #{status}
</when>
<otherwise>
and status = '1'
</otherwise>
</choose>
</sql>
</mapper>

View File

@@ -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="cn.pluss.platform.mapper.IdCardCacheMapper">
</mapper>

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.IdCardMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.IdCard">
<id column="id" property="id"/>
<result column="userId" property="userId"/>
<result column="certType" property="certType"/>
<result column="userType" property="userType"/>
<result column="certNo" property="certNo"/>
<result column="certName" property="certName"/>
<result column="certStartTime" property="certStartTime"/>
<result column="certEndTime" property="certEndTime"/>
<result column="certAddress" property="certAddress"/>
</resultMap>
<insert id="insertUniqueData">
INSERT INTO `tb_pluss_id_card`
(`userId`, `userType`, `certType`, `certNo`, `certName`, `certStartTime`,
`certEndTime`, `certAddress`, `imgPositive`, `imgNegative`)
SELECT #{data.userId}, #{data.userType}, #{data.certType}, #{data.certNo}, #{data.certName},
#{data.certStartTime}, #{data.certEndTime}, #{data.certAddress}, #{data.imgPositive}, #{data.imgNegative}
FROM `tb_pluss_id_card`
<if test="uniqueData != null">
WHERE NOT EXISTS
(
SELECT 1 FROM `tb_pluss_id_card`
<where>
<foreach collection="uniqueData.entrySet()" index="key" item="value">
and `${key}` = #{value}
</foreach>
</where>
)
</if>
LIMIT 1
</insert>
<select id="getAccountIdCard" resultType="cn.pluss.platform.entity.IdCard">
SELECT t1.`id`,
t1.`userId`,
t1.`userType`,
t1.`certType`,
t1.`certNo`,
t1.`certName`,
t1.`certStartTime`,
t1.`certEndTime`,
t1.`certAddress`,
t1.`createTime`,
t1.`updateTime`,
t1.`imgPositive`,
t1.`imgNegative`
FROM tb_pluss_id_card t1
LEFT JOIN tb_pluss_account t2 ON t1.id = t2.idcardId
WHERE t2.userId = #{userId}
<if test="_parameter.containsKey('channelType')">
<if test="channelType != null and channelType != ''">
AND t2.channelType = #{channelType}
</if>
</if>
</select>
<select id="selectAgentCount" resultType="integer">
SELECT count(1)
FROM tb_pluss_id_card t1
LEFT JOIN tb_pluss_user_app ua ON t1.userId = ua.userId
WHERE ua.userType IN ('agent', 'promoter')
AND ua.`status` = '3' AND ua.`bankStatus` = '3'
AND t1.`certNo` = #{certNo}
AND ua.`userId` != #{userId}
AND t1.`userType` = '01'
</select>
</mapper>

View 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="cn.pluss.platform.mapper.InviteRateMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.InviteRate">
<id column="id" property="id" />
<result column="number" property="number" />
<result column="rate" property="rate" />
<result column="startTime" property="startTime" />
<result column="endTime" property="endTime" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.IpLocationCacheMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.IpLocationCache">
<id column="id" property="id" />
<result column="ip" property="ip" />
<result column="isp" property="isp" />
<result column="country" property="country" />
<result column="province" property="province" />
<result column="city" property="city" />
<result column="county" property="county" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -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="cn.pluss.platform.mapper.JftBankCardMapper">
</mapper>

View File

@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.JftMercBaseInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.JftMercBaseInfo">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="merchantName" property="merchantName" />
<result column="merchantType" property="merchantType" />
<result column="mcc" property="mcc" />
<result column="mccName" property="mccName" />
<result column="alias" property="alias" />
<result column="addressNo" property="addressNo" />
<result column="province" property="province" />
<result column="city" property="city" />
<result column="district" property="district" />
<result column="address" property="address" />
<result column="principalPerson" property="principalPerson" />
<result column="bussAuthName" property="bussAuthName" />
<result column="bussAuthNum" property="bussAuthNum" />
<result column="bussAuthAddress" property="bussAuthAddress" />
<result column="bussAuthStartTime" property="bussAuthStartTime" />
<result column="bussAuthEndTime" property="bussAuthEndTime" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
<result column="buslicType" property="buslicType" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.JftMercPaymentChannelMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.JftMercPaymentChannel">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="merchantCode" property="merchantCode" />
<result column="merchantId" property="merchantId" />
<result column="status" property="status" />
<result column="thirdStatus" property="thirdStatus" />
<result column="remark" property="remark" />
<result column="createTime" property="createTime" />
<result column="passTime" property="passTime" />
<result column="updateTime" property="updateTime" />
<result column="applicationId" property="applicationId" />
<result column="extra" property="extra" />
<result column="mercName" property="mercName" />
</resultMap>
<select id="selectCountByCertNo" resultType="java.lang.Integer">
SELECT count(mpc.id) FROM tb_pluss_jft_merc_payment_channel mpc
LEFT JOIN tb_pluss_id_card ic ON mpc.userId = ic.userId AND ic.userType = '01'
WHERE ic.certNo = #{certNo}
</select>
<select id="selectByChangeFlowId" resultType="cn.pluss.platform.entity.JftMercPaymentChannel">
SELECT * FROM tb_pluss_jft_merc_payment_channel
WHERE channel = 4 AND `status` = 3 AND (extra ->> '$.changeFlowId') = #{changeFlowId}
</select>
<select id="selectBySysFlowId" resultType="cn.pluss.platform.entity.JftMercPaymentChannel">
SELECT * FROM tb_pluss_jft_merc_payment_channel
WHERE channel = 4 AND `status` = 3 AND (extra ->> '$.sysFlowId') = #{sysFlowId}
</select>
</mapper>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.JftMerchantRateMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.JftMerchantRate">
<id column="id" property="id" />
<result column="channel" property="channel" />
<result column="merchantId" property="merchantId" />
<result column="aliRate" property="aliRate" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.JftMerchantRateRecordMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.JftMerchantRateRecord">
<id column="id" property="id" />
<result column="channel" property="channel" />
<result column="merchantId" property="merchantId" />
<result column="aliRate" property="aliRate" />
<result column="status" property="status" />
<result column="remark" property="remark" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
<result column="operationDate" property="operationDate" />
</resultMap>
</mapper>

View File

@@ -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="cn.pluss.platform.mapper.JftPaymentInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.JftPaymentInfo">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="name" property="name" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.JftReceiptInfoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.JftReceiptInfo">
<id column="id" property="id" />
<result column="projectName" property="projectName" />
<result column="amount" property="amount" />
<result column="userId" property="userId" />
<result column="status" property="status" />
<result column="createTime" property="createTime" />
<result column="endTime" property="endTime" />
<result column="token" property="token" />
</resultMap>
<select id="pageInfo" parameterType="cn.pluss.platform.entity.JftReceiptInfo" resultType="cn.pluss.platform.vo.JftReceiptInfoVO">
SELECT a.*,IF(a.payNum > 0,"已收款","未收款") as payStatusDesc FROM (SELECT
jri.*,
SUM(IF(jro.`status` = '02',1,0)) AS payNum,
SUM(IF(jro.`status` = '02',jro.amount,0)) as totalAmount
FROM
tb_pluss_jft_receipt_info jri
LEFT JOIN tb_pluss_jft_receipt_order jro ON jri.id = jro.rid GROUP BY id ) a
<where>
a.status = 1
<if test="condition != null and condition.userId != null">
and a.userId = #{condition.userId}
</if>
<if test="condition != null and condition.startDate != null and condition.startDate != ''">
and DATE_FORMAT(a.createTime,'%Y-%m-%d') >= #{condition.startDate}
</if>
<if test="condition != null and condition.endDate != null and condition.endDate != ''">
and DATE_FORMAT(a.createTime,'%Y-%m-%d') <![CDATA[ <= ]]> #{condition.endDate}
</if>
</where>
ORDER BY a.id desc
</select>
</mapper>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.JftReceiptOrderMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.JftReceiptOrder">
<id column="id" property="id" />
<result column="rid" property="rid" />
<result column="amount" property="amount" />
<result column="status" property="status" />
<result column="payType" property="payType" />
<result column="orderNumber" property="orderNumber" />
<result column="userId" property="userId" />
<result column="merchantCode" property="merchantCode" />
<result column="merchantName" property="merchantName" />
<result column="payUserId" property="payUserId" />
<result column="name" property="name" />
<result column="phone" property="phone" />
<result column="goods" property="goods" />
<result column="address" property="address" />
<result column="transNo" property="transNo" />
<result column="channelTransNo" property="channelTransNo" />
<result column="transTime" property="transTime" />
<result column="rate" property="rate" />
<result column="createTime" property="createTime" />
<result column="channelFee" property="channelFee" />
<result column="mercFee" property="mercFee" />
<result column="cashFee" property="cashFee" />
<result column="payData" property="payData" />
<result column="remark" property="remark" />
<result column="createDate" property="createDate" />
</resultMap>
<select id="pageData" parameterType="cn.pluss.platform.dto.jft.JftReceiptOrderDTO" resultType="cn.pluss.platform.vo.JftReceiptOrderVO">
select
ri.projectName as projectName,
ri.amount as orderAmt,
IF(ro.`status` = '01','待付款','已付款') as payStatusDesc,
ro.orderNumber as orderNumber,
ro.createTime
from tb_pluss_jft_receipt_order ro left join tb_pluss_jft_receipt_info ri on ro.rid = ri.id
<where>
<if test="entity.userId != null">
and ro.userId = #{entity.userId}
</if>
<if test="entity.status != null and entity.status != ''">
and ro.status = #{entity.status}
</if>
<if test="entity.startDate != null and entity.startDate != ''">
and ro.createDate >= #{entity.startDate}
</if>
<if test="entity.endDate != null and entity.endDate != ''">
and ro.createDate <![CDATA[ <= ]]> #{entity.endDate}
</if>
</where>
order by ro.id desc
</select>
</mapper>

View File

@@ -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="cn.pluss.platform.mapper.JftReceiptPaymentMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.JftReceiptPayment">
<id column="id" property="id" />
<result column="rid" property="rid" />
<result column="pid" property="pid" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.JftSmallClassMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.JftSmallClass">
<id column="id" property="id" />
<result column="title" property="title" />
<result column="describe" property="describe" />
<result column="content" property="content" />
<result column="photo" property="photo" />
<result column="url" property="url" />
<result column="status" property="status" />
<result column="sort" property="sort" />
<result column="createTime" property="createTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.LeshuaMakeMoneyMapper">
<insert id="saveLeshuaMakeMoneyBatch">
insert into tb_pluss_leshua_make_money(billId,createTime,merchantId,planAmount,suspendAmount,realAmount,state,failReason,remark,recreateFlag,settType,settDate,tag,bankretTime,bankAccount,bankHolder) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.billId},#{item.createTime},#{item.merchantId},#{item.planAmount},#{item.suspendAmount},#{item.realAmount},#{item.state},#{item.failReason},#{item.remark},#{item.recreateFlag},#{item.settType},#{item.settDate},#{item.tag},#{item.bankretTime},#{item.bankAccount},#{item.bankHolder} )
</foreach>
</insert>
<select id="queryLeshuaMakeMoneyPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.LeshuaMakeMoney">
SELECT * from tb_pluss_leshua_make_money
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="billId!= null">
and billId = #{billId}
</if>
<if test="createTime!= null">
and createTime = #{createTime}
</if>
<if test="merchantId!= null">
and merchantId = #{merchantId}
</if>
<if test="planAmount!= null">
and planAmount = #{planAmount}
</if>
<if test="suspendAmount!= null">
and suspendAmount = #{suspendAmount}
</if>
<if test="realAmount!= null">
and realAmount = #{realAmount}
</if>
<if test="state!= null">
and state = #{state}
</if>
<if test="failReason!= null">
and failReason = #{failReason}
</if>
<if test="remark!= null">
and remark = #{remark}
</if>
<if test="recreateFlag!= null">
and recreateFlag = #{recreateFlag}
</if>
<if test="settType!= null">
and settType = #{settType}
</if>
<if test="settDate!= null">
and settDate = #{settDate}
</if>
<if test="tag!= null">
and tag = #{tag}
</if>
<if test="bankretTime!= null">
and bankretTime = #{bankretTime}
</if>
<if test="bankAccount!= null">
and bankAccount = #{bankAccount}
</if>
<if test="bankHolder!= null">
and bankHolder = #{bankHolder}
</if>
</where>
order by createTime desc limit #{pageSize} offset #{offset}
</select>
<select id="queryLeshuaMakeMoneyPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_leshua_make_money
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="billId!= null">
and billId = #{billId}
</if>
<if test="createTime!= null">
and createTime = #{createTime}
</if>
<if test="merchantId!= null">
and merchantId = #{merchantId}
</if>
<if test="planAmount!= null">
and planAmount = #{planAmount}
</if>
<if test="suspendAmount!= null">
and suspendAmount = #{suspendAmount}
</if>
<if test="realAmount!= null">
and realAmount = #{realAmount}
</if>
<if test="state!= null">
and state = #{state}
</if>
<if test="failReason!= null">
and failReason = #{failReason}
</if>
<if test="remark!= null">
and remark = #{remark}
</if>
<if test="recreateFlag!= null">
and recreateFlag = #{recreateFlag}
</if>
<if test="settType!= null">
and settType = #{settType}
</if>
<if test="settDate!= null">
and settDate = #{settDate}
</if>
<if test="tag!= null">
and tag = #{tag}
</if>
<if test="bankretTime!= null">
and bankretTime = #{bankretTime}
</if>
<if test="bankAccount!= null">
and bankAccount = #{bankAccount}
</if>
<if test="bankHolder!= null">
and bankHolder = #{bankHolder}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,171 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.LevelMapper">
<insert id="saveLevel" parameterType="cn.pluss.platform.entity.Level">
insert into tb_pluss_level(level,tradeMoney,authCount,levelName,rate,createDt,logo)VALUES(#{level},#{tradeMoney},#{authCount},#{levelName},#{rate},#{createDt},#{logo})
</insert>
<insert id="saveLevelBatch">
insert into tb_pluss_level(level,tradeMoney,authCount,levelName,rate,createDt,logo) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{level},#{tradeMoney},#{authCount},#{levelName},#{rate},#{createDt},#{logo} )
</foreach>
</insert>
<select id="queryLevel" parameterType="cn.pluss.platform.entity.Level" resultType="cn.pluss.platform.entity.Level">
SELECT * from tb_pluss_level
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="level!= null">
and level = #{level}
</if>
<if test="tradeMoney!= null">
and tradeMoney = #{tradeMoney}
</if>
<if test="authCount!= null">
and authCount = #{authCount}
</if>
<if test="levelName!= null">
and levelName = #{levelName}
</if>
<if test="rate!= null">
and rate = #{rate}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
</where>
</select>
<select id="queryLevelList" parameterType="cn.pluss.platform.entity.Level" resultType="cn.pluss.platform.entity.Level">
SELECT * from tb_pluss_level
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="level!= null">
and level = #{level}
</if>
<if test="tradeMoney!= null">
and tradeMoney = #{tradeMoney}
</if>
<if test="authCount!= null">
and authCount = #{authCount}
</if>
<if test="levelName!= null">
and levelName = #{levelName}
</if>
<if test="rate!= null">
and rate = #{rate}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
</where>
</select>
<update id="updateLevel" parameterType="cn.pluss.platform.entity.Level" >
update tb_pluss_level
<set>
<if test="level!= null">
level = #{level},
</if>
<if test="tradeMoney!= null">
tradeMoney = #{tradeMoney},
</if>
<if test="authCount!= null">
authCount = #{authCount},
</if>
<if test="levelName!= null">
levelName = #{levelName},
</if>
<if test="rate!= null">
rate = #{rate},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="logo!= null">
logo = #{logo}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteLevel" parameterType="cn.pluss.platform.entity.Level" >
DELETE FROM tb_pluss_level where id=#{id}
</delete>
<select id="queryLevelPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.Level">
SELECT * from tb_pluss_level
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="level!= null">
and level = #{level}
</if>
<if test="tradeMoney!= null">
and tradeMoney = #{tradeMoney}
</if>
<if test="authCount!= null">
and authCount = #{authCount}
</if>
<if test="levelName!= null">
and levelName = #{levelName}
</if>
<if test="rate!= null">
and rate = #{rate}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryLevelPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_level
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="level!= null">
and level = #{level}
</if>
<if test="tradeMoney!= null">
and tradeMoney = #{tradeMoney}
</if>
<if test="authCount!= null">
and authCount = #{authCount}
</if>
<if test="levelName!= null">
and levelName = #{levelName}
</if>
<if test="rate!= null">
and rate = #{rate}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="logo!= null">
and logo = #{logo}
</if>
</where>
</select>
</mapper>

View 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="cn.pluss.platform.mapper.LevelOperateRecordMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.LevelOperateRecord">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="operator" property="operator" />
<result column="levelCode" property="levelCode" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
<result column="createMonth" property="createMonth" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MakeMoneyMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MakeMoney">
<id column="id" property="id"/>
<result column="billId" property="billId"/>
<result column="createTime" property="createTime"/>
<result column="merchantId" property="merchantId"/>
<result column="planAmount" property="planAmount"/>
<result column="suspendAmount" property="suspendAmount"/>
<result column="realAmount" property="realAmount"/>
<result column="state" property="state"/>
<result column="failReason" property="failReason"/>
<result column="remark" property="remark"/>
<result column="recreateFlag" property="recreateFlag"/>
<result column="settType" property="settType"/>
<result column="settDate" property="settDate"/>
<result column="tag" property="tag"/>
<result column="bankretTime" property="bankretTime"/>
<result column="bankAccount" property="bankAccount"/>
<result column="bankHolder" property="bankHolder"/>
<result column="readStatus" property="readStatus"/>
</resultMap>
<select id="selectPage" resultMap="BaseResultMap">
SELECT mm.id,
mm.billId,
mm.createTime,
mm.merchantId,
mm.planAmount,
mm.suspendAmount,
mm.realAmount,
mm.state,
mm.failReason,
mm.remark,
mm.recreateFlag,
mm.settType,
mm.settDate,
mm.tag,
DATE_FORMAT(mm.bankretTime, '%Y-%m-%d %H:%i:%s') bankretTime,
mm.bankAccount,
mm.bankHolder,
IF(nrr.id IS NULL, 0, 1) readStatus
FROM tb_pluss_make_money mm
LEFT JOIN tb_pluss_notice_read_record nrr
ON mm.id = nrr.noticeId AND nrr.type = 1 ${ew.customSqlSegment}
</select>
<select id="getCountNowDateSettleAmt" parameterType="java.lang.String" resultType="java.math.BigDecimal">
SELECT IFNULL(sum(planAmount), 0)
FROM tb_pluss_make_money
where merchantId = #{merchantId}
and `state` in (0, 1)
AND DATE_FORMAT(createTime, '%Y-%m-%d') = DATE_FORMAT(NOW(), '%Y-%m-%d')
</select>
</mapper>

View 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="cn.pluss.platform.mapper.MccInfoSortMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MccInfoSort">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="mccCode" property="mccCode" />
<result column="mccName" property="mccName" />
<result column="group" property="group" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
<result column="sort" property="sort" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.MccInfoYsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MccInfoYs">
<result column="mccCode" property="mccCode" />
<result column="mccDesc" property="mccDesc" />
<result column="compan" property="compan" />
<result column="individual" property="individual" />
<result column="micro" property="micro" />
<result column="industryType" property="industryType" />
<result column="industryTypeDesc" property="industryTypeDesc" />
<result column="creator" property="creator" />
<result column="createTime" property="createTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MccReflectMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MccReflect">
<id column="id" property="id"/>
<result column="standard_mcc_code" property="standardMccCode"/>
<result column="mcc_code" property="mccCode"/>
<result column="channel_id" property="channelId"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<select id="selectPageMccReflectVO" resultType="cn.pluss.platform.vo.MccReflectVO">
SELECT mr.standard_mcc_code standardMccCode,
sxfmcc.F_mcc_txt sxfMccDesc,
GROUP_CONCAT(ryxmcc.mcc) ryxMcc,
GROUP_CONCAT(ryxmcc.bankDetailDesc) ryxMccDesc,
GROUP_CONCAT(ysmcc.mccCode) ysMcc,
GROUP_CONCAT(ysmcc.mccDesc) ysMccDesc
FROM tb_pluss_mcc_reflect mr
LEFT JOIN tb_pluss_sxf_mcc_info sxfmcc ON mr.standard_mcc_code = sxfmcc.F_mcc_code
LEFT JOIN (
SELECT DISTINCT mcc, bankDetailDesc
FROM tb_pluss_mcc_info_ryx
) ryxmcc ON ryxmcc.mcc = mr.mcc_code AND mr.channel_id = 3
LEFT JOIN tb_pluss_mcc_info_ys ysmcc ON ysmcc.mccCode = mr.mcc_code AND mr.channel_id = 4
<if test="ew.mccCode != null and ew.mccCode != ''">
<where>
mr.standard_mcc_code = #{ew.mccCode}
</where>
</if>
GROUP BY mr.standard_mcc_code
ORDER BY standard_mcc_code
</select>
</mapper>

View File

@@ -0,0 +1,691 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MemberOrderMapper">
<insert id="saveMemberOrder" useGeneratedKeys="true" keyProperty="id" keyColumn="id"
parameterType="cn.pluss.platform.entity.MemberOrder">
insert into tb_pluss_member_order(merchantCode, merchantName, storeId, storeName, memberCode, nickName,
createDt, orderType, orderFee, orderStatus, rechargeType, staffCode,
staffName, orderNumber, weChatTransNo, aliPayTransNo)
VALUES (#{merchantCode}, #{merchantName}, #{storeId}, #{storeName}, #{memberCode}, #{nickName}, #{createDt},
#{orderType}, #{orderFee}, #{orderStatus}, #{rechargeType}, #{staffCode}, #{staffName}, #{orderNumber},
#{weChatTransNo}, #{aliPayTransNo})
</insert>
<insert id="saveMemberOrderBatch">
insert into
tb_pluss_member_order(merchantCode,merchantName,storeId,storeName,memberCode,nickName,createDt,orderType,orderFee,orderStatus,rechargeType,staffCode,staffName)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{merchantCode},#{merchantName},#{storeId},#{storeName},#{memberCode},#{nickName},#{createDt},#{orderType},#{orderFee},#{orderStatus},#{rechargeType},#{staffCode},#{staffName}
)
</foreach>
</insert>
<select id="queryMemberOrder" parameterType="cn.pluss.platform.entity.MemberOrder"
resultType="cn.pluss.platform.entity.MemberOrder">
SELECT * from tb_pluss_member_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="orderFee!= null">
and orderFee = #{orderFee}
</if>
<if test="orderStatus!= null">
and orderStatus = #{orderStatus}
</if>
<if test="rechargeType!= null">
and rechargeType = #{rechargeType}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
<if test="channelNo!= null">
and channelNo = #{channelNo}
</if>
</where>
</select>
<select id="queryMemberOrderList" parameterType="cn.pluss.platform.entity.MemberOrder"
resultType="cn.pluss.platform.entity.MemberOrder">
SELECT * from tb_pluss_member_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="orderFee!= null">
and orderFee = #{orderFee}
</if>
<if test="orderStatus!= null">
and orderStatus = #{orderStatus}
</if>
<if test="rechargeType!= null">
and rechargeType = #{rechargeType}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="rechargeType!= null">
and staffName = #{staffName}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
<if test="channelNo!= null">
and channelNo = #{channelNo}
</if>
</where>
</select>
<update id="updateMemberOrder" parameterType="cn.pluss.platform.entity.MemberOrder">
update tb_pluss_member_order
<set>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="merchantName!= null">
merchantName = #{merchantName},
</if>
<if test="storeId!= null">
storeId = #{storeId},
</if>
<if test="storeName!= null">
storeName = #{storeName},
</if>
<if test="memberCode!= null">
memberCode = #{memberCode},
</if>
<if test="nickName!= null">
nickName = #{nickName},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="orderType!= null">
orderType = #{orderType},
</if>
<if test="orderFee!= null">
orderFee = #{orderFee},
</if>
<if test="orderStatus!= null">
orderStatus = #{orderStatus},
</if>
<if test="rechargeType!= null">
rechargeType = #{rechargeType},
</if>
<if test="staffCode!= null">
staffCode = #{staffCode},
</if>
<if test="staffName!= null">
staffName = #{staffName},
</if>
<if test="orderNumber!= null">
orderNumber = #{orderNumber},
</if>
<if test="weChatTransNo!= null">
weChatTransNo = #{weChatTransNo},
</if>
<if test="aliPayTransNo!= null">
aliPayTransNo = #{aliPayTransNo},
</if>
<if test="channelNo!= null">
channelNo = #{channelNo}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteMemberOrder" parameterType="cn.pluss.platform.entity.MemberOrder">
DELETE
FROM tb_pluss_member_order
where id = #{id}
</delete>
<select id="queryMemberOrderPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.MemberOrder">
SELECT * from tb_pluss_member_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="orderFee!= null">
and orderFee = #{orderFee}
</if>
<if test="orderStatus!= null">
and orderStatus = #{orderStatus}
</if>
<if test="rechargeType!= null">
and rechargeType = #{rechargeType}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="rechargeType!= null">
and staffName = #{staffName}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryMemberOrderPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_member_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="orderFee!= null">
and orderFee = #{orderFee}
</if>
<if test="orderStatus!= null">
and orderStatus = #{orderStatus}
</if>
<if test="rechargeType!= null">
and rechargeType = #{rechargeType}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="rechargeType!= null">
and staffName = #{staffName}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
</where>
</select>
<select id="queryMemberOrderTotalOrderFeeByTime" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT sum(orderFee) from tb_pluss_member_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="orderFee!= null">
and orderFee = #{orderFee}
</if>
<if test="orderStatus!= null">
and orderStatus = #{orderStatus}
</if>
<if test="rechargeType!= null">
and rechargeType = #{rechargeType}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="rechargeType!= null">
and staffName = #{staffName}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
</where>
and createDt &gt; #{startTime} and createDt &lt; #{endTime}
</select>
<select id="queryMemberOrderPageCountByTime" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_member_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="orderFee!= null">
and orderFee = #{orderFee}
</if>
<if test="orderStatus!= null">
and orderStatus = #{orderStatus}
</if>
<if test="rechargeType!= null and rechargeType!=''">
and rechargeType = #{rechargeType}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!='' ">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="staffCodeList!= null">
and (
<foreach collection="staffCodeList" item="item" index="index" separator="or">
staffCode = #{item}
</foreach>
)
</if>
<if test="storeIdList!= null">
and (
<foreach collection="storeIdList" item="item" index="index" separator="or">
storeId = #{item}
</foreach>
)
</if>
<if test="isPay!= null and isPay!=''">
and orderStatus <![CDATA[<> ]]> 0
</if>
<!-- and createDt &gt; #{startTime} and createDt &lt; #{endTime} -->
</where>
</select>
<select id="queryMemberOrderPageByTime" parameterType="java.util.Map"
resultType="cn.pluss.platform.entity.MemberOrder">
SELECT * from tb_pluss_member_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="orderFee!= null">
and orderFee = #{orderFee}
</if>
<if test="orderStatus!= null">
and orderStatus = #{orderStatus}
</if>
<if test="rechargeType!= null and rechargeType!=''">
and rechargeType = #{rechargeType}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!='' ">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="staffCodeList!= null">
and (
<foreach collection="staffCodeList" item="item" index="index" separator="or">
staffCode = #{item}
</foreach>
)
</if>
<if test="storeIdList!= null">
and (
<foreach collection="storeIdList" item="item" index="index" separator="or">
storeId = #{item}
</foreach>
)
</if>
</where>
<!-- and createDt &gt; #{startTime} and createDt &lt; #{endTime} -->
order by id desc limit #{pageSize} offset #{offset}
</select>
<!-- 统计商家的会员消费金额 充值金额 -->
<select id="sumMemberOrderMoney" parameterType="java.util.Map" resultType="java.lang.Double">
SELECT IFNULL(SUM(orderFee),0) FROM tb_pluss_member_order
WHERE merchantCode=#{merchantCode} AND orderStatus='1' AND orderType=#{orderType}
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="orderFee!= null">
and orderFee = #{orderFee}
</if>
<if test="orderStatus!= null">
and orderStatus = #{orderStatus}
</if>
<if test="rechargeType!= null">
and rechargeType = #{rechargeType}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!='' ">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="staffCodeList!= null">
and (
<foreach collection="staffCodeList" item="item" index="index" separator="or">
staffCode = #{item}
</foreach>
)
</if>
<if test="storeIdList!= null">
and (
<foreach collection="storeIdList" item="item" index="index" separator="or">
storeId = #{item}
</foreach>
)
</if>
</select>
<select id="queryMemberOrderCountByTimeGroupData" resultType="java.util.Map">
SELECT count(1) count, orderType from tb_pluss_member_order
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="memberCode!= null">
and memberCode = #{memberCode}
</if>
<if test="nickName!= null">
and nickName = #{nickName}
</if>
<if test="orderType!= null">
and orderType = #{orderType}
</if>
<if test="orderFee!= null">
and orderFee = #{orderFee}
</if>
<if test="orderStatus!= null">
and orderStatus = #{orderStatus}
</if>
<if test="rechargeType!= null and rechargeType!=''">
and rechargeType = #{rechargeType}
</if>
<if test="staffCode!= null">
and staffCode = #{staffCode}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
<if test="orderNumber!= null">
and orderNumber = #{orderNumber}
</if>
<if test="weChatTransNo!= null">
and weChatTransNo = #{weChatTransNo}
</if>
<if test="aliPayTransNo!= null">
and aliPayTransNo = #{aliPayTransNo}
</if>
<if test="startTime!= null and startTime!=''">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')>=DATE_FORMAT(#{startTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="endTime!= null and endTime!='' ">
<![CDATA[
and DATE_FORMAT(createDt, '%Y-%m-%d %H:%i:%S')<=DATE_FORMAT(#{endTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
<if test="staffCodeList!= null">
and (
<foreach collection="staffCodeList" item="item" index="index" separator="or">
staffCode = #{item}
</foreach>
)
</if>
<if test="storeIdList!= null">
and (
<foreach collection="storeIdList" item="item" index="index" separator="or">
storeId = #{item}
</foreach>
)
</if>
<if test="isPay!= null and isPay!=''">
and orderStatus <![CDATA[<> ]]> 0
</if>
<!-- and createDt &gt; #{startTime} and createDt &lt; #{endTime} -->
</where>
GROUP BY orderType
</select>
</mapper>

View File

@@ -0,0 +1,216 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MemberSettingMapper">
<insert id="saveMemberSetting" parameterType="cn.pluss.platform.entity.MemberSetting">
insert into tb_pluss_member_setting(merchantCode,merchantName,storeId,storeName,servicePhone,cardNum,cardContent,createDt,payDt,staffName)VALUES(#{merchantCode},#{merchantName},#{storeId},#{storeName},#{servicePhone},#{cardNum},#{cardContent},#{createDt},#{payDt},#{staffName})
</insert>
<insert id="saveMemberSettingBatch">
insert into tb_pluss_member_setting(merchantCode,merchantName,storeId,storeName,servicePhone,cardNum,cardContent,createDt,payDt,staffName) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{merchantCode},#{merchantName},#{storeId},#{storeName},#{servicePhone},#{cardNum},#{cardContent},#{createDt},#{payDt},#{staffName} )
</foreach>
</insert>
<select id="queryMemberSetting" parameterType="cn.pluss.platform.entity.MemberSetting" resultType="cn.pluss.platform.entity.MemberSetting">
SELECT * from tb_pluss_member_setting
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="servicePhone!= null">
and servicePhone = #{servicePhone}
</if>
<if test="cardNum!= null">
and cardNum = #{cardNum}
</if>
<if test="cardContent!= null">
and cardContent = #{cardContent}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="payDt!= null">
and payDt = #{payDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
</where>
</select>
<select id="queryMemberSettingList" parameterType="cn.pluss.platform.entity.MemberSetting" resultType="cn.pluss.platform.entity.MemberSetting">
SELECT * from tb_pluss_member_setting
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="servicePhone!= null">
and servicePhone = #{servicePhone}
</if>
<if test="cardNum!= null">
and cardNum = #{cardNum}
</if>
<if test="cardContent!= null">
and cardContent = #{cardContent}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="payDt!= null">
and payDt = #{payDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
</where>
</select>
<update id="updateMemberSetting" parameterType="cn.pluss.platform.entity.MemberSetting" >
update tb_pluss_member_setting
<set>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="merchantName!= null">
merchantName = #{merchantName},
</if>
<if test="storeId!= null">
storeId = #{storeId},
</if>
<if test="storeName!= null">
storeName = #{storeName},
</if>
<if test="servicePhone!= null">
servicePhone = #{servicePhone},
</if>
<if test="cardNum!= null">
cardNum = #{cardNum},
</if>
<if test="cardContent!= null">
cardContent = #{cardContent},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="payDt!= null">
payDt = #{payDt},
</if>
<if test="staffName!= null">
staffName = #{staffName}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteMemberSetting" parameterType="cn.pluss.platform.entity.MemberSetting" >
DELETE FROM tb_pluss_member_setting where id=#{id}
</delete>
<select id="queryMemberSettingPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.MemberSetting">
SELECT * from tb_pluss_member_setting
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="servicePhone!= null">
and servicePhone = #{servicePhone}
</if>
<if test="cardNum!= null">
and cardNum = #{cardNum}
</if>
<if test="cardContent!= null">
and cardContent = #{cardContent}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="payDt!= null">
and payDt = #{payDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryMemberSettingPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_member_setting
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="merchantName!= null">
and merchantName = #{merchantName}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="storeName!= null">
and storeName = #{storeName}
</if>
<if test="servicePhone!= null">
and servicePhone = #{servicePhone}
</if>
<if test="cardNum!= null">
and cardNum = #{cardNum}
</if>
<if test="cardContent!= null">
and cardContent = #{cardContent}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="payDt!= null">
and payDt = #{payDt}
</if>
<if test="staffName!= null">
and staffName = #{staffName}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MemberTransStatisticsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MemberTransStatistics">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="date" property="date" />
<result column="rechargeAmount" property="rechargeAmount" />
<result column="consumeAmount" property="consumeAmount" />
<result column="giveAmount" property="giveAmount" />
<result column="remark" property="remark" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
<insert id="insertDuringBill">
INSERT IGNORE INTO tb_pluss_member_trans_statistics(userId, startDate, endDate, type, rechargeAmount, consumeAmount, giveAmount)
SELECT ua.userId, #{startDate}, #{endDate}, "1", IFNULL(t.rechargeAmount, 0), IFNULL(t.consumeAmount, 0), IFNULL(t.giveAmount, 0)
FROM
tb_pluss_user_app ua LEFT JOIN
(
SELECT
merchantCode,
SUM(IF(type = 1, transMoney, 0)) rechargeAmount,
SUM(IF(type = 2, transMoney, 0)) consumeAmount,
SUM(giveMoney) giveAmount
FROM (
SELECT merchantCode, rechargeMoney transMoney, giveMoney, 1 type, createDt
FROM tb_pluss_merchant_menber_recharge
WHERE createDt BETWEEN CONCAT(#{startDate}, " 00:00:00")
AND CONCAT(#{endDate}, " 23:59:59")
UNION
SELECT merchantCode, comsumeMoney transMoney, giveMoney, 2 type, createDt
FROM tb_pluss_merchant_menber_comsume
WHERE createDt BETWEEN CONCAT(#{startDate}, " 00:00:00")
AND CONCAT(#{endDate}, " 23:59:59")
) t GROUP BY merchantCode
) t ON t.merchantCode = ua.merchantCode
LEFT JOIN tb_pluss_merchant_channel_status mcs ON ua.merchantCode = mcs.merchantCode
WHERE ua.userType = 'promoter' AND mcs.`status` = '3' AND mcs.updateTime &lt;= CONCAT(#{endDate}, " 23:59:59" )
</insert>
<select id="selectOneDuringBill" resultType="cn.pluss.platform.entity.MemberTransStatistics">
SELECT ua.userId, #{startDate} startDate, #{endDate} endDate, "1" type,
IFNULL(t.rechargeAmount, 0) rechargeAmount, IFNULL(t.consumeAmount, 0) consumeAmount, IFNULL(t.giveAmount, 0) giveAmount
FROM
tb_pluss_user_app ua LEFT JOIN
(
SELECT
merchantCode,
SUM(IF(type = 1, transMoney, 0)) rechargeAmount,
SUM(IF(type = 2, transMoney, 0)) consumeAmount,
SUM(giveMoney) giveAmount
FROM (
SELECT merchantCode, rechargeMoney transMoney, giveMoney, 1 type, createDt
FROM tb_pluss_merchant_menber_recharge
WHERE createDt BETWEEN CONCAT(#{startDate}, " 00:00:00")
AND CONCAT(#{endDate}, " 23:59:59")
UNION
SELECT merchantCode, comsumeMoney transMoney, giveMoney, 2 type, createDt
FROM tb_pluss_merchant_menber_comsume
WHERE createDt BETWEEN CONCAT(#{startDate}, " 00:00:00")
AND CONCAT(#{endDate}, " 23:59:59")
) t GROUP BY merchantCode
) t ON t.merchantCode = ua.merchantCode
LEFT JOIN tb_pluss_merchant_channel_status mcs ON ua.merchantCode = mcs.merchantCode
WHERE mcs.`status` = '3' AND mcs.updateTime &lt;= CONCAT(#{endDate}, " 23:59:59" )
AND ua.userId = #{userId}
ORDER BY mcs.valid DESC, mcs.createTime LIMIT 1
</select>
</mapper>

View File

@@ -0,0 +1,365 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MenuInfoMapper">
<insert id="saveMenuInfo" parameterType="cn.pluss.platform.entity.MenuInfo" keyProperty="id"
useGeneratedKeys="true">
insert into tb_pluss_menu_info(name, menuType, link, parentId, menuOrder, iconUrl, visible, creator, version,
description, seq)
VALUES (#{name}, #{menuType}, #{link}, #{parentId}, #{menuOrder}, #{iconUrl}, #{visible}, #{creator},
#{version}, #{description}, #{seq})
</insert>
<insert id="saveMenuInfoBatch">
insert into
tb_pluss_menu_info(name,menuType,link,parentId,menuOrder,iconUrl,visible,creator,version,description,seq) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{name},#{menuType},#{link},#{parentId},#{menuOrder},#{iconUrl},#{visible},#{creator},#{version},#{description},#{seq}
)
</foreach>
</insert>
<select id="queryMenuInfo" parameterType="cn.pluss.platform.entity.MenuInfo"
resultType="cn.pluss.platform.entity.MenuInfo">
SELECT * from tb_pluss_menu_info
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="menuType!= null">
and menuType = #{menuType}
</if>
<if test="link!= null">
and link = #{link}
</if>
<if test="parentId!= null">
and parentId = #{parentId}
</if>
<if test="menuOrder!= null">
and menuOrder = #{menuOrder}
</if>
<if test="iconUrl!= null">
and iconUrl = #{iconUrl}
</if>
<if test="visible!= null">
and visible = #{visible}
</if>
<if test="creator!= null">
and creator = #{creator}
</if>
<if test="version!= null">
and version = #{version}
</if>
<if test="description!= null">
and description = #{description}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
</where>
</select>
<select id="queryMenuInfoList" parameterType="cn.pluss.platform.entity.MenuInfo"
resultType="cn.pluss.platform.entity.MenuInfo">
SELECT * from tb_pluss_menu_info
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="menuType!= null">
and menuType = #{menuType}
</if>
<if test="link!= null">
and link = #{link}
</if>
<if test="parentId!= null">
and parentId = #{parentId}
</if>
<if test="menuOrder!= null">
and menuOrder = #{menuOrder}
</if>
<if test="iconUrl!= null">
and iconUrl = #{iconUrl}
</if>
<if test="visible!= null">
and visible = #{visible}
</if>
<if test="creator!= null">
and creator = #{creator}
</if>
<if test="version!= null">
and version = #{version}
</if>
<if test="description!= null">
and description = #{description}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
</where>
ORDER BY menuOrder
</select>
<select id="queryMenuInfoByRoleId" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.MenuInfo">
select *
from tb_pluss_menu_info
where id in (select menuId from tb_pluss_role_menu_info where roleId = #{roleId})
and visible = 1
ORDER BY id
</select>
<select id="queryMenuInfoListOrderById" parameterType="cn.pluss.platform.entity.MenuInfo"
resultType="cn.pluss.platform.entity.MenuInfo">
SELECT * from tb_pluss_menu_info
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="menuType!= null">
and menuType = #{menuType}
</if>
<if test="link!= null">
and link = #{link}
</if>
<if test="parentId!= null">
and parentId = #{parentId}
</if>
<if test="menuOrder!= null">
and menuOrder = #{menuOrder}
</if>
<if test="iconUrl!= null">
and iconUrl = #{iconUrl}
</if>
<if test="visible!= null">
and visible = #{visible}
</if>
<if test="creator!= null">
and creator = #{creator}
</if>
<if test="version!= null">
and version = #{version}
</if>
<if test="description!= null">
and description = #{description}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
</where>
order by id desc
</select>
<update id="updateMenuInfo" parameterType="cn.pluss.platform.entity.MenuInfo">
update tb_pluss_menu_info
<set>
<if test="name!= null">
name = #{name},
</if>
<if test="menuType!= null">
menuType = #{menuType},
</if>
<if test="link!= null">
link = #{link},
</if>
<if test="parentId!= null">
parentId = #{parentId},
</if>
<if test="menuOrder!= null">
menuOrder = #{menuOrder},
</if>
<if test="iconUrl!= null">
iconUrl = #{iconUrl},
</if>
<if test="visible!= null">
visible = #{visible},
</if>
<if test="creator!= null">
creator = #{creator},
</if>
<if test="version!= null">
version = #{version},
</if>
<if test="description!= null">
description = #{description},
</if>
<if test="seq!= null">
seq = #{seq}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteMenuInfo" parameterType="cn.pluss.platform.entity.MenuInfo">
DELETE
FROM tb_pluss_menu_info
where id = #{id}
</delete>
<select id="queryMenuInfoPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.MenuInfo">
SELECT * from tb_pluss_menu_info
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="menuType!= null">
and menuType = #{menuType}
</if>
<if test="link!= null">
and link = #{link}
</if>
<if test="parentId!= null">
and parentId = #{parentId}
</if>
<if test="menuOrder!= null">
and menuOrder = #{menuOrder}
</if>
<if test="iconUrl!= null">
and iconUrl = #{iconUrl}
</if>
<if test="visible!= null">
and visible = #{visible}
</if>
<if test="creator!= null">
and creator = #{creator}
</if>
<if test="version!= null">
and version = #{version}
</if>
<if test="description!= null">
and description = #{description}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryMenuInfoPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_menu_info
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="name!= null">
and name = #{name}
</if>
<if test="menuType!= null">
and menuType = #{menuType}
</if>
<if test="link!= null">
and link = #{link}
</if>
<if test="parentId!= null">
and parentId = #{parentId}
</if>
<if test="menuOrder!= null">
and menuOrder = #{menuOrder}
</if>
<if test="iconUrl!= null">
and iconUrl = #{iconUrl}
</if>
<if test="visible!= null">
and visible = #{visible}
</if>
<if test="creator!= null">
and creator = #{creator}
</if>
<if test="version!= null">
and version = #{version}
</if>
<if test="description!= null">
and description = #{description}
</if>
<if test="seq!= null">
and seq = #{seq}
</if>
</where>
</select>
<select id="getPermissionNames" parameterType="java.lang.String" resultType="cn.pluss.platform.entity.MenuInfo">
SELECT menu.* FROM tb_pluss_menu_info menu
LEFT JOIN tb_pluss_role_menu_info rmi ON menu.id = rmi.menuId
LEFT JOIN tb_pluss_role_user_info rui ON rui.roleId = rmi.roleId
LEFT JOIN tb_pluss_user_info ui ON ui.id = rui.userId
WHERE ui.loginName = 'admin' AND menu.visible = '1'
ORDER BY menu.id
</select>
<select id="queryPermitMenuInfoById" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.MenuInfo">
select * from tb_pluss_menu_info mi
where mi.id in
(select distinct rmi.menuId from tb_pluss_role_user_info rui,tb_pluss_role_menu_info rmi where
rui.roleId=rmi.roleId and rui.userId=#{id})
and visible=1
<if test="parentId !=null">
and parentId=#{parentId}
</if>
<if test="parentId ==null">
and parentId is null
</if>
ORDER BY id
</select>
<select id="queryRoleMenuInfoList" resultType="cn.pluss.platform.entity.MenuInfo">
SELECT mi.*, IF(t.id IS NULL, 0, 1) checked FROM tb_pluss_menu_info mi LEFT JOIN
(SELECT rmi.id, rmi.menuId FROM tb_pluss_menu_info mi LEFT JOIN
tb_pluss_role_menu_info rmi ON mi.id = rmi.menuId
WHERE rmi.roleId = #{roleId}) t ON mi.id = t.menuId
<where>
<if test="entity.id!= null">
and mi.id = #{id}
</if>
<if test="entity.name!= null">
and mi.`name` = #{name}
</if>
<if test="entity.menuType!= null">
and mi.menuType = #{menuType}
</if>
<if test="entity.link!= null">
and mi.link = #{link}
</if>
<if test="entity.parentId!= null">
and mi.parentId = #{parentId}
</if>
<if test="entity.menuOrder!= null">
and mi.menuOrder = #{menuOrder}
</if>
<if test="entity.iconUrl!= null">
and mi.iconUrl = #{iconUrl}
</if>
<if test="entity.visible!= null">
and mi.visible = #{visible}
</if>
<if test="entity.creator!= null">
and mi.creator = #{creator}
</if>
<if test="entity.version!= null">
and mi.version = #{version}
</if>
<if test="entity.description!= null">
and mi.description = #{description}
</if>
<if test="entity.seq!= null">
and mi.seq = #{seq}
</if>
</where>
</select>
</mapper>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MercDeviceRefundImageMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MercDeviceRefundImage">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="picUrl" property="picUrl" />
<result column="detailId" property="detailId" />
<result column="orderNo" property="orderNo" />
<result column="createTime" property="createTime" />
</resultMap>
</mapper>

View File

@@ -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="cn.pluss.platform.mapper.MercMemberSetMapper">
</mapper>

View File

@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MercOrderDetailMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MercOrderDetail">
<id column="id" property="id" />
<result column="orderNo" property="orderNo" />
<result column="code" property="code" />
<result column="name" property="name" />
<result column="deviceLogo" property="deviceLogo" />
<result column="type" property="type" />
<result column="num" property="num" />
<result column="userId" property="userId" />
</resultMap>
<select id="pageInfo" parameterType="cn.pluss.platform.entity.MercOrderDetail" resultType="cn.pluss.platform.entity.MercOrderDetail">
SELECT mo.*,
ua.roleCode,
ds.specName as specName,
moe.status as expressStatus,
mon.receiver as 'order.receiver',
mon.phone as 'order.phone',
mon.address as 'order.address',
mon.payType as 'order.payType',
mon.orderAmt as 'order.orderAmt',
mon.areaName as 'order.areaName',
mbi.alias as 'merchant.alias'
FROM
tb_pluss_merc_order_detail mo
left join tb_pluss_device_spec ds on mo.code = ds.code and mo.type = ds.spec
left join tb_pluss_merc_order_express moe on mo.expressNo = moe.expressNo
left join tb_pluss_merc_order_new mon on mo.orderNo = mon.orderNo
left join tb_pluss_user_app ua on mo.userId = ua.userId
left join tb_pluss_merchant_base_info mbi on mo.userId = mbi.userId
<where>
<if test="condition.orderNo != null and condition.orderNo != ''">
and mo.orderNo = #{condition.orderNo}
</if>
<if test="condition.name != null and condition.name != ''">
and mo.name = #{condition.name}
</if>
<if test="condition.merchant != null and condition.merchant.alias != null and condition.merchant.alias != ''">
and mbi.alias = #{condition.merchant.alias}
</if>
<if test="condition.userId != null">
and mo.userId = #{condition.userId}
</if>
<if test="condition.roleCode != null and condition.roleCode != ''">
and ua.roleCode = #{condition.roleCode}
</if>
<if test="condition.logistNo != null and condition.logistNo != ''">
and mo.logistNo = #{condition.logistNo}
</if>
<if test="condition.expressNo != null and condition.expressNo != ''">
and mo.expressNo = #{condition.expressNo}
</if>
<if test="condition.status != null and condition.status != ''">
and mo.status = #{condition.status}
</if>
<if test="condition.order != null and condition.order.payType != null">
and mon.payType = #{condition.order.payType}
</if>
<if test="condition.order != null and condition.order.receiver != null and condition.order.receiver != ''">
and mon.receiver = #{condition.order.receiver}
</if>
<if test="condition.order != null and condition.order.phone != null and condition.order.phone != ''">
and mon.phone = #{condition.order.phone}
</if>
<if test="condition.expressStatus != null and condition.expressStatus != ''">
<choose>
<when test="condition.expressStatus == '00'">
and moe.status is null
</when>
<otherwise>
and moe.status != #{condition.expressStatus}
</otherwise>
</choose>
</if>
</where>
order by mo.createTime desc
</select>
</mapper>

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MercOrderExpressDetailMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MercOrderExpressDetail">
<id column="id" property="id" />
<result column="orderNo" property="orderNo" />
<result column="logisticProvider" property="logisticProvider" />
<result column="expressNo" property="expressNo" />
<result column="logistNo" property="logistNo" />
<result column="city" property="city" />
<result column="district" property="district" />
<result column="acceptTime" property="acceptTime" />
<result column="remark" property="remark" />
<result column="empCode" property="empCode" />
<result column="empName" property="empName" />
<result column="info" property="info" />
<result column="weight" property="weight" />
<result column="contactInfo" property="contactInfo" />
<result column="questionCause" property="questionCause" />
<result column="deliveryName" property="deliveryName" />
<result column="orgName" property="orgName" />
<result column="orgCode" property="orgCode" />
<result column="orgPhone" property="orgPhone" />
<result column="createTime" property="createTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MercOrderExpressMapper">
</mapper>

View File

@@ -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="cn.pluss.platform.mapper.MercOrderNewMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MercOrderNew">
<id column="id" property="id" />
<result column="orderNo" property="orderNo" />
<result column="userId" property="userId" />
<result column="transNo" property="transNo" />
<result column="thirdTransNo" property="thirdTransNo" />
<result column="receiver" property="receiver" />
<result column="phone" property="phone" />
<result column="province" property="province" />
<result column="city" property="city" />
<result column="district" property="district" />
<result column="address" property="address" />
<result column="remark" property="remark" />
<result column="status" property="status" />
<result column="createTime" property="createTime" />
<result column="creator" property="creator" />
<result column="updateTime" property="updateTime" />
<result column="updater" property="updater" />
<result column="payType" property="payType" />
<result column="transDt" property="transDt" />
<result column="orderAmt" property="orderAmt" />
<result column="discountAmt" property="discountAmt" />
<result column="actualAmt" property="actualAmt" />
<result column="postage" property="postage" />
<result column="areaName" property="areaName" />
<result column="merchantCode" property="merchantCode" />
<result column="merchantName" property="merchantName" />
<result column="channel" property="channel" />
<result column="payData" property="payData" />
<result column="payUserId" property="payUserId" />
</resultMap>
<select id="pageInfo" resultType="cn.pluss.platform.vo.MercOrderNewVO">
select
mon.*
from tb_pluss_merc_order_new mon
<where>
mon.status != '00'
<if test="condition.orderNo != null and condition.orderNo != ''">
and mon.orderNo = #{condition.orderNo}
</if>
<if test="condition.userId != null">
and mon.userId = #{condition.userId}
</if>
<!-- <if test="condition.pStatus != null and condition.pStatus != '' and condition.pStatus != '-1'">-->
<!-- <if test="condition.pStatus == '1'">-->
<!-- and md.status = '06'-->
<!-- </if>-->
<!-- <if test="condition.pStatus == '2'">-->
<!-- and md.status = '05'-->
<!-- </if>-->
<!-- <if test="condition.pStatus == '3'">-->
<!-- and md.status in ('02','03','04')-->
<!-- </if>-->
<!-- </if>-->
<if test="condition.transNo != null and condition.transNo != ''">
and mon.transNo = #{condition.transNo}
</if>
</where>
</select>
</mapper>

View 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="cn.pluss.platform.mapper.MercOrderTokenMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MercOrderToken">
<id column="id" property="id" />
<result column="token" property="token" />
<result column="merchantName" property="merchantName" />
<result column="merchantCode" property="merchantCode" />
<result column="userId" property="userId" />
<result column="orderAmt" property="orderAmt" />
<result column="orderNumber" property="orderNumber" />
<result column="type" property="type" />
<result column="snNo" property="snNo" />
<result column="createTime" property="createTime" />
<result column="expireTime" property="expireTime" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.MercReceiveAddressMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MercReceiveAddress">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="name" property="name" />
<result column="phone" property="phone" />
<result column="province" property="province" />
<result column="city" property="city" />
<result column="district" property="district" />
<result column="address" property="address" />
<result column="defFlag" property="defFlag" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.MercShopTrolleyMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MercShopTrolley">
<id column="id" property="id" />
<result column="code" property="code" />
<result column="name" property="name" />
<result column="deviceLogo" property="deviceLogo" />
<result column="type" property="type" />
<result column="num" property="num" />
<result column="userId" property="userId" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
<result column="status" property="status" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MerchantAddressMapper">
<insert id="saveMerchantAddress" parameterType="cn.pluss.platform.entity.MerchantAddress">
insert into tb_pluss_merchant_address(userId,merchantCode,provinces,address,linkPhone,linkName,isDefault,createDt)VALUES(#{userId},#{merchantCode},#{provinces},#{address},#{linkPhone},#{linkName},#{isDefault},now())
</insert>
<insert id="saveMerchantAddressBatch">
insert into tb_pluss_merchant_address(userId,merchantCode,provinces,address,linkPhone,linkName,isDefault,createDt) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{userId},#{merchantCode},#{provinces},#{address},#{linkPhone},#{linkName},#{isDefault},#{createDt} )
</foreach>
</insert>
<select id="queryMerchantAddress" parameterType="cn.pluss.platform.entity.MerchantAddress" resultType="cn.pluss.platform.entity.MerchantAddress">
SELECT * from tb_pluss_merchant_address
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="provinces!= null">
and provinces = #{provinces}
</if>
<if test="address!= null">
and address = #{address}
</if>
<if test="linkPhone!= null">
and linkPhone = #{linkPhone}
</if>
<if test="linkName!= null">
and linkName = #{linkName}
</if>
<if test="isDefault!= null">
and isDefault = #{isDefault}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
</select>
<select id="queryMerchantAddressList" parameterType="cn.pluss.platform.entity.MerchantAddress" resultType="cn.pluss.platform.entity.MerchantAddress">
SELECT * from tb_pluss_merchant_address
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="provinces!= null">
and provinces = #{provinces}
</if>
<if test="address!= null">
and address = #{address}
</if>
<if test="linkPhone!= null">
and linkPhone = #{linkPhone}
</if>
<if test="linkName!= null">
and linkName = #{linkName}
</if>
<if test="isDefault!= null">
and isDefault = #{isDefault}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
</select>
<update id="updateMerchantAddress" parameterType="cn.pluss.platform.entity.MerchantAddress" >
update tb_pluss_merchant_address
<set>
<if test="userId!= null">
userId = #{userId},
</if>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="provinces!= null">
provinces = #{provinces},
</if>
<if test="address!= null">
address = #{address},
</if>
<if test="linkPhone!= null">
linkPhone = #{linkPhone},
</if>
<if test="linkName!= null">
linkName = #{linkName},
</if>
<if test="isDefault!= null">
isDefault = #{isDefault},
</if>
<if test="createDt!= null">
createDt = #{createDt}
</if>
</set>
where id=#{id}
</update>
<delete id="deleteMerchantAddress" parameterType="cn.pluss.platform.entity.MerchantAddress" >
DELETE FROM tb_pluss_merchant_address where id=#{id}
</delete>
<select id="queryMerchantAddressPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.MerchantAddress">
SELECT * from tb_pluss_merchant_address
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="provinces!= null">
and provinces = #{provinces}
</if>
<if test="address!= null">
and address = #{address}
</if>
<if test="linkPhone!= null">
and linkPhone = #{linkPhone}
</if>
<if test="linkName!= null">
and linkName = #{linkName}
</if>
<if test="isDefault!= null">
and isDefault = #{isDefault}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryMerchantAddressPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_merchant_address
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="provinces!= null">
and provinces = #{provinces}
</if>
<if test="address!= null">
and address = #{address}
</if>
<if test="linkPhone!= null">
and linkPhone = #{linkPhone}
</if>
<if test="linkName!= null">
and linkName = #{linkName}
</if>
<if test="isDefault!= null">
and isDefault = #{isDefault}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
</where>
</select>
</mapper>

View 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="cn.pluss.platform.mapper.MerchantAuditRecordMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MerchantAuditRecord">
<id column="id" property="id" />
<result column="merchantCode" property="merchantCode" />
<result column="merchantId" property="merchantId" />
<result column="status" property="status" />
<result column="thirdStatus" property="thirdStatus" />
<result column="remark" property="remark" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,612 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MerchantBankCardMapper">
<insert id="saveMerchantBankCard" parameterType="cn.pluss.platform.entity.MerchantBankCard">
insert into tb_pluss_merchant_bank_card(merchantCode,storeId,bankCardNo,bankCertName,branchName,accountType,contactLine,branchProvince,branchCity,certType,certNo,cardHolderAddress,orderNo,merchantId,registerStatus,failReason,accountNo,wechatChannelList,phone,createDt,updateDt,userId,aisleSwitch,bankName,bankCardFrontPic,certStartTime,certEndTime,bankAddressNo,branchArea)VALUES(#{merchantCode},#{storeId},#{bankCardNo},#{bankCertName},#{branchName},#{accountType},#{contactLine},#{branchProvince},#{branchCity},#{certType},#{certNo},#{cardHolderAddress},#{orderNo},#{merchantId},#{registerStatus},#{failReason},#{accountNo},#{wechatChannelList},#{phone},now(),#{updateDt},#{userId},#{aisleSwitch},#{bankName},#{bankCardFrontPic},#{certStartTime},#{certEndTime},#{bankAddressNo},#{branchArea})
</insert>
<insert id="saveMerchantBankCardBatch">
insert into tb_pluss_merchant_bank_card(merchantCode,storeId,bankCardNo,bankCertName,branchName,accountType,contactLine,branchProvince,branchCity,certType,certNo,cardHolderAddress,orderNo,merchantId,registerStatus,failReason,accountNo,wechatChannelList,phone,createDt,updateDt) VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{merchantCode},#{storeId},#{bankCardNo},#{bankCertName},#{branchName},#{accountType},#{contactLine},#{branchProvince},#{branchCity},#{certType},#{certNo},#{cardHolderAddress},#{orderNo},#{merchantId},#{registerStatus},#{failReason},#{accountNo},#{wechatChannelList},#{phone},#{createDt},#{updateDt} )
</foreach>
</insert>
<select id="queryMerchantBankCard" parameterType="cn.pluss.platform.entity.MerchantBankCard" resultType="cn.pluss.platform.entity.MerchantBankCard">
SELECT * from tb_pluss_merchant_bank_card
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="bankCardNo!= null">
and bankCardNo = #{bankCardNo}
</if>
<if test="bankCertName!= null">
and bankCertName = #{bankCertName}
</if>
<if test="branchName!= null">
and branchName = #{branchName}
</if>
<if test="accountType!= null">
and accountType = #{accountType}
</if>
<if test="contactLine!= null">
and contactLine = #{contactLine}
</if>
<if test="branchProvince!= null">
and branchProvince = #{branchProvince}
</if>
<if test="branchCity!= null">
and branchCity = #{branchCity}
</if>
<if test="certType!= null">
and certType = #{certType}
</if>
<if test="certNo!= null">
and certNo = #{certNo}
</if>
<if test="cardHolderAddress!= null">
and cardHolderAddress = #{cardHolderAddress}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="merchantId!= null">
and merchantId = #{merchantId}
</if>
<if test="registerStatus!= null">
and registerStatus = #{registerStatus}
</if>
<if test="failReason!= null">
and failReason = #{failReason}
</if>
<if test="accountNo!= null">
and accountNo = #{accountNo}
</if>
<if test="wechatChannelList!= null">
and wechatChannelList = #{wechatChannelList}
</if>
<if test="phone!= null">
and phone = #{phone}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="updateDt!= null">
and updateDt = #{updateDt}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="aisleSwitch!= null">
and aisleSwitch = #{aisleSwitch}
</if>
<if test="bankName!= null">
and bankName = #{bankName}
</if>
<if test="bankCardFrontPic!= null">
and bankCardFrontPic = #{bankCardFrontPic}
</if>
<if test="certStartTime!= null">
and certStartTime = #{certStartTime}
</if>
<if test="certEndTime!= null">
and certEndTime = #{certEndTime}
</if>
<if test="bankAddressNo!= null">
and bankAddressNo = #{bankAddressNo}
</if>
<if test="branchArea!= null">
and branchArea = #{branchArea}
</if>
</where>
</select>
<select id="queryMerchantBankCardList" parameterType="cn.pluss.platform.entity.MerchantBankCard" resultType="cn.pluss.platform.entity.MerchantBankCard">
SELECT * from tb_pluss_merchant_bank_card
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="bankCardNo!= null">
and bankCardNo = #{bankCardNo}
</if>
<if test="bankCertName!= null">
and bankCertName = #{bankCertName}
</if>
<if test="branchName!= null">
and branchName = #{branchName}
</if>
<if test="accountType!= null">
and accountType = #{accountType}
</if>
<if test="contactLine!= null">
and contactLine = #{contactLine}
</if>
<if test="branchProvince!= null">
and branchProvince = #{branchProvince}
</if>
<if test="branchCity!= null">
and branchCity = #{branchCity}
</if>
<if test="certType!= null">
and certType = #{certType}
</if>
<if test="certNo!= null">
and certNo = #{certNo}
</if>
<if test="cardHolderAddress!= null">
and cardHolderAddress = #{cardHolderAddress}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="merchantId!= null">
and merchantId = #{merchantId}
</if>
<if test="registerStatus!= null">
and registerStatus = #{registerStatus}
</if>
<if test="failReason!= null">
and failReason = #{failReason}
</if>
<if test="accountNo!= null">
and accountNo = #{accountNo}
</if>
<if test="wechatChannelList!= null">
and wechatChannelList = #{wechatChannelList}
</if>
<if test="phone!= null">
and phone = #{phone}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="updateDt!= null">
and updateDt = #{updateDt}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="aisleSwitch!= null">
and aisleSwitch = #{aisleSwitch}
</if>
<if test="bankName!= null">
and bankName = #{bankName}
</if>
<if test="bankCardFrontPic!= null">
and bankCardFrontPic = #{bankCardFrontPic}
</if>
<if test="certStartTime!= null">
and certStartTime = #{certStartTime}
</if>
<if test="certEndTime!= null">
and certEndTime = #{certEndTime}
</if>
<if test="bankAddressNo!= null">
and bankAddressNo = #{bankAddressNo}
</if>
<if test="branchArea!= null">
and branchArea = #{branchArea}
</if>
</where>
</select>
<update id="updateMerchantBankCard" parameterType="cn.pluss.platform.entity.MerchantBankCard" >
update tb_pluss_merchant_bank_card
<set>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="storeId!= null">
storeId = #{storeId},
</if>
<if test="bankCardNo!= null">
bankCardNo = #{bankCardNo},
</if>
<if test="bankCertName!= null">
bankCertName = #{bankCertName},
</if>
<if test="branchName!= null">
branchName = #{branchName},
</if>
<if test="accountType!= null">
accountType = #{accountType},
</if>
<if test="contactLine!= null">
contactLine = #{contactLine},
</if>
<if test="branchProvince!= null">
branchProvince = #{branchProvince},
</if>
<if test="branchCity!= null">
branchCity = #{branchCity},
</if>
<if test="certType!= null">
certType = #{certType},
</if>
<if test="certNo!= null">
certNo = #{certNo},
</if>
<if test="cardHolderAddress!= null">
cardHolderAddress = #{cardHolderAddress},
</if>
<if test="orderNo!= null">
orderNo = #{orderNo},
</if>
<if test="merchantId!= null">
merchantId = #{merchantId},
</if>
<if test="registerStatus!= null">
registerStatus = #{registerStatus},
</if>
<if test="failReason!= null">
failReason = #{failReason},
</if>
<if test="accountNo!= null">
accountNo = #{accountNo},
</if>
<if test="wechatChannelList!= null">
wechatChannelList = #{wechatChannelList},
</if>
<if test="phone!= null">
phone = #{phone},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="updateDt!= null">
updateDt = #{updateDt},
</if>
<if test="userId!= null">
userId = #{userId},
</if>
<if test="aisleSwitch!= null">
aisleSwitch = #{aisleSwitch},
</if>
<if test="bankName!= null">
bankName = #{bankName},
</if>
<if test="bankCardFrontPic!= null">
bankCardFrontPic = #{bankCardFrontPic},
</if>
<if test="certStartTime!= null">
certStartTime = #{certStartTime},
</if>
<if test="certEndTime!= null">
certEndTime = #{certEndTime},
</if>
<if test="bankAddressNo!= null">
bankAddressNo = #{bankAddressNo},
</if>
<if test="branchArea!= null">
branchArea = #{branchArea}
</if>
</set>
where id=#{id}
</update>
<update id="updateMerchantBankCardUserId" parameterType="cn.pluss.platform.entity.MerchantBankCard" >
update tb_pluss_merchant_bank_card
<set>
<if test="merchantCode!= null">
merchantCode = #{merchantCode},
</if>
<if test="storeId!= null">
storeId = #{storeId},
</if>
<if test="bankCardNo!= null">
bankCardNo = #{bankCardNo},
</if>
<if test="bankCertName!= null">
bankCertName = #{bankCertName},
</if>
<if test="branchName!= null">
branchName = #{branchName},
</if>
<if test="accountType!= null">
accountType = #{accountType},
</if>
<if test="contactLine!= null">
contactLine = #{contactLine},
</if>
<if test="branchProvince!= null">
branchProvince = #{branchProvince},
</if>
<if test="branchCity!= null">
branchCity = #{branchCity},
</if>
<if test="certType!= null">
certType = #{certType},
</if>
<if test="certNo!= null">
certNo = #{certNo},
</if>
<if test="cardHolderAddress!= null">
cardHolderAddress = #{cardHolderAddress},
</if>
<if test="orderNo!= null">
orderNo = #{orderNo},
</if>
<if test="merchantId!= null">
merchantId = #{merchantId},
</if>
<if test="registerStatus!= null">
registerStatus = #{registerStatus},
</if>
<if test="failReason!= null">
failReason = #{failReason},
</if>
<if test="accountNo!= null">
accountNo = #{accountNo},
</if>
<if test="wechatChannelList!= null">
wechatChannelList = #{wechatChannelList},
</if>
<if test="phone!= null">
phone = #{phone},
</if>
<if test="createDt!= null">
createDt = #{createDt},
</if>
<if test="updateDt!= null">
updateDt = #{updateDt},
</if>
<if test="aisleSwitch!= null">
aisleSwitch = #{aisleSwitch},
</if>
<if test="bankName!= null">
bankName = #{bankName},
</if>
<if test="bankCardFrontPic!= null">
bankCardFrontPic = #{bankCardFrontPic},
</if>
<if test="certStartTime!= null">
certStartTime = #{certStartTime},
</if>
<if test="certEndTime!= null">
certEndTime = #{certEndTime},
</if>
<if test="bankAddressNo!= null">
bankAddressNo = #{bankAddressNo},
</if>
<if test="branchArea!= null">
branchArea = #{branchArea}
</if>
</set>
where userId=#{userId}
</update>
<delete id="deleteMerchantBankCard" parameterType="cn.pluss.platform.entity.MerchantBankCard" >
DELETE FROM tb_pluss_merchant_bank_card where id=#{id}
</delete>
<select id="queryMerchantBankCardPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.MerchantBankCard">
SELECT * from tb_pluss_merchant_bank_card
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="bankCardNo!= null">
and bankCardNo = #{bankCardNo}
</if>
<if test="bankCertName!= null">
and bankCertName like CONCAT("%",#{bankCertName},"%")
</if>
<if test="branchName!= null">
and branchName = #{branchName}
</if>
<if test="accountType!= null">
and accountType = #{accountType}
</if>
<if test="contactLine!= null">
and contactLine = #{contactLine}
</if>
<if test="branchProvince!= null">
and branchProvince = #{branchProvince}
</if>
<if test="branchCity!= null">
and branchCity = #{branchCity}
</if>
<if test="certType!= null">
and certType = #{certType}
</if>
<if test="certNo!= null">
and certNo = #{certNo}
</if>
<if test="cardHolderAddress!= null">
and cardHolderAddress = #{cardHolderAddress}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="merchantId!= null">
and merchantId = #{merchantId}
</if>
<if test="registerStatus!= null">
and registerStatus = #{registerStatus}
</if>
<if test="failReason!= null">
and failReason = #{failReason}
</if>
<if test="accountNo!= null">
and accountNo = #{accountNo}
</if>
<if test="wechatChannelList!= null">
and wechatChannelList = #{wechatChannelList}
</if>
<if test="phone!= null">
and phone = #{phone}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="updateDt!= null">
and updateDt = #{updateDt}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="aisleSwitch!= null">
and aisleSwitch = #{aisleSwitch}
</if>
<if test="bankName!= null">
and bankName = #{bankName}
</if>
<if test="bankCardFrontPic!= null">
and bankCardFrontPic = #{bankCardFrontPic}
</if>
<if test="certStartTime!= null">
and certStartTime = #{certStartTime}
</if>
<if test="certEndTime!= null">
and certEndTime = #{certEndTime}
</if>
<if test="bankAddressNo!= null">
and bankAddressNo = #{bankAddressNo}
</if>
<if test="branchArea!= null">
and branchArea = #{branchArea}
</if>
</where>
order by id desc limit #{pageSize} offset #{offset}
</select>
<select id="queryMerchantBankCardPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT count(*) from tb_pluss_merchant_bank_card
<where>
<if test="id!= null">
and id = #{id}
</if>
<if test="merchantCode!= null">
and merchantCode = #{merchantCode}
</if>
<if test="storeId!= null">
and storeId = #{storeId}
</if>
<if test="bankCardNo!= null">
and bankCardNo = #{bankCardNo}
</if>
<if test="bankCertName!= null">
and bankCertName like CONCAT("%",#{bankCertName},"%")
</if>
<if test="branchName!= null">
and branchName = #{branchName}
</if>
<if test="accountType!= null">
and accountType = #{accountType}
</if>
<if test="contactLine!= null">
and contactLine = #{contactLine}
</if>
<if test="branchProvince!= null">
and branchProvince = #{branchProvince}
</if>
<if test="branchCity!= null">
and branchCity = #{branchCity}
</if>
<if test="certType!= null">
and certType = #{certType}
</if>
<if test="certNo!= null">
and certNo = #{certNo}
</if>
<if test="cardHolderAddress!= null">
and cardHolderAddress = #{cardHolderAddress}
</if>
<if test="orderNo!= null">
and orderNo = #{orderNo}
</if>
<if test="merchantId!= null">
and merchantId = #{merchantId}
</if>
<if test="registerStatus!= null">
and registerStatus = #{registerStatus}
</if>
<if test="failReason!= null">
and failReason = #{failReason}
</if>
<if test="accountNo!= null">
and accountNo = #{accountNo}
</if>
<if test="wechatChannelList!= null">
and wechatChannelList = #{wechatChannelList}
</if>
<if test="phone!= null">
and phone = #{phone}
</if>
<if test="createDt!= null">
and createDt = #{createDt}
</if>
<if test="updateDt!= null">
and updateDt = #{updateDt}
</if>
<if test="userId!= null">
and userId = #{userId}
</if>
<if test="aisleSwitch!= null">
and aisleSwitch = #{aisleSwitch}
</if>
<if test="bankName!= null">
and bankName = #{bankName}
</if>
<if test="bankCardFrontPic!= null">
and bankCardFrontPic = #{bankCardFrontPic}
</if>
<if test="certStartTime!= null">
and certStartTime = #{certStartTime}
</if>
<if test="certEndTime!= null">
and certEndTime = #{certEndTime}
</if>
<if test="bankAddressNo!= null">
and bankAddressNo = #{bankAddressNo}
</if>
<if test="branchArea!= null">
and branchArea = #{branchArea}
</if>
</where>
</select>
<select id="queryMerchantBankCardInfoPage" parameterType="java.util.Map" resultType="cn.pluss.platform.entity.MerchantBankCard">
select mbc.id,mbc.bankCardNo,mbc.bankCertName,mbc.branchName,mbc.contactLine,mbc.branchProvince,mbc.branchCity,mbc.certNo,(select picUrl from tb_pluss_merchant_image mi where mi.merchantCode=mbc.merchantCode and mi.photoType='01') as image01,(select picUrl from tb_pluss_merchant_image mi where mi.merchantCode=mbc.merchantCode and mi.photoType='02') as image02,(select picUrl from tb_pluss_merchant_image mi where mi.merchantCode=mbc.merchantCode and mi.photoType='98') as image03,mbc.phone,mbc.createDt,mbc.updateDt from tb_pluss_merchant_bank_card mbc
<where>
<if test="bankCertName!=null and bankCertName!=''">
and mbc.bankCertName=#{bankCertName}
</if>
</where>
order by mbc.id DESC limit #{pageSize} offset #{offset}
</select>
<select id="queryMerchantBankCardInfoPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
select count(mbc.id) from tb_pluss_merchant_bank_card mbc
<where>
<if test="bankCertName!=null and bankCertName!=''">
and mbc.bankCertName=#{bankCertName}
</if>
</where>
</select>
</mapper>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MerchantBillStatisticsMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MerchantBillStatistics">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="startDate" property="startDate" />
<result column="endDate" property="endDate" />
<result column="type" property="type" />
<result column="amount" property="amount" />
<result column="count" property="count" />
<result column="remark" property="remark" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
<insert id="insertDuringBill">
INSERT IGNORE INTO tb_pluss_merchant_bill_statistics(userId, startDate, endDate, type, amount, count)
SELECT ua.userId, #{startDate}, #{endDate}, "1", IFNULL(t.amount, 0), IFNULL(t.count, 0)
FROM
tb_pluss_user_app ua LEFT JOIN
(
SELECT
t.merchantCode,
SUM(
IF( `status` = '1', consumeFee, -consumeFee )
) amount,
SUM(
IF( `status` = '1', 1, 0 )
) count
FROM
(
SELECT
merchantCode, `status`, consumeFee,
DATE_FORMAT( createDt, "%Y-%m-%d" ) createTime
FROM tb_pluss_merchant_order
WHERE `status` IN ( '1', '2' )
AND createDt &gt;= CONCAT(#{startDate}, " 00:00:00")
AND createDt &lt;= CONCAT(#{endDate}, " 23:59:59")
) t
GROUP BY
t.merchantCode
) t ON t.merchantCode = ua.merchantCode
LEFT JOIN tb_pluss_merchant_channel_status mcs ON ua.merchantCode = mcs.merchantCode
WHERE ua.userType = 'promoter' AND mcs.`status` = '3' AND mcs.updateTime &lt;= CONCAT(#{endDate}, " 23:59:59" )
</insert>
</mapper>

View 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="cn.pluss.platform.mapper.MerchantCashPayCodeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MerchantCashPayCode">
<id column="id" property="id" />
<result column="cashPlaceId" property="cashPlaceId" />
<result column="payCode" property="payCode" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View 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="cn.pluss.platform.mapper.MerchantCashPlaceMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MerchantCashPlace">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="name" property="name" />
<result column="address" property="address" />
<result column="remark" property="remark" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
</mapper>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MerchantCashPlaceStaffMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MerchantCashPlaceStaff">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="cashPlaceId" property="cashPlaceId" />
<result column="remark" property="remark" />
<result column="status" property="status" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
</resultMap>
<!-- 通用查询映射结果 -->
<resultMap id="BaseVOResultMap" type="cn.pluss.platform.vo.MerchantCashPlaceStaffVO">
<id column="id" property="id" />
<result column="userId" property="userId" />
<result column="cashPlaceId" property="cashPlaceId" />
<result column="remark" property="remark" />
<result column="createTime" property="createTime" />
<result column="updateTime" property="updateTime" />
<result column="status" property="status" />
<association property="staff" javaType="cn.pluss.platform.entity.UserApp">
<result column="userId" property="userId" />
<result column="userName" property="userName" />
</association>
</resultMap>
<select id="selectCustom" resultMap="BaseVOResultMap">
SELECT
mcps.id, mcps.userId, mcps.status, mcps.cashPlaceId, mcps.remark, mcps.createTime, mcps.updateTime, ua.userName
FROM tb_pluss_merchant_cash_place_staff mcps
LEFT JOIN tb_pluss_user_app ua ON mcps.userId = ua.userId
${ew.customSqlSegment}
</select>
</mapper>

View 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="cn.pluss.platform.mapper.MerchantChannelImgMapper">
<delete id="removeByMerchantCode">
DELETE ci FROM tb_pluss_merchant_channel_img ci
LEFT JOIN tb_pluss_merchant_image mi
ON ci.srcUrl = mi.picUrl
WHERE ci.channelType = #{channelType} AND mi.merchantCode LIKE CONCAT(#{merchantCode}, '%')
</delete>
<select id="selectListByUserId" resultType="cn.pluss.platform.entity.MerchantImage">
SELECT mi.id, mi.merchantCode, mi.photoType, ci.channelImgUrl photoUrl, mi.picUrl, mi.createDt, mi.updateDt FROM tb_pluss_merchant_base_info bi
LEFT JOIN tb_pluss_merchant_image mi ON bi.merchantCode = mi.merchantCode
LEFT JOIN tb_pluss_merchant_channel_img ci ON mi.picUrl = ci.srcUrl
WHERE bi.userId = #{userId} AND channelType = #{channelId}
</select>
</mapper>

View 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="cn.pluss.platform.mapper.MerchantChannelMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.pluss.platform.entity.MerchantChannel">
<id column="id" property="id" />
<result column="channelName" property="channelName" />
<result column="channelCode" property="channelCode" />
<result column="status" property="status" />
</resultMap>
<select id="selectValidIdList" resultType="java.lang.Integer">
SELECT id FROM tb_pluss_merchant_channel WHERE `status` = 1
</select>
</mapper>

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.pluss.platform.mapper.MerchantChannelStatusMapper">
<select id="getByIdLock" resultType="cn.pluss.platform.entity.MerchantChannelStatus">
SELECT * FROM tb_pluss_merchant_channel_status WHERE id = #{id} FOR UPDATE;
</select>
<select id="getByMerchantCode" resultType="cn.pluss.platform.entity.MerchantChannelStatus">
SELECT t1.* FROM tb_pluss_merchant_channel_status t1
LEFT JOIN tb_pluss_merchant_channel t2 ON t1.channel = t2.id
WHERE t2.`status` = '1' AND t1.merchantCode = #{merchantCode} AND t1.channel = #{channel}
</select>
<select id="getRyxNoCertMerchant" resultType="cn.pluss.platform.entity.MerchantChannelStatus">
SELECT t1.* FROM tb_pluss_merchant_channel_status t1
LEFT JOIN tb_pluss_sub_merchant_apply_order t2 ON t1.merchantCode = t2.merchantCode
AND t1.channel = t2.channelId
WHERE t1.channel = 3 AND t1.`status` = 3 AND (t2.`status` = 0 OR t2.`status` IS NULL OR t2.resultStatus = '审核中' OR t2.resultStatus = '未提交' OR t2.resultStatus = '编辑中')
</select>
<select id="selectListWithUserId" resultType="cn.pluss.platform.entity.MerchantChannelStatus">
SELECT t1.*, mbi.userId FROM tb_pluss_merchant_channel_status t1
LEFT JOIN tb_pluss_merchant_base_info mbi ON t1.merchantCode = mbi.merchantCode
${ew.customSqlSegment}
</select>
<select id="getUserNumInfo" resultType="cn.pluss.platform.vo.UserNumVO">
SELECT
count(1) as totalNum,
IFNULL(SUM(IF(t.createDate = #{date},1,0)),0) AS addNum
FROM (
SELECT
merchantCode,
<if test="dateType == null or dateType == 1">
DATE_FORMAT(createTime, '%Y-%m-%d' ) AS createDate
</if>
<if test="dateType == 2">
DATE_FORMAT(createTime, '%Y-%m' ) AS createDate
</if>
<if test="dateType == 3">
DATE_FORMAT(createTime, '%Y' ) AS createDate
</if>
FROM
tb_pluss_merchant_channel_status
WHERE
`status` = 3
GROUP BY
merchantCode
) t
LEFT JOIN tb_pluss_user_app ua ON t.merchantCode = ua.merchantCode
WHERE ua.userType = 'promoter' AND ua.parentId = #{userId}
</select>
<select id="selectListByMerchantCode" resultType="cn.pluss.platform.vo.MerchantChannelStatusVO">
SELECT mcs.*, smWx.subMchId wxMercNo, smZfb.subMchId zfbMercNo FROM tb_pluss_merchant_channel_status mcs
LEFT JOIN tb_pluss_sub_merchant smWx ON smWx.merchantId = mcs.merchantId AND smWx.subMchType = 'WX'
LEFT JOIN tb_pluss_sub_merchant smZfb ON smZfb.merchantId = mcs.merchantId AND smZfb.subMchType = 'ZFB'
WHERE ((smWx.id IS NULL) OR (smZfb.id IS NULL)
OR (smWx.subMchId NOT LIKE '%\_%' AND smZfb.subMchId NOT LIKE '%\_%')
OR RIGHT(smWx.subMchId, 4) = RIGHT(smZfb.subMchId, 4) OR (smWx.channelTypeId != 4 AND smZfb.channelTypeId != 4)) AND mcs.merchantCode IN
<foreach open="(" separator="," close=")" collection="merchantCodeList" item="item">
#{item}
</foreach>
</select>
<select id="selectByChangeFlowId" resultType="cn.pluss.platform.entity.MerchantChannelStatus">
SELECT * FROM tb_pluss_merchant_channel_status
WHERE channel = 4 AND `status` = 3 AND (extra ->> '$.changeFlowId') = #{changeFlowId}
</select>
<select id="selectBySysFlowId" resultType="cn.pluss.platform.entity.MerchantChannelStatus">
SELECT * FROM tb_pluss_merchant_channel_status
WHERE channel = 4 AND `status` = 3 AND (extra ->> '$.sysFlowId') = #{sysFlowId}
</select>
</mapper>

Some files were not shown because too many files have changed in this diff Show More