| | |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | Object nodeId = param.get("node_id"); |
| | | if (Cools.isEmpty(nodeId)) { |
| | | nodeId = getOriginNode().getId(); |
| | | } |
| | | return R.ok(locDetlService.getPage(new Page<>(curr, limit) |
| | | , String.valueOf(nodeId) |
| | | , param.get("loc_no") |
| | | , param.get("matnr") |
| | | , param.get("maktx")) |
| | | ); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | // EntityWrapper<Mat> wrapper = new EntityWrapper<>(); |
| | | // excludeTrash(param); |
| | | // convert(param, wrapper); |
| | | // if (!Cools.isEmpty(orderByField)){ |
| | | // wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | // } |
| | | // Page<Mat> page = matService.selectPage(new Page<>(curr, limit), wrapper); |
| | | // |
| | | // return R.ok().add(page); |
| | | Object tagId = param.get("tag_id"); |
| | | if (Cools.isEmpty(tagId)) { |
| | | tagId = getOriginTag().getId(); |
| | |
| | | package zy.cloud.wms.manager.mapper; |
| | | |
| | | import zy.cloud.wms.manager.entity.LocDetl; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | import zy.cloud.wms.manager.entity.LocDetl; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface LocDetlMapper extends BaseMapper<LocDetl> { |
| | | |
| | | List<LocDetl> listByPage(Page page, @Param("nodeId") String nodeId, @Param("locNo") Object locNo, @Param("matnr") Object matnr, @Param("maktx") Object maktx); |
| | | |
| | | } |
| | |
| | | package zy.cloud.wms.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import zy.cloud.wms.manager.entity.LocDetl; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | public interface LocDetlService extends IService<LocDetl> { |
| | | |
| | | Page<LocDetl> getPage(Page page, String nodeId, Object locNo, Object matnr, Object maktx); |
| | | |
| | | } |
| | |
| | | package zy.cloud.wms.manager.service.impl; |
| | | |
| | | import zy.cloud.wms.manager.mapper.LocDetlMapper; |
| | | import zy.cloud.wms.manager.entity.LocDetl; |
| | | import zy.cloud.wms.manager.service.LocDetlService; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import zy.cloud.wms.manager.entity.LocDetl; |
| | | import zy.cloud.wms.manager.mapper.LocDetlMapper; |
| | | import zy.cloud.wms.manager.service.LocDetlService; |
| | | |
| | | @Service("locDetlService") |
| | | public class LocDetlServiceImpl extends ServiceImpl<LocDetlMapper, LocDetl> implements LocDetlService { |
| | | |
| | | @Override |
| | | public Page<LocDetl> getPage(Page page, String nodeId, Object locNo, Object matnr, Object maktx) { |
| | | return page.setRecords(baseMapper.listByPage(page, nodeId, locNo, matnr, maktx)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | mapper-locations: classpath:mapper/*.xml |
| | | # global-config: |
| | | # field-strategy: 0 |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | logging: |
| | | path: /stock/out/logs |
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="listByPage" resultMap="BaseResultMap"> |
| | | SELECT |
| | | mld.* |
| | | FROM man_loc_detl mld |
| | | LEFT JOIN man_node mn ON mld.node_id = mn.id |
| | | WHERE 1=1 |
| | | AND (CHARINDEX(#{nodeId}, ','+mn.path+',') > 0 OR mn.id = #{nodeId}) |
| | | <if test="locNo != null and locNo != ''"> |
| | | and mld.loc_no like concat('%',#{locNo},'%') |
| | | </if> |
| | | <if test="matnr != null and matnr != ''"> |
| | | and mld.matnr like concat('%',#{matnr},'%') |
| | | </if> |
| | | <if test="maktx != null and maktx != ''"> |
| | | and mld.maktx like concat('%',#{maktx},'%') |
| | | </if> |
| | | ORDER BY mld.create_time DESC |
| | | </select> |
| | | |
| | | </mapper> |