Commit 77415feb by 林永健

修改条件查询接口

1 parent 550021ef
......@@ -20,7 +20,7 @@ public class SopDataFilterAction {
/**
* 类型
*/
private Integer type;
private String type;
/**
* 圈人方式标识
......
......@@ -12,7 +12,7 @@ public class SopDataActionDTO {
private Integer id;
private String name;
private Integer type;
private String type;
private String dataTypeCode;
private String sql;
private String paramRemark;
......
......@@ -15,5 +15,6 @@ public class SopDataActionSearch {
private List<Integer> ids;
private String type;
private String dataTypeCode;
}
......@@ -23,6 +23,14 @@ public class SopDataService {
public List<SopDataActionDTO> listCondition(SopDataActionSearch search) {
List<SopDataActionDTO> res = sopDataFilterActionMapper.findAll(search);
res.forEach(r -> {
if (StringUtils.hasLength(search.getType())) {
r.setType(search.getType());
}
if (StringUtils.hasLength(search.getDataTypeCode())) {
r.setDataTypeCode(search.getDataTypeCode());
}
});
return res;
}
......
......@@ -44,7 +44,10 @@
</foreach>
</if>
<if test="search.type != null">
a.type = #{search.type}
FIND_IN_SET(#{search.type}, a.type)
</if>
<if test="search.dataTypeCode != null">
FIND_IN_SET(#{search.detaTypeCode}, a.data_type_code)
</if>
</where>
</select>
......
......@@ -56,8 +56,7 @@ public class TestSopService {
@Test
public void testListCondition() {
List<SopDataActionDTO> res = sopDataService.listCondition(SopDataActionSearch.builder().build());
System.out.println(JSON.toJSONString(res));
System.out.println(JSON.toJSONString(sopDataService.listCondition(SopDataActionSearch.builder().type("1").build())));
}
@Test
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!