Commit 77415feb by 林永健

修改条件查询接口

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