更新9.21

This commit is contained in:
许允枞 2024-09-21 17:16:01 +08:00
parent 6d59ca8743
commit 1f6b51ae20
5 changed files with 54 additions and 1 deletions

View File

@ -56,6 +56,21 @@ public class FleetMemberController extends BaseController {
return getSuccessResult(fleetMemberService.queryPage(page,fleetMember));
}
/**
* 根据条件分页查询首页轮播图
* @param fleetMember
* @param pageNo
* @param pageSize
* @return
*/
@GetMapping("/nameOrMobile")
public ResponseObject listsByNameOrMobile(FleetMemberVo fleetMember,
@RequestParam(value = "page",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize){
Page page =new Page(pageNo,pageSize);
return getSuccessResult(fleetMemberService.queryPage(page,fleetMember));
}
/**
* 通过主键查询单条数据
*

View File

@ -9,4 +9,5 @@ import org.apache.ibatis.annotations.Param;
public interface FleetMemberMapper extends BaseMapper<FleetMember> {
IPage<FleetMemberVo> queryPage(Page page, @Param("entity") FleetMemberVo fleetMember);
IPage<FleetMemberVo> queryPageByNameOrMobile(Page page, @Param("entity") FleetMemberVo fleetMember);
}

View File

@ -29,5 +29,39 @@
</where>
ORDER BY create_time DESC
</select>
<select id="queryPageByNameOrMobile" resultType="com.fuint.business.fleet.vo.FleetMemberVo">
SELECT fm.*,fi.fleet_name fleetName,ta.real_name accountName FROM fleet_member fm
LEFT JOIN fleet_info fi ON fm.fleet_id = fi.id
LEFT JOIN t_account ta ON fm.create_by = ta.acct_id
<where>
fm.if_log_off = '0'
<if test="entity.storeId != null and entity.storeId != ''">
and fm.store_id = #{entity.storeId}
</if>
<if test="entity.fleetId != null and entity.fleetId != ''">
and fm.fleet_id = #{entity.fleetId}
</if>
<if test="entity.status != null and entity.status != ''">
and fm.status = #{entity.status}
</if>
<if test="entity.secondaryCardType != null and entity.secondaryCardType != ''">
and fm.secondary_card_type = #{entity.secondaryCardType}
</if>
<if test="entity.fleetName != null and entity.fleetName != ''">
and fi.fleet_name like concat('%', #{entity.fleetName}, '%')
</if>
<if test="entity.params.beginTime != null and entity.params.beginTime != ''"><!-- 开始时间检索 -->
and date_format(fm.create_time,'%y%m%d') &gt;= date_format(#{entity.params.beginTime},'%y%m%d')
</if>
<if test="entity.params.endTime != null and entity.params.endTime != ''"><!-- 结束时间检索 -->
and date_format(fm.create_time,'%y%m%d') &lt;= date_format(#{entity.params.endTime},'%y%m%d')
</if>
<if test="entity.nameOrMobile != null and entity.nameOrMobile != ''">
and fm.name like concat('%', #{entity.nameOrMobile}, '%')
or fm.mobile = #{entity.nameOrMobile}
</if>
</where>
ORDER BY create_time DESC
</select>
</mapper>

View File

@ -1,6 +1,7 @@
package com.fuint.business.fleet.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -36,7 +37,7 @@ public class FleetMemberServiceImpl extends ServiceImpl<FleetMemberMapper,FleetM
public IPage<FleetMemberVo> queryPage(Page page, FleetMemberVo fleetMember) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
fleetMember.setStoreId(nowAccountInfo.getStoreId());
return baseMapper.queryPage(page,fleetMember);
return baseMapper.queryPageByNameOrMobile(page,fleetMember);
}
/**

View File

@ -19,4 +19,6 @@ public class FleetMemberVo extends FleetMember {
* 创建人
*/
private String accountName;
private String nameOrMobile;
}