1.添加单据类型查询接口

master
x_z 2 years ago
parent 6a79144a39
commit 1ed8f561a9

@ -1,10 +1,17 @@
package com.glxp.api.controller.basic;
import com.github.pagehelper.PageInfo;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.req.basic.FilterBussinessTypeRequest;
import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
@ -16,4 +23,21 @@ public class BasicBussinessTypeController {
@Resource
private IBasicBussinessTypeService basicBussinessTypeService;
/**
*
*
* @param filterBussinessTypeRequest
* @return
*/
@GetMapping("/udiwms/basic/busType/filterList")
public BaseResponse filterList(FilterBussinessTypeRequest filterBussinessTypeRequest) {
List<BasicBussinessTypeResponse> list = basicBussinessTypeService.filterList(filterBussinessTypeRequest);
PageInfo<BasicBussinessTypeResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}
//public BaseResponse add()
}

@ -2,10 +2,21 @@ package com.glxp.api.dao.basic;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.req.basic.FilterBussinessTypeRequest;
import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface BasicBussinessTypeDao extends BaseMapper<BasicBussinessTypeEntity> {
/**
*
*
* @param filterBussinessTypeRequest
* @return
*/
List<BasicBussinessTypeResponse> filterList(FilterBussinessTypeRequest filterBussinessTypeRequest);
}

@ -36,11 +36,6 @@ public class FilterBussinessTypeRequest extends ListPageRequest {
*/
private String mainAction;
/**
*
*/
private Boolean enabled;
/**
*
*/

@ -1,7 +1,21 @@
package com.glxp.api.service.basic;
import com.glxp.api.req.basic.FilterBussinessTypeRequest;
import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import java.util.List;
/**
* Service
*/
public interface IBasicBussinessTypeService {
/**
*
*
* @param filterBussinessTypeRequest
* @return
*/
List<BasicBussinessTypeResponse> filterList(FilterBussinessTypeRequest filterBussinessTypeRequest);
}

@ -1,11 +1,16 @@
package com.glxp.api.service.basic.impl;
import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.basic.BasicBussinessTypeDao;
import com.glxp.api.req.basic.FilterBussinessTypeRequest;
import com.glxp.api.res.basic.BasicBussinessTypeResponse;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
@Slf4j
@Service
@ -14,4 +19,15 @@ public class BasicBussinessTypeServiceImpl implements IBasicBussinessTypeService
@Resource
private BasicBussinessTypeDao basicBussinessTypeDao;
@Override
public List<BasicBussinessTypeResponse> filterList(FilterBussinessTypeRequest filterBussinessTypeRequest) {
if (null == filterBussinessTypeRequest) {
return Collections.emptyList();
}
if (null != filterBussinessTypeRequest.getPage() && null != filterBussinessTypeRequest.getLimit()) {
PageHelper.offsetPage((filterBussinessTypeRequest.getPage() - 1) * filterBussinessTypeRequest.getLimit(), filterBussinessTypeRequest.getLimit());
}
return basicBussinessTypeDao.filterList(filterBussinessTypeRequest);
}
}

@ -2,6 +2,53 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.glxp.api.dao.basic.BasicBussinessTypeDao">
<select id="filterList" resultType="com.glxp.api.res.basic.BasicBussinessTypeResponse">
select *
from basic_bussiness_type bu
<where>
<if test="name != null and name != ''">
AND bu.name like concat('%', #{name}, '%')
</if>
<if test="action != null and action != ''">
AND bu.action like concat('%', #{action}, '%')
</if>
<if test="advanceType != null">
AND bu.advanceType = #{advanceType}
</if>
<if test="enable != null">
AND bu.enable = #{enable}
</if>
<if test="mainAction != null and mainAction != ''">
AND bu.mainAction = #{mainAction}
</if>
<if test="thirdAction != null and thirdAction != ''">
AND bu.thirdSysFk like concat('%', #{thirdAction}, '%')
</if>
<if test="checkEnable != null">
AND bu.checkEnable = #{checkEnable}
</if>
<if test="spUse != null">
AND bu.spUse = #{spUse}
</if>
<if test="secCheckEnable != null">
AND bu.secCheckEnable = #{secCheckEnable}
</if>
<if test="preIn != null">
AND bu.preIn = #{preIn}
</if>
<if test="actionList != null and actionList.size() != 0">
AND bu.action in
<foreach collection="actionList" index="index" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="lastUpdateTime != null and lastUpdateTime != ''">
<![CDATA[
and DATE_FORMAT(bu.updateTime, '%Y-%m-%d %H:%i:%S') >=
DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
]]>
</if>
</where>
order by bu.updateTime desc
</select>
</mapper>

Loading…
Cancel
Save