| | |
| | | if (Cools.isEmpty(tagId)) { |
| | | tagId = getOriginTag().getId(); |
| | | } |
| | | return R.ok(matService.getPage(new Page<>(curr, limit) |
| | | return R.ok(matService.getPage2(new Page<>(curr, limit) |
| | | , String.valueOf(tagId) |
| | | , param.get("matnr") |
| | | , param.get("maktx")) |
| | | , param.get("maktx") |
| | | , param.get("specs")) |
| | | ); |
| | | |
| | | } |
| | |
| | | public interface MatMapper extends BaseMapper<Mat> { |
| | | |
| | | List<Mat> listByPage(Page page, @Param("tagId") String tagId, @Param("matnr") Object matnr, @Param("maktx") Object maktx); |
| | | List<Mat> listByPage2(Page page, @Param("tagId") String tagId, @Param("matnr") Object matnr, @Param("maktx") Object maktx, @Param("specs") Object specs); |
| | | |
| | | Mat selectByMatnr(@Param("matnr")String matnr); |
| | | |
| | |
| | | public interface MatService extends IService<Mat> { |
| | | |
| | | Page<Mat> getPage(Page page, String tagId, Object matnr, Object maktx); |
| | | Page<Mat> getPage2(Page page, String tagId, Object matnr, Object maktx, Object specs); |
| | | |
| | | Mat selectByMatnr(String matnr); |
| | | |
| | |
| | | public Page<Mat> getPage(Page page, String tagId, Object matnr, Object maktx) { |
| | | return page.setRecords(baseMapper.listByPage(page, tagId, matnr, maktx)); |
| | | } |
| | | @Override |
| | | public Page<Mat> getPage2(Page page, String tagId, Object matnr, Object maktx, Object specs) { |
| | | return page.setRecords(baseMapper.listByPage2(page, tagId, matnr, maktx, specs)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | ORDER BY mm.create_time DESC |
| | | </select> |
| | | |
| | | <select id="listByPage2" resultMap="BaseResultMap"> |
| | | SELECT |
| | | isnull(mld.amount,0) as stock, |
| | | mm.* |
| | | FROM man_mat mm |
| | | LEFT JOIN man_tag mt ON mm.tag_id = mt.id |
| | | LEFT JOIN ( |
| | | select |
| | | matnr, |
| | | sum(anfme) as amount |
| | | from man_loc_detl |
| | | group by matnr |
| | | ) as mld on mld.matnr = mm.matnr |
| | | WHERE 1=1 |
| | | and (mm.memo is null or mm.memo != '打包上线') |
| | | AND (CHARINDEX(','+#{tagId}+',', ','+mt.path+',') > 0 OR mt.id = #{tagId}) |
| | | <if test="matnr != null and matnr != ''"> |
| | | and mm.matnr like concat('%',#{matnr},'%') |
| | | </if> |
| | | <if test="maktx != null and maktx != ''"> |
| | | and mm.maktx like concat('%',#{maktx},'%') |
| | | </if> |
| | | <if test="specs != null and specs != ''"> |
| | | and mm.specs like concat('%',#{specs},'%') |
| | | </if> |
| | | ORDER BY mm.create_time DESC |
| | | </select> |
| | | |
| | | <select id="selectByMatnr" resultMap="BaseResultMap"> |
| | | select top 1 * from man_mat where 1=1 and matnr = #{matnr} |
| | | </select> |
| | |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="specs" placeholder="规格" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline">--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <input class="layui-input" type="text" name="row" placeholder="排数" autocomplete="off">--> |