Commit 8b6f7c77 by wang_jiaxing

资源服务数量查询接口

parent 0feced17
package com.founder.controller;
import com.founder.model.R;
import com.founder.model.ZyfwParam;
import com.founder.service.QgztryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -21,9 +23,9 @@ public class ZyfwController {
@Autowired
private QgztryService qgztryService;
@PostMapping("/bj/getQgztryCount")
public R getQgztryCount(String isZl) {
public R getQgztryCount(@RequestBody ZyfwParam isZl) {
try {
int total = qgztryService.getQgztryCount(isZl);
int total = qgztryService.getQgztryCount(isZl.getIsZl());
return R.ok().data("total", total);
} catch (Exception e) {
log.error("错误日志", e);
......
package com.founder.model;
import lombok.Data;
/**
*
* @author create by lystar
* @date 2022/8/19 15:41
*/
@Data
public class ZyfwParam {
String isZl;
}
......@@ -2,9 +2,9 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.founder.xzxt.mysqldao.ZtryMapper">
<select id="getQgztryCount" resultType="java.lang.Integer">
select count(*) from tb_yw_ztry where xxsc_pdbz = '0'
select count(*) from tb_yw_ztry
<if test="isZl == '1'.toString()">
and xxrsksj >= DATE_FORMAT(NOW(),'%Y-%m-%d 00:00:00')
where xxrsksj >= DATE_FORMAT(NOW(),'%Y-%m-%d 00:00:00')
</if>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment