产品详情
parent
a93c0588c0
commit
9650d2144e
|
|
@ -58,7 +58,7 @@ public class GoodsController {
|
|||
* 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public R<GoodsEntity> detail(@RequestParam("id") Long id) {
|
||||
public R<SearchGoodsResult> detail(@RequestParam("id") Long id) {
|
||||
return R.success(goodsService.detail(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import org.apache.ibatis.annotations.Param;
|
|||
@Mapper
|
||||
public interface GoodsMapper extends BaseMapper<GoodsEntity> {
|
||||
IPage<SearchGoodsResult> paging(Page<Object> page, @Param("ew") QueryWrapper<Object> ew);
|
||||
|
||||
SearchGoodsResult detail(@Param("ew") QueryWrapper<Object> ew);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public interface GoodsService extends IService<GoodsEntity> {
|
|||
|
||||
void del(List<Long> ids);
|
||||
|
||||
GoodsEntity detail(Long id);
|
||||
SearchGoodsResult detail(Long id);
|
||||
|
||||
PageResult<SearchGoodsResult> paging(PageParam pageParam, GoodsEntity goodsEntity);
|
||||
|
||||
|
|
|
|||
|
|
@ -85,11 +85,8 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, GoodsEntity> impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public GoodsEntity detail(Long id) {
|
||||
GoodsEntity goodsEntity = this.getById(id);
|
||||
goodsEntity.setExpenseItem(expenseItemService.getOne(Wrappers.<ExpenseItemEntity>lambdaQuery()
|
||||
.eq(ExpenseItemEntity::getGoodsId, id)));
|
||||
return this.getById(id);
|
||||
public SearchGoodsResult detail(Long id) {
|
||||
return baseMapper.detail(Wrappers.query().eq("a.id", id));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<result property="goodsScope" column="goods_scope" typeHandler="com.njzscloud.common.mp.support.handler.j.JsonTypeHandler"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
<select id="paging" resultMap="SearchGoodsResultMap">
|
||||
<sql id="SearchGoodsResultSql">
|
||||
SELECT a.id,
|
||||
a.goods_category_id,
|
||||
a.sn,
|
||||
|
|
@ -61,6 +61,15 @@
|
|||
FROM gds_goods a
|
||||
INNER JOIN gds_goods_category b ON a.goods_category_id = b.id
|
||||
LEFT JOIN fin_expense_item c ON c.goods_id = a.id
|
||||
</sql>
|
||||
<select id="paging" resultMap="SearchGoodsResultMap">
|
||||
<include refid="SearchGoodsResultSql"/>
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
<select id="detail" resultMap="SearchGoodsResultMap">
|
||||
<include refid="SearchGoodsResultSql"/>
|
||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
${ew.customSqlSegment}
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue