Browse Source

商品资源

master
xiaoyue 4 years ago
parent
commit
00a53b9320
  1. 9
      src/main/java/cn/chjyj/szwh/mapper/GoodsSourceMapper.java
  2. 10
      src/main/resources/mapper/szwh/GoodsSourceMapper.xml
  3. 36
      src/test/java/cn/chjyj/szwh/mapper/GoodsSourceMapperTest.java

9
src/main/java/cn/chjyj/szwh/mapper/GoodsSourceMapper.java

@ -1,10 +1,19 @@
package cn.chjyj.szwh.mapper;
import cn.chjyj.szwh.bean.GoodsSource;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 商品来源
*/
@Component
public interface GoodsSourceMapper {
/**
* 根据授权编码查询用户信息
* @param goodsIsli
* @return
*/
List<GoodsSource> getGoodsSourceByIsli(String goodsIsli);
}

10
src/main/resources/mapper/szwh/GoodsSourceMapper.xml

@ -16,11 +16,11 @@
<sql id="tbName">goods_source</sql>
<!--查询记录列表-->
<select id="getGoodsList" parameterType="java.lang.Integer" resultType="cn.chjyj.szwh.bean.Goods">
WITH mm as (select * from
<include refid="tbName"/>
where id>#{startRs} limit #{pageSize}
)SELECT * FROM mm ORDER BY id DESC;
<select id="getGoodsSourceByIsli" parameterType="java.lang.String" resultType="cn.chjyj.szwh.bean.GoodsSource">
SELECT <include refid="column"/>
FROM <include refid="tbName"/>
WHERE goods_isli_code=#{goodsIslicode}
AND is_deleted=0
</select>
<!--根据uid查询用户-->

36
src/test/java/cn/chjyj/szwh/mapper/GoodsSourceMapperTest.java

@ -0,0 +1,36 @@
package cn.chjyj.szwh.mapper;
import cn.chjyj.szwh.bean.GoodsSource;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.xml.ws.soap.Addressing;
import java.util.List;
import static org.junit.jupiter.api.Assertions.*;
/**
* author: iege@163.com
* create: 2022/7/18 15:05
* copyright: All Rights Are Reseved (C) xyiege.com
* desc:
*/
@SpringBootTest
@RunWith(SpringRunner.class)
class GoodsSourceMapperTest {
@Autowired
private GoodsSourceMapper goodsSourceMapper;
@Test
void getGoodsSourceByIsli() {
String gisl="010007-00000000187199999999-4";
List<GoodsSource> gslist = goodsSourceMapper.getGoodsSourceByIsli(gisl);
for(GoodsSource gs:gslist){
System.out.println(gs.getRegistrant());
}
}
}
Loading…
Cancel
Save