案例新增接口 新加参数model

master
xiaoCJ 5 months ago
parent feac6e293f
commit 87cf7769bc

@ -176,11 +176,12 @@ public class CaseController {
@AnonymousAccess @AnonymousAccess
private ResultEntity<PageInfo<CaseInfo>> getCaseInfoList(@RequestParam Integer index, private ResultEntity<PageInfo<CaseInfo>> getCaseInfoList(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@RequestParam(required = false) String schoolId, @RequestParam(required = false) String model,
@RequestParam(required = false) String schoolId,
@RequestParam(required = false) String keyWord, @RequestParam(required = false) String keyWord,
@RequestParam(required = false) String type) { @RequestParam(required = false) String type) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
List<CaseInfo> caseInfoList = caseInfoMapper.getCaseInfoList(schoolId, keyWord, type); List<CaseInfo> caseInfoList = caseInfoMapper.getCaseInfoList(model, schoolId, keyWord, type);
PageInfo pageInfo = new PageInfo(caseInfoList); PageInfo pageInfo = new PageInfo(caseInfoList);
return new ResultEntity<PageInfo<CaseInfo>>(pageInfo); return new ResultEntity<PageInfo<CaseInfo>>(pageInfo);
} }

@ -2,12 +2,11 @@ package com.sztzjy.money_management.mapper;
import com.sztzjy.money_management.entity.CaseInfo; import com.sztzjy.money_management.entity.CaseInfo;
import com.sztzjy.money_management.entity.CaseInfoExample; import com.sztzjy.money_management.entity.CaseInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface CaseInfoMapper { public interface CaseInfoMapper {
long countByExample(CaseInfoExample example); long countByExample(CaseInfoExample example);
@ -38,7 +37,8 @@ public interface CaseInfoMapper {
int updateByPrimaryKey(CaseInfo record); int updateByPrimaryKey(CaseInfo record);
List<CaseInfo> getCaseInfoList(@Param("schoolId") String schoolId, List<CaseInfo> getCaseInfoList(@Param("model") String model,
@Param("schoolId") String schoolId,
@Param("keyWord") String keyWord, @Param("keyWord") String keyWord,
@Param("type") String type); @Param("type") String type);
} }

@ -354,6 +354,9 @@
<if test="schoolId != null and schoolId != ''"> <if test="schoolId != null and schoolId != ''">
AND source IN ('999999999', #{schoolId}) AND source IN ('999999999', #{schoolId})
</if> </if>
<if test="model != null and model != ''">
AND model =#{model}
</if>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
AND AND
(customer_name LIKE CONCAT('%', #{keyWord}, '%') OR id_card LIKE CONCAT('%', #{keyWord}, '%')) (customer_name LIKE CONCAT('%', #{keyWord}, '%') OR id_card LIKE CONCAT('%', #{keyWord}, '%'))

Loading…
Cancel
Save