fix(family-card): 支持持卡人身份证模糊查询
| | |
| | | <el-input v-model="filters.familyKeyword" :placeholder="isManagement ? '家属姓名、手机号' : '请输入家属姓名、手机号或身份证号'" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="持卡人" :class="{ 'family-card-filter-talent': isManagement }"> |
| | | <el-input v-model="filters.talentKeyword" placeholder="持卡人姓名、手机号、卡号" clearable /> |
| | | <el-input v-model="filters.talentKeyword" placeholder="持卡人姓名、手机号、身份证号或卡号" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="卡片等级"> |
| | | <el-select v-model="filters.cardLevel" placeholder="全部" clearable> |
| | |
| | | public ApiResponse<PageResult<DependentCardApplyAdminResponse>> page( |
| | | @Parameter(description = "主卡ID") @RequestParam(required = false) Long talentCardId, |
| | | @Parameter(description = "家属姓名、手机号或身份证号") @RequestParam(required = false) String familyKeyword, |
| | | @Parameter(description = "持卡人姓名、手机号或卡号") @RequestParam(required = false) String talentKeyword, |
| | | @Parameter(description = "持卡人姓名、手机号、身份证号或卡号") @RequestParam(required = false) String talentKeyword, |
| | | @Parameter(description = "卡片等级") @RequestParam(required = false) String cardLevel, |
| | | @Parameter(description = "状态:0待审核、1已通过、2已驳回、3已取消") @RequestParam(required = false) Integer status, |
| | | @Parameter(description = "申请开始日期") @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate applyStart, |
| | |
| | | .or() |
| | | .like(DependentCardApply::getTalentMobile, talentKeyword.trim()) |
| | | .or() |
| | | .like(DependentCardApply::getTalentCardNo, talentKeyword.trim())) |
| | | .like(DependentCardApply::getTalentCardNo, talentKeyword.trim()) |
| | | .or() |
| | | .apply("exists (select 1 from talent_user u where u.id = dependent_card_apply.talent_id and u.deleted = 0 and u.id_card_no like concat('%', {0}, '%'))", talentKeyword.trim())) |
| | | .ge(applyStart != null, DependentCardApply::getApplyTime, applyStart == null ? null : applyStart.atStartOfDay()) |
| | | .lt(applyEnd != null, DependentCardApply::getApplyTime, applyEnd == null ? null : applyEnd.plusDays(1).atStartOfDay()); |
| | | long total = mapper.selectCount(query); |
| | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.MybatisConfiguration; |
| | | import com.baomidou.mybatisplus.core.metadata.TableInfoHelper; |
| | | import com.talentcard.server.common.BusinessException; |
| | |
| | | .hasMessageContaining("正常或已解绑"); |
| | | } |
| | | |
| | | @Test |
| | | void talentKeywordIncludesIdCardFuzzySearch() { |
| | | when(mapper.selectCount(any(Wrapper.class))).thenReturn(0L); |
| | | |
| | | service.page(null, null, "510105", null, null, null, null, false, 1, 10); |
| | | |
| | | ArgumentCaptor<LambdaQueryWrapper<DependentCardApply>> queryCaptor = ArgumentCaptor.forClass(LambdaQueryWrapper.class); |
| | | verify(mapper).selectCount(queryCaptor.capture()); |
| | | LambdaQueryWrapper<DependentCardApply> query = queryCaptor.getValue(); |
| | | assertThat(query.getSqlSegment()).contains("talent_user", "id_card_no like concat"); |
| | | assertThat(query.getParamNameValuePairs()).containsValue("510105"); |
| | | } |
| | | |
| | | private DependentCardApply applicationWithStatus(int status) { |
| | | DependentCardApply apply = new DependentCardApply( |
| | | "DCA-001", 1L, 2L, "持卡人", "13900000000", "TC-001", "卓越人才卡", |