修改不能按条件查询的bug
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 23s

This commit is contained in:
dy 2025-07-11 11:15:28 +08:00
parent 8c6e6507df
commit 1beae8d9af
4 changed files with 25 additions and 11 deletions

View File

@ -98,7 +98,7 @@ public class CleanOrder extends TenantEntity {
/**
* 状态
*/
private int state;
private Integer state;
/**
* 联系电话

View File

@ -119,7 +119,7 @@ public class CleanOrderBo extends BaseEntity {
/**
* 状态
*/
private int state;
private Integer state;
@NotEmpty(message = "订单详情不能为空", groups = {AddGroup.class})
private List<Clean> cleanList;

View File

@ -102,7 +102,8 @@ public class CleanOrderServiceImpl implements ICleanOrderService {
public TableDataInfo<CleanOrderVo> queryPageList(CleanOrderBo bo, PageQuery pageQuery) {
// 构造条件查询器返回的是一个集合
LambdaQueryWrapper<CleanOrder> lqw = buildQueryWrapper(bo);
Page<CleanOrderVo> result = baseMapper.selectForPage(pageQuery.build(), lqw);
Page<CleanOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw,CleanOrderVo.class);
// Page<CleanOrderVo> result = baseMapper.selectForPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@ -133,10 +134,12 @@ public class CleanOrderServiceImpl implements ICleanOrderService {
lqw.eq(bo.getStarTime() != null, CleanOrder::getStarTime, bo.getStarTime());
lqw.eq(bo.getEndTime() != null, CleanOrder::getEndTime, bo.getEndTime());
lqw.eq(bo.getUnitId() != null, CleanOrder::getUnitId, bo.getUnitId());
// lqw.eq(StringUtils.isNotBlank(bo.getUnit()), CleanOrder::getState, bo.getState());
lqw.eq(bo.getState() != null, CleanOrder::getState, bo.getState());
// lqw.eq(StringUtils.isNotBlank(bo.getUnit()), CleanOrder::getUnit, bo.getUnit());
lqw.eq(StringUtils.isNotBlank(bo.getPersion()), CleanOrder::getPersion, bo.getPersion());
lqw.eq(StringUtils.isNotBlank(bo.getPhone()), CleanOrder::getPhone, bo.getPhone());
//将lqw中的所有条件都封装到一个params对象中集合中
return lqw;
}

View File

@ -6,14 +6,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectForPage" resultType="org.dromara.property.domain.vo.CleanOrderVo">
SELECT
co.*,
c.*,
cr.areas,
cr.sum_price
co.*,
c.*,
cr.areas,
cr.sum_price
FROM
clean_order co
LEFT JOIN clean c ON co.clean_id = c.id
LEFT JOIN clean_relation cr ON c.id = cr.clean_id;
clean_order co
LEFT JOIN clean c ON co.clean_id = c.id
LEFT JOIN clean_relation cr ON c.id = cr.clean_id
<!-- <where>-->
<!-- <if test="payState != null and payState!= ''">-->
<!-- co.pay_state = #{payState}-->
<!-- </if>-->
<!-- <if test="persion != null and persion!= ''">-->
<!-- co.persion = #{persion}-->
<!-- </if>-->
<!-- <if test="state != null and state!= ''">-->
<!-- co.state = #{state}-->
<!-- </if>-->
<!-- </where>-->
</select>
<!-- <select id="selectforDetail" resultType="org.dromara.property.domain.vo.CleanOrderVo"-->
<!-- parameterType="java.lang.Long">-->