数据接口
This commit is contained in:
parent
6e1c898eb5
commit
a1b9b2cfb3
|
|
@ -50,4 +50,8 @@ public class PaTypeVo {
|
|||
*/
|
||||
private String remarks;
|
||||
|
||||
private String model;
|
||||
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,4 +51,6 @@ public interface PaTypeMapper {
|
|||
* @return
|
||||
*/
|
||||
int getActByName(PaTypeVo data);
|
||||
|
||||
List<PaTypeVo> findByPage(PaTypeVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class PaTypeServiceImpl implements PaTypeService{
|
|||
}catch (Exception e){
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return ServerResponse.createSuccess();
|
||||
return ServerResponse.createSuccess(list);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -147,12 +147,13 @@ public class PaTypeServiceImpl implements PaTypeService{
|
|||
*/
|
||||
@Override
|
||||
public List<PaTypeVo> findByPage(PaTypeVo data) {
|
||||
List<PaTypeVo> list=new ArrayList<>();
|
||||
try{
|
||||
|
||||
list=mapper.findByPage(data);
|
||||
}catch (Exception e){
|
||||
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
return null;
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -39,4 +39,25 @@
|
|||
and id!=#{id}
|
||||
</if>
|
||||
</select>
|
||||
<!--分页查询 节点数据-->
|
||||
<select id="findByPage" resultType="com.bonus.gzgqj.business.bases.entity.PaTypeVo">
|
||||
select pt.id, pt.parent_id parentId,pt.name model ,pt.num,
|
||||
pt.price,pt.unit,pt.weight,pt.is_consumables ,
|
||||
pt.remarks,pt.is_active ,pt.level,pt.warn_num,pt1.`name` name ,pt2.name type
|
||||
FROM pa_type pt
|
||||
left join pa_type pt1 on pt.parent_id=pt1.id and pt1.`level`=2 and pt1.is_active=1
|
||||
left join pa_type pt2 on pt1.parent_id=pt2.id and pt2.`level`=1 and pt2.is_active=1
|
||||
WHERE pt.is_active=1 and pt.`level`=3
|
||||
<where>
|
||||
<if test="type!=null and type !=''">
|
||||
and pt2.name like concat('%',#{type},'%')
|
||||
</if>
|
||||
<if test="name!=null and name !=''">
|
||||
and pt1.name like concat('%',#{name},'%')
|
||||
</if>
|
||||
<if test="model!=null and model !=''">
|
||||
and pt.name like concat('%',#{model},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue