|
@@ -3,59 +3,59 @@
|
|
|
<mapper namespace="com.kxs.product.biz.mapper.KxsMachineMapper">
|
|
<mapper namespace="com.kxs.product.biz.mapper.KxsMachineMapper">
|
|
|
|
|
|
|
|
<resultMap type="com.kxs.product.api.model.KxsMachine" id="KxsMachineMap">
|
|
<resultMap type="com.kxs.product.api.model.KxsMachine" id="KxsMachineMap">
|
|
|
- <result column="id" property="id" />
|
|
|
|
|
- <result column="create_time" property="createTime" />
|
|
|
|
|
- <result column="update_time" property="updateTime" />
|
|
|
|
|
- <result column="del_flag" property="delFlag" />
|
|
|
|
|
- <result column="version" property="version" />
|
|
|
|
|
- <result column="pos_sn" property="posSn" />
|
|
|
|
|
- <result column="warehouse_id" property="warehouseId" />
|
|
|
|
|
- <result column="warehouse_name" property="warehouseName" />
|
|
|
|
|
- <result column="user_id" property="userId" />
|
|
|
|
|
- <result column="merchant_id" property="merchantId" />
|
|
|
|
|
- <result column="brand_id" property="brandId" />
|
|
|
|
|
- <result column="recycle_status" property="recycleStatus" />
|
|
|
|
|
- <result column="recycle_end_time" property="recycleEndTime" />
|
|
|
|
|
- <result column="machine_type" property="machineType" />
|
|
|
|
|
- <result column="cash_pledge" property="cashPledge" />
|
|
|
|
|
- <result column="source_pledge" property="sourcePledge" />
|
|
|
|
|
- <result column="allot_path" property="allotPath" />
|
|
|
|
|
- <result column="bind_time" property="bindTime" />
|
|
|
|
|
- <result column="act_time" property="actTime" />
|
|
|
|
|
- <result column="delivery_time" property="deliveryTime" />
|
|
|
|
|
- <result column="box_sn" property="boxSn" />
|
|
|
|
|
- <result column="machine_ratio" property="machineRatio" />
|
|
|
|
|
- <result column="is_act" property="isAct" />
|
|
|
|
|
- <result column="bind_status" property="bindStatus" />
|
|
|
|
|
- <result column="status" property="status" />
|
|
|
|
|
- <result column="is_first" property="isFirst" />
|
|
|
|
|
- <result column="up_fee_flag" property="upFeeFlag" />
|
|
|
|
|
- <result column="down_fee_flag" property="downFeeFlag" />
|
|
|
|
|
- <result column="is_supply" property="isSupply" />
|
|
|
|
|
- <result column="is_op_act" property="isOpAct" />
|
|
|
|
|
- <result column="return_status" property="returnStatus" />
|
|
|
|
|
- <result column="pre_user_id" property="preUserId" />
|
|
|
|
|
- <result column="batch_no" property="batchNo" />
|
|
|
|
|
|
|
+ <result column="id" property="id"/>
|
|
|
|
|
+ <result column="create_time" property="createTime"/>
|
|
|
|
|
+ <result column="update_time" property="updateTime"/>
|
|
|
|
|
+ <result column="del_flag" property="delFlag"/>
|
|
|
|
|
+ <result column="version" property="version"/>
|
|
|
|
|
+ <result column="pos_sn" property="posSn"/>
|
|
|
|
|
+ <result column="warehouse_id" property="warehouseId"/>
|
|
|
|
|
+ <result column="warehouse_name" property="warehouseName"/>
|
|
|
|
|
+ <result column="user_id" property="userId"/>
|
|
|
|
|
+ <result column="merchant_id" property="merchantId"/>
|
|
|
|
|
+ <result column="brand_id" property="brandId"/>
|
|
|
|
|
+ <result column="recycle_status" property="recycleStatus"/>
|
|
|
|
|
+ <result column="recycle_end_time" property="recycleEndTime"/>
|
|
|
|
|
+ <result column="machine_type" property="machineType"/>
|
|
|
|
|
+ <result column="cash_pledge" property="cashPledge"/>
|
|
|
|
|
+ <result column="source_pledge" property="sourcePledge"/>
|
|
|
|
|
+ <result column="allot_path" property="allotPath"/>
|
|
|
|
|
+ <result column="bind_time" property="bindTime"/>
|
|
|
|
|
+ <result column="act_time" property="actTime"/>
|
|
|
|
|
+ <result column="delivery_time" property="deliveryTime"/>
|
|
|
|
|
+ <result column="box_sn" property="boxSn"/>
|
|
|
|
|
+ <result column="machine_ratio" property="machineRatio"/>
|
|
|
|
|
+ <result column="is_act" property="isAct"/>
|
|
|
|
|
+ <result column="bind_status" property="bindStatus"/>
|
|
|
|
|
+ <result column="status" property="status"/>
|
|
|
|
|
+ <result column="is_first" property="isFirst"/>
|
|
|
|
|
+ <result column="up_fee_flag" property="upFeeFlag"/>
|
|
|
|
|
+ <result column="down_fee_flag" property="downFeeFlag"/>
|
|
|
|
|
+ <result column="is_supply" property="isSupply"/>
|
|
|
|
|
+ <result column="is_op_act" property="isOpAct"/>
|
|
|
|
|
+ <result column="return_status" property="returnStatus"/>
|
|
|
|
|
+ <result column="pre_user_id" property="preUserId"/>
|
|
|
|
|
+ <result column="batch_no" property="batchNo"/>
|
|
|
|
|
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
<select id="machineStoreList" resultType="com.kxs.product.api.vo.kxsapp.machine.MachineStoreListVO">
|
|
<select id="machineStoreList" resultType="com.kxs.product.api.vo.kxsapp.machine.MachineStoreListVO">
|
|
|
select create_time, pos_sn from kxs_machine
|
|
select create_time, pos_sn from kxs_machine
|
|
|
- <where>
|
|
|
|
|
- and del_flag = 0
|
|
|
|
|
- and status = 0
|
|
|
|
|
- <if test="query.warehouseId != null">
|
|
|
|
|
- and warehouse_id = #{query.warehouseId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="query.brandId != null">
|
|
|
|
|
- and brand_id = #{query.brandId}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="query.boxSn != null and query.boxSn != ''">
|
|
|
|
|
- and box_sn = #{query.boxSn}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="query.posSn != null and query.posSn != ''">
|
|
|
|
|
- and pos_sn like concat('%', #{query.posSn}, '%')
|
|
|
|
|
- </if>
|
|
|
|
|
- </where>
|
|
|
|
|
|
|
+ <where>
|
|
|
|
|
+ and del_flag = 0
|
|
|
|
|
+ and status = 0
|
|
|
|
|
+ <if test="query.warehouseId != null">
|
|
|
|
|
+ and warehouse_id = #{query.warehouseId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.brandId != null">
|
|
|
|
|
+ and brand_id = #{query.brandId}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.boxSn != null and query.boxSn != ''">
|
|
|
|
|
+ and box_sn = #{query.boxSn}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="query.posSn != null and query.posSn != ''">
|
|
|
|
|
+ and pos_sn like concat('%', #{query.posSn}, '%')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
<select id="recycleMachinesPage" resultType="com.kxs.product.api.vo.kxsapp.machine.RecycleMachinesVO">
|
|
<select id="recycleMachinesPage" resultType="com.kxs.product.api.vo.kxsapp.machine.RecycleMachinesVO">
|
|
@@ -102,7 +102,7 @@
|
|
|
</select>
|
|
</select>
|
|
|
<select id="getByPage" resultType="com.kxs.product.api.vo.kxsapp.machine.MachineUserListVO">
|
|
<select id="getByPage" resultType="com.kxs.product.api.vo.kxsapp.machine.MachineUserListVO">
|
|
|
select a.is_act, a.pos_sn, a.machine_type, a.cash_pledge, a.delivery_time, a.warehouse_name,
|
|
select a.is_act, a.pos_sn, a.machine_type, a.cash_pledge, a.delivery_time, a.warehouse_name,
|
|
|
- b.name as brand
|
|
|
|
|
|
|
+ b.name as brand
|
|
|
from kxs_machine a
|
|
from kxs_machine a
|
|
|
left join kxs_brand b on a.brand_id = b.id
|
|
left join kxs_brand b on a.brand_id = b.id
|
|
|
<where>
|
|
<where>
|
|
@@ -138,7 +138,8 @@
|
|
|
</if>
|
|
</if>
|
|
|
order by recycle_end_time desc
|
|
order by recycle_end_time desc
|
|
|
</select>
|
|
</select>
|
|
|
- <select id="activateMachineMonthTotal" resultType="com.kxs.product.api.vo.kxsapp.machine.StoreActMachineMonthTotalVO">
|
|
|
|
|
|
|
+ <select id="activateMachineMonthTotal"
|
|
|
|
|
+ resultType="com.kxs.product.api.vo.kxsapp.machine.StoreActMachineMonthTotalVO">
|
|
|
select * from
|
|
select * from
|
|
|
(
|
|
(
|
|
|
select count(id) as totalNumber, DATE_FORMAT(act_time,'%Y-%m') AS `month`
|
|
select count(id) as totalNumber, DATE_FORMAT(act_time,'%Y-%m') AS `month`
|
|
@@ -152,7 +153,8 @@
|
|
|
) as tmp
|
|
) as tmp
|
|
|
ORDER BY `date` desc
|
|
ORDER BY `date` desc
|
|
|
</select>
|
|
</select>
|
|
|
- <select id="activateMachineMonthTotalDetail" resultType="com.kxs.product.api.vo.kxsapp.machine.StoreActMachineDayDetailVO">
|
|
|
|
|
|
|
+ <select id="activateMachineMonthTotalDetail"
|
|
|
|
|
+ resultType="com.kxs.product.api.vo.kxsapp.machine.StoreActMachineDayDetailVO">
|
|
|
SELECT *
|
|
SELECT *
|
|
|
FROM (
|
|
FROM (
|
|
|
SELECT count(id) as number, DATE_FORMAT(act_time,'%Y-%m-%d') AS `date`
|
|
SELECT count(id) as number, DATE_FORMAT(act_time,'%Y-%m-%d') AS `date`
|
|
@@ -169,5 +171,17 @@
|
|
|
) AS tmp
|
|
) AS tmp
|
|
|
ORDER BY `date` desc
|
|
ORDER BY `date` desc
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+ <select id="selectDeductList" resultMap="KxsMachineMap">
|
|
|
|
|
+ select a.id, a.user_id, a.pos_sn, a.brand_id, a.recycle_end_time
|
|
|
|
|
+ from kxs_machine a
|
|
|
|
|
+ left join kxs_machine_deduct b on a.pos_sn = b.pos_sn
|
|
|
|
|
+ where
|
|
|
|
|
+ b.pos_sn is null
|
|
|
|
|
+ and a.del_flag = 0
|
|
|
|
|
+ and a.user_id = #{query.userId}
|
|
|
|
|
+ and a.status = #{query.status}
|
|
|
|
|
+ and a.bind_status = #{query.bindStatus}
|
|
|
|
|
+ and a.recycle_end_time < #{query.recycleEndTime}
|
|
|
|
|
+ </select>
|
|
|
|
|
|
|
|
</mapper>
|
|
</mapper>
|