修改案例列表展示接口参数

master
xiaoCJ 5 months ago
parent 20a45e7084
commit 09961fee00

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

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

@ -349,15 +349,17 @@
<!--下面为自己手动添加的xml-->
<select id="getCaseInfoList" resultMap="ResultMapWithBLOBs">
select * from case_info
SELECT * FROM case_info
<where>
<if test="keyWord !=null and keyWord !=''">
customer_name like CONCAT ('%',#{keyWord},'%') or id_card like CONCAT ('%',#{keyWord},'%')
source IN ('999999999', #{schoolId})
<if test="keyWord != null and keyWord != ''">
AND
(customer_name LIKE CONCAT('%', #{keyWord}, '%') OR id_card LIKE CONCAT('%', #{keyWord}, '%'))
</if>
<if test="type !=null and type !=''">
and manage_money_matters_type = #{type}
<if test="type != null and type != ''">
AND manage_money_matters_type LIKE CONCAT('%', #{type}, '%')
</if>
</where>
ORDER BY add_time desc
ORDER BY add_time DESC
</select>
</mapper>
Loading…
Cancel
Save