Commit 93185c90 by tyfanchz

修改:产品类型列表获取

1 parent a9fa8dea
...@@ -26,6 +26,12 @@ import lombok.Data; ...@@ -26,6 +26,12 @@ import lombok.Data;
@Table(name = "smart_product_type") @Table(name = "smart_product_type")
public class SmartProductType extends BaseDTO { public class SmartProductType extends BaseDTO {
/** /**
* 一级分类
*/
@Transient
private String firstCategory;
/**
* 内容列表 * 内容列表
*/ */
@Transient @Transient
......
...@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Enumeration; import java.util.Enumeration;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
...@@ -47,7 +48,7 @@ public class CorsFilter implements Filter { ...@@ -47,7 +48,7 @@ public class CorsFilter implements Filter {
httpResponse.addHeader(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "18000L"); httpResponse.addHeader(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "18000L");
// 放行预检请求(preflight requests) // 放行预检请求(preflight requests)
if (httpRequest.getMethod().equalsIgnoreCase("OPTIONS")) { if (httpRequest.getMethod().equalsIgnoreCase(HttpMethod.OPTIONS.toString())) {
httpResponse.setStatus(HttpServletResponse.SC_OK); httpResponse.setStatus(HttpServletResponse.SC_OK);
httpResponse.getWriter().println("OK"); httpResponse.getWriter().println("OK");
return; return;
......
...@@ -33,8 +33,10 @@ ...@@ -33,8 +33,10 @@
<select id="getList" resultMap="BaseResultMap"> <select id="getList" resultMap="BaseResultMap">
select spt.id, spt.type_name, spt.category_key, spt.shop_tag, spt.remark, spt.create_time, select spt.id, spt.type_name, spt.category_key, spt.shop_tag, spt.remark, spt.create_time,
spt.create_by, spt.update_time, spt.update_by spt.create_by, spt.update_time, spt.update_by,
ssc.parent_key firstCategory
from smart_product_type spt from smart_product_type spt
left join smart_sys_code ssc on ssc.dict_key = spt.category_key
<where> <where>
<if test="typeName != null and typeName != ''"> <if test="typeName != null and typeName != ''">
and spt.type_name like concat('%', #{typeName,jdbcType=VARCHAR}, '%') and spt.type_name like concat('%', #{typeName,jdbcType=VARCHAR}, '%')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!