完成sms搜索

This commit is contained in:
little-cat-sweet 2021-08-04 11:07:53 +08:00
parent 861d5f0660
commit 208e21020a
6 changed files with 44 additions and 7 deletions

View File

@ -8,9 +8,6 @@ import com.xhpc.general.service.IXhpcAgreementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
* 协议管理controller
* program: ruoyi
@ -60,5 +57,4 @@ public class XhpcAgreementController extends BaseController {
return AjaxResult.success(iXhpcAgreementService.selectContent(type));
}
}

View File

@ -29,4 +29,10 @@ public class XhpcSmsController extends BaseController {
return xhpcSmsService.getLogonPhoneCode(phone);
}
@GetMapping(value = "/list")
public AjaxResult list(Integer status,String phone){
return xhpcSmsService.getList(status, phone);
}
}

View File

@ -1,6 +1,10 @@
package com.xhpc.general.mapper;
import com.xhpc.general.domain.XhpcSms;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author yuyang
@ -9,4 +13,6 @@ import com.xhpc.general.domain.XhpcSms;
public interface XhpcSmsMapper {
int addXhpcSms(XhpcSms xhpcSms);
List<Map<String,Object>> getList(@Param("status") int status,@Param("phone")String phone);
}

View File

@ -15,4 +15,6 @@ public interface IXhpcSmsService {
* @return
*/
AjaxResult getLogonPhoneCode(String phone);
AjaxResult getList(Integer status,String phone);
}

View File

@ -10,9 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.HashMap;
import java.util.Random;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -128,4 +126,15 @@ public class XhpcSmsServiceImpl implements IXhpcSmsService{
}
}
@Override
public AjaxResult getList(Integer status, String phone) {
// List<Map<String,Object>> map=xhpcSmsMapper.getList(status,phone);
// System.out.println();
// System.out.println();
// System.out.println(map.toString());
// System.out.println();
// System.out.println();
return AjaxResult.success(xhpcSmsMapper.getList(status,phone));
}
}

View File

@ -8,6 +8,7 @@
<result property="smsId" column="sms_id"/>
<result property="phone" column="phone"/>
<result property="code" column="code"/>
<result property="templateId" column="template_id"/>
<result property="accessKey" column="access_key"/>
<result property="secretKey" column="secret_key"/>
@ -92,4 +93,21 @@
</if>
</trim>
</insert>
<select id="getList" resultType="map">
select
phone,
content,
status,
create_time
from xhpc_sms
where del_flag=0
<if test="null!=status">
and status=#{status}
</if>
<if test="null!=phone and ''!=phone">
and phone like concat('%',#{phone},'%')
</if>
</select>
</mapper>