对账单
parent
47f714326a
commit
0d9f89bb6c
|
|
@ -1,8 +1,11 @@
|
|||
package com.njzscloud.supervisory.money.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyBillEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 对账单
|
||||
|
|
@ -10,4 +13,9 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
@Mapper
|
||||
public interface MoneyBillMapper extends BaseMapper<MoneyBillEntity> {
|
||||
|
||||
/**
|
||||
* 分页查询对账单(关联用户、站点、产品信息)
|
||||
*/
|
||||
IPage<MoneyBillEntity> selectMoneyBillWithNames(Page<MoneyBillEntity> page, @Param("entity") MoneyBillEntity entity);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,4 +118,22 @@ public class MoneyBillEntity {
|
|||
@TableLogic
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 用户昵称(扩展字段,不存储到数据库)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 站点名称(扩展字段,不存储到数据库)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 产品名称(扩展字段,不存储到数据库)
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String goodsName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
package com.njzscloud.supervisory.money.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.njzscloud.supervisory.money.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
|
|
@ -18,7 +18,7 @@ import java.util.List;
|
|||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEntity> implements IService<MoneyBillEntity> {
|
||||
public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEntity> {
|
||||
|
||||
/**
|
||||
* 新增
|
||||
|
|
@ -53,7 +53,9 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
|
|||
* 分页查询
|
||||
*/
|
||||
public PageResult<MoneyBillEntity> paging(PageParam pageParam, MoneyBillEntity moneyBillEntity) {
|
||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<MoneyBillEntity>query(moneyBillEntity)));
|
||||
Page<MoneyBillEntity> page = new Page<>(pageParam.getCurrent(), pageParam.getSize());
|
||||
IPage<MoneyBillEntity> result = baseMapper.selectMoneyBillWithNames(page, moneyBillEntity);
|
||||
return PageResult.of(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,4 +3,64 @@
|
|||
|
||||
<mapper namespace="com.njzscloud.supervisory.money.mapper.MoneyBillMapper">
|
||||
|
||||
<!-- 分页查询对账单(关联用户、站点、产品信息) -->
|
||||
<select id="selectMoneyBillWithNames" resultType="com.njzscloud.supervisory.money.pojo.entity.MoneyBillEntity">
|
||||
SELECT
|
||||
mb.id,
|
||||
mb.station_id as stationId,
|
||||
mb.user_id as userId,
|
||||
mb.invoice_status as invoiceStatus,
|
||||
mb.bill_status as billStatus,
|
||||
mb.start_time as startTime,
|
||||
mb.end_time as endTime,
|
||||
mb.bill_period as billPeriod,
|
||||
mb.goods_id as goodsId,
|
||||
mb.order_count as orderCount,
|
||||
mb.total_weight as totalWeight,
|
||||
mb.discount_money as discountMoney,
|
||||
mb.total_money as totalMoney,
|
||||
mb.creator_id as creatorId,
|
||||
mb.modifier_id as modifierId,
|
||||
mb.create_time as createTime,
|
||||
mb.modify_time as modifyTime,
|
||||
mb.deleted,
|
||||
u.nickname,
|
||||
bc.company_name as companyName,
|
||||
og.goods_name as goodsName
|
||||
FROM money_bill mb
|
||||
LEFT JOIN sys_user u ON mb.user_id = u.id
|
||||
LEFT JOIN biz_company bc ON mb.station_id = bc.id AND bc.station = 1
|
||||
LEFT JOIN order_goods og ON mb.goods_id = og.id
|
||||
<where>
|
||||
<if test="entity.userId != null">
|
||||
AND mb.user_id = #{entity.userId}
|
||||
</if>
|
||||
<if test="entity.stationId != null">
|
||||
AND mb.station_id = #{entity.stationId}
|
||||
</if>
|
||||
<if test="entity.goodsId != null">
|
||||
AND mb.goods_id = #{entity.goodsId}
|
||||
</if>
|
||||
<if test="entity.invoiceStatus != null">
|
||||
AND mb.invoice_status = #{entity.invoiceStatus}
|
||||
</if>
|
||||
<if test="entity.billStatus != null">
|
||||
AND mb.bill_status = #{entity.billStatus}
|
||||
</if>
|
||||
<if test="entity.billPeriod != null">
|
||||
AND mb.bill_period = #{entity.billPeriod}
|
||||
</if>
|
||||
<if test="entity.nickname != null and entity.nickname != ''">
|
||||
AND u.nickname LIKE CONCAT('%', #{entity.nickname}, '%')
|
||||
</if>
|
||||
<if test="entity.companyName != null and entity.companyName != ''">
|
||||
AND bc.company_name LIKE CONCAT('%', #{entity.companyName}, '%')
|
||||
</if>
|
||||
<if test="entity.goodsName != null and entity.goodsName != ''">
|
||||
AND og.goods_name LIKE CONCAT('%', #{entity.goodsName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY mb.modify_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue