dev798
parent
73c40ddbad
commit
cec44c36d3
|
@ -25,8 +25,11 @@ public class TypeController {
|
||||||
|
|
||||||
@GetMapping("/queryType")
|
@GetMapping("/queryType")
|
||||||
public AjaxResult queryType(){
|
public AjaxResult queryType(){
|
||||||
List<ProductTypeResp>list=typeService.queryType();
|
List<ProductTypeResp>list=typeService.queryTypeAll();
|
||||||
return AjaxResult.success(list);
|
return AjaxResult.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,5 +12,8 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TypeMapper {
|
public interface TypeMapper {
|
||||||
List<ProductTypeResp> queryType();
|
|
||||||
|
|
||||||
|
List<ProductTypeResp> queryTypeAll();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import java.util.List;
|
||||||
* @Date: 2024/4/1 11:15
|
* @Date: 2024/4/1 11:15
|
||||||
*/
|
*/
|
||||||
public interface TypeService {
|
public interface TypeService {
|
||||||
List<ProductTypeResp> queryType();
|
|
||||||
|
|
||||||
|
|
||||||
|
List<ProductTypeResp> queryTypeAll();
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,8 +18,10 @@ public class TypeServiceImpl implements TypeService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TypeMapper typeMapper;
|
private TypeMapper typeMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ProductTypeResp> queryType() {
|
public List<ProductTypeResp> queryTypeAll() {
|
||||||
return typeMapper.queryType();
|
return typeMapper.queryTypeAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,16 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.muyu.product.mapper.TypeMapper">
|
<mapper namespace="com.muyu.product.mapper.TypeMapper">
|
||||||
|
|
||||||
|
|
||||||
<select id="queryType" resultType="com.muyu.product.domain.Resp.ProductTypeResp">
|
|
||||||
|
<!-- 添加其他操作方法如插入、更新、删除等 -->
|
||||||
|
<select id="queryTypeAll" resultType="com.muyu.product.domain.Resp.ProductTypeResp">
|
||||||
SELECT
|
SELECT
|
||||||
t.id,
|
t.id,
|
||||||
type_name,
|
type_name,
|
||||||
ta.product_type_id,
|
|
||||||
attr_name,
|
|
||||||
multiple_choice,
|
|
||||||
ta.input_method,
|
|
||||||
sort,
|
|
||||||
flag,
|
|
||||||
screen,
|
|
||||||
search,
|
|
||||||
association,
|
|
||||||
stats,
|
|
||||||
input,
|
|
||||||
selection,
|
|
||||||
manual_operation,
|
|
||||||
tav.type_attr_id,
|
|
||||||
GROUP_CONCAT(tav.type_attr_value) as typeAttrValue,
|
|
||||||
(SELECT COUNT(id) FROM t_product_type_attr WHERE flag = 0 AND product_type_id = t.id) AS countNum,
|
(SELECT COUNT(id) FROM t_product_type_attr WHERE flag = 0 AND product_type_id = t.id) AS countNum,
|
||||||
(SELECT COUNT(id) FROM t_product_type_attr WHERE flag = 1 AND product_type_id = t.id) AS countParam
|
(SELECT COUNT(id) FROM t_product_type_attr WHERE flag = 1 AND product_type_id = t.id) AS countParam
|
||||||
FROM
|
FROM
|
||||||
|
@ -31,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
INNER JOIN t_product_type_attr ta ON t.id = ta.product_type_id
|
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
|
INNER JOIN t_product_type_attr_value tav ON tav.type_attr_id = ta.id
|
||||||
GROUP BY
|
GROUP BY
|
||||||
ta.attr_name
|
t.id, type_name;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue