短信统计,写了三个Mapper方法

This commit is contained in:
wen 2021-11-29 18:28:26 +08:00
parent 6fa15d9627
commit c61baa7a84
4 changed files with 78 additions and 3 deletions

View File

@ -25,7 +25,7 @@ public class XhpcSmsController extends BaseController {
* 注册获取手机号验证码
*/
@GetMapping(value = "/getLogonPhoneCode")
public AjaxResult getLogonPhoneCode(@RequestParam("phone") String phone) throws Exception {
public AjaxResult getLogonPhoneCode(@RequestParam("phone") String phone) {
String signatureName = null;
String templateId = null;
@ -75,4 +75,12 @@ public class XhpcSmsController extends BaseController {
xhpcSmsService.sendNotice(phone, signatureName, templateId, paramMap);
}
@GetMapping(value = "/getAliyunShortMessageInfo")
public AjaxResult getAliyunShortMessageInfo() {
Object messageInfo = xhpcSmsService.getAliyunShortMessageInfo();
return AjaxResult.success();
}
}

View File

@ -14,6 +14,37 @@ public interface XhpcSmsMapper {
int addXhpcSms(XhpcSms xhpcSms);
List<Map<String, Object>> getList(@Param("status") Integer status, @Param("phone") String phone);
/**
* 查询阿里云中发送失败的短信条数
*
* @return 返回发送失败的条数
* @author WH
* @date 2021/11/29 14:11
* @since version-1.0
*/
Long querySumOfFailMessage();
/**
* 查询阿里云中的发送成功的短信条数
*
* @return 发送成功的短信的条数
* @author WH
* @date 2021/11/29
* @since version-1.0
*/
Long querySumOfSuccessMessage();
/**
* 查询发送的短信的总记录数
*
* @return 返回发送过的短信的总记录数
* @author WH
* @date 2021/11/29 14:25
* @since version-1.0
*/
Long querySumOfMessage();
List<Map<String,Object>> getList(@Param("status") Integer status,@Param("phone") String phone);
}

View File

@ -46,4 +46,15 @@ public interface IXhpcSmsService {
* @param paramMap 模板中的参数
*/
void sendNotice(String phone, String signatureName, String templateId, Map<String, String> paramMap);
/**
* 获取阿里云短信服务信息
*
* @return 一个装有阿里云短信信息的对象
* @author WH
* @date 2021/11/29 10:31
* @since version-1.0
*/
Object getAliyunShortMessageInfo();
}

View File

@ -98,7 +98,7 @@
phone,
content,
status,
create_time as createTime
create_time as createTime
from xhpc_sms
where del_flag=0
<if test="null!=status">
@ -108,4 +108,29 @@
and phone like concat('%',#{phone},'%')
</if>
</select>
<select id="querySumOfFailMessage" resultType="java.lang.Long">
SELECT count(sms_id)
FROM xhpc_sms
WHERE status = 1
AND del_flag = 0
</select>
<select id="querySumOfSuccessMessage" resultType="java.lang.Long">
SELECT count(sms_id)
FROM xhpc_sms
WHERE remark LIKE "%bizId%"
AND del_flag = 0
</select>
<select id="querySumOfMessage" resultType="java.lang.Long">
SELECT count(sms_id)
FROM `xhpc_sms`
WHERE del_flag = 0
</select>
</mapper>