dev798
parent
197359727b
commit
540c238d39
|
@ -24,16 +24,19 @@ public class TypeController {
|
|||
private TypeService typeService;
|
||||
|
||||
|
||||
@GetMapping("/queryType")
|
||||
@GetMapping("/queryTypeAll")
|
||||
public AjaxResult queryTypeAll(){
|
||||
List<ProductTypeResp>list=typeService.queryTypeAll();
|
||||
List<ProductTypeResp> list =typeService.queryTypeAll();
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 类型所有查询
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/queryTypeAttr/{flag}/{id}")
|
||||
public AjaxResult queryType(@PathVariable Integer flag,@PathVariable Integer id){
|
||||
List<ProductTypeAttr>list=typeService.queryType(flag,id);
|
||||
List<ProductTypeAttr> list =typeService.queryType(flag,id);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.mapper;
|
|||
import com.muyu.product.domain.DTO.ProductTypeAttr;
|
||||
import com.muyu.product.domain.Resp.ProductTypeResp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -16,6 +17,6 @@ public interface TypeMapper {
|
|||
|
||||
List<ProductTypeResp> queryTypeAll();
|
||||
|
||||
List<ProductTypeAttr> queryType();
|
||||
List<ProductTypeAttr> queryType(@Param("flag") Integer flag, @Param("id") Integer id);
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,6 @@ public class TypeServiceImpl implements TypeService {
|
|||
|
||||
@Override
|
||||
public List<ProductTypeAttr> queryType(Integer flag, Integer id) {
|
||||
return typeMapper.queryType();
|
||||
return typeMapper.queryType(flag,id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
type_name,
|
||||
ta.product_type_id,
|
||||
attr_name,
|
||||
MAX(ta.multiple_choice) AS multiple_choice,
|
||||
multiple_choice,
|
||||
ta.input_method,
|
||||
sort,
|
||||
flag,
|
||||
|
@ -37,29 +37,11 @@
|
|||
input,
|
||||
selection,
|
||||
manual_operation,
|
||||
tav.type_attr_id,
|
||||
CAST(GROUP_CONCAT(tav.type_attr_value) AS CHAR) AS typeAttrValue
|
||||
tav.type_attr_id
|
||||
FROM
|
||||
t_product_type t
|
||||
INNER JOIN t_product_type_attr ta ON t.id = ta.product_type_id
|
||||
INNER JOIN t_product_type_attr_value tav ON tav.type_attr_id = ta.id
|
||||
WHERE
|
||||
ta.flag = ? AND t.id = ?
|
||||
GROUP BY
|
||||
type_name,
|
||||
ta.product_type_id,
|
||||
attr_name,
|
||||
ta.input_method,
|
||||
sort,
|
||||
flag,
|
||||
screen,
|
||||
search,
|
||||
association,
|
||||
stats,
|
||||
input,
|
||||
selection,
|
||||
manual_operation,
|
||||
tav.type_attr_id;
|
||||
</select>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue