数据接口

This commit is contained in:
haozq 2024-11-12 11:02:02 +08:00
parent 6e1c898eb5
commit a1b9b2cfb3
4 changed files with 32 additions and 4 deletions

View File

@ -50,4 +50,8 @@ public class PaTypeVo {
*/ */
private String remarks; private String remarks;
private String model;
private String type;
} }

View File

@ -51,4 +51,6 @@ public interface PaTypeMapper {
* @return * @return
*/ */
int getActByName(PaTypeVo data); int getActByName(PaTypeVo data);
List<PaTypeVo> findByPage(PaTypeVo data);
} }

View File

@ -33,7 +33,7 @@ public class PaTypeServiceImpl implements PaTypeService{
}catch (Exception e){ }catch (Exception e){
log.error(e.toString(),e); log.error(e.toString(),e);
} }
return ServerResponse.createSuccess(); return ServerResponse.createSuccess(list);
} }
/** /**
@ -147,12 +147,13 @@ public class PaTypeServiceImpl implements PaTypeService{
*/ */
@Override @Override
public List<PaTypeVo> findByPage(PaTypeVo data) { public List<PaTypeVo> findByPage(PaTypeVo data) {
List<PaTypeVo> list=new ArrayList<>();
try{ try{
list=mapper.findByPage(data);
}catch (Exception e){ }catch (Exception e){
log.error(e.toString(),e);
} }
return null; return list;
} }

View File

@ -39,4 +39,25 @@
and id!=#{id} and id!=#{id}
</if> </if>
</select> </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> </mapper>