"src/main/git@ustchcs.com:gujinli1118/JSH_ERP.git" did not exist on "92d6c587702c64ec983b5f0bb290c5dacbc00478"
Commit 2f52c6b8 authored by zhh's avatar zhh
Browse files

支持跨域调用及登录功能完善

parent eb667afd
package com.macro.mall.component;
import com.macro.mall.dto.CommonResult;
import com.macro.mall.util.JsonUtil;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.AuthenticationEntryPoint;
import org.springframework.stereotype.Component;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* 当未登录或者token失效访问接口时,自定义的返回结果
* Created by macro on 2018/5/14.
*/
@Component
public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint {
@Override
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException {
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json");
response.getWriter().println(JsonUtil.objectToJson(new CommonResult().unauthorized(authException.getMessage())));
response.getWriter().flush();
}
}
...@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
/** /**
* 用于Rest请求是返回自定义错误信息 * 当访问接口没有权限时,自定义的返回结果
* Created by macro on 2018/4/26. * Created by macro on 2018/4/26.
*/ */
@Component @Component
...@@ -21,7 +21,9 @@ public class RestfulAccessDeniedHandler implements AccessDeniedHandler{ ...@@ -21,7 +21,9 @@ public class RestfulAccessDeniedHandler implements AccessDeniedHandler{
public void handle(HttpServletRequest request, public void handle(HttpServletRequest request,
HttpServletResponse response, HttpServletResponse response,
AccessDeniedException e) throws IOException, ServletException { AccessDeniedException e) throws IOException, ServletException {
response.setStatus(HttpServletResponse.SC_FORBIDDEN); response.setCharacterEncoding("UTF-8");
response.getWriter().println(JsonUtil.objectToJson(new CommonResult().authFailed(e.getMessage()))); response.setContentType("application/json");
response.getWriter().println(JsonUtil.objectToJson(new CommonResult().forbidden(e.getMessage())));
response.getWriter().flush();
} }
} }
...@@ -2,10 +2,12 @@ package com.macro.mall.config; ...@@ -2,10 +2,12 @@ package com.macro.mall.config;
import com.macro.mall.bo.AdminUserDetails; import com.macro.mall.bo.AdminUserDetails;
import com.macro.mall.component.JwtAuthenticationTokenFilter; import com.macro.mall.component.JwtAuthenticationTokenFilter;
import com.macro.mall.component.RestAuthenticationEntryPoint;
import com.macro.mall.component.RestfulAccessDeniedHandler; import com.macro.mall.component.RestfulAccessDeniedHandler;
import com.macro.mall.model.UmsAdmin; import com.macro.mall.model.UmsAdmin;
import com.macro.mall.service.UmsAdminService; import com.macro.mall.service.UmsAdminService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
...@@ -21,6 +23,9 @@ import org.springframework.security.core.userdetails.UserDetailsService; ...@@ -21,6 +23,9 @@ import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.web.access.AccessDeniedHandler; import org.springframework.security.web.access.AccessDeniedHandler;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
/** /**
...@@ -32,6 +37,10 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic ...@@ -32,6 +37,10 @@ import org.springframework.security.web.authentication.UsernamePasswordAuthentic
public class SecurityConfig extends WebSecurityConfigurerAdapter { public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired @Autowired
private UmsAdminService adminService; private UmsAdminService adminService;
@Autowired
private RestfulAccessDeniedHandler restfulAccessDeniedHandler;
@Autowired
private RestAuthenticationEntryPoint restAuthenticationEntryPoint;
@Override @Override
protected void configure(HttpSecurity httpSecurity) throws Exception { protected void configure(HttpSecurity httpSecurity) throws Exception {
...@@ -52,16 +61,22 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -52,16 +61,22 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
"/v2/api-docs/**" "/v2/api-docs/**"
) )
.permitAll() .permitAll()
.antMatchers("/admin/**")// 对于获取token的rest api要允许匿名访问 .antMatchers("/admin/login", "/admin/register")// 对登录注册要允许匿名访问
.permitAll() .permitAll()
.antMatchers("/**")//测试时全部运行访问 .antMatchers(HttpMethod.OPTIONS)//跨域请求会先进行一次options请求
.permitAll() .permitAll()
// .antMatchers("/**")//测试时全部运行访问
// .permitAll()
.anyRequest()// 除上面外的所有请求全部需要鉴权认证 .anyRequest()// 除上面外的所有请求全部需要鉴权认证
.authenticated(); .authenticated();
// 禁用缓存 // 禁用缓存
httpSecurity.headers().cacheControl(); httpSecurity.headers().cacheControl();
// 添加JWT filter // 添加JWT filter
httpSecurity.addFilterBefore(jwtAuthenticationTokenFilter(), UsernamePasswordAuthenticationFilter.class); httpSecurity.addFilterBefore(jwtAuthenticationTokenFilter(), UsernamePasswordAuthenticationFilter.class);
//添加自定义未授权和未登录结果返回
httpSecurity.exceptionHandling()
.accessDeniedHandler(restfulAccessDeniedHandler)
.authenticationEntryPoint(restAuthenticationEntryPoint);
} }
@Override @Override
...@@ -95,4 +110,21 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -95,4 +110,21 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
return new JwtAuthenticationTokenFilter(); return new JwtAuthenticationTokenFilter();
} }
/**
* 允许跨域调用的过滤器
*/
@Bean
public FilterRegistrationBean corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new CorsConfiguration();
config.addAllowedOrigin("*");
config.setAllowCredentials(true);
config.addAllowedHeader("*");
config.addAllowedMethod("*");
source.registerCorsConfiguration("/**", config);
FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
bean.setOrder(0);
return bean;
}
} }
...@@ -9,6 +9,8 @@ import io.swagger.annotations.Api; ...@@ -9,6 +9,8 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -17,6 +19,9 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -17,6 +19,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.security.Principal;
import java.util.HashMap;
import java.util.Map;
/** /**
* 后台用户管理 * 后台用户管理
...@@ -28,8 +33,12 @@ import javax.servlet.http.HttpServletRequest; ...@@ -28,8 +33,12 @@ import javax.servlet.http.HttpServletRequest;
public class UmsAdminController { public class UmsAdminController {
@Autowired @Autowired
private UmsAdminService adminService; private UmsAdminService adminService;
@Autowired
private UserDetailsService userDetailsService;
@Value("${jwt.tokenHeader}") @Value("${jwt.tokenHeader}")
private String tokenHeader; private String tokenHeader;
@Value("${jwt.tokenHead}")
private String tokenHead;
@ApiOperation(value = "用户注册") @ApiOperation(value = "用户注册")
@RequestMapping(value = "/register", method = RequestMethod.POST) @RequestMapping(value = "/register", method = RequestMethod.POST)
...@@ -50,7 +59,10 @@ public class UmsAdminController { ...@@ -50,7 +59,10 @@ public class UmsAdminController {
if (token == null) { if (token == null) {
return new CommonResult().validateFailed("用户名或密码错误"); return new CommonResult().validateFailed("用户名或密码错误");
} }
return new CommonResult().success(token); Map<String,String> tokenMap = new HashMap<>();
tokenMap.put("token",token);
tokenMap.put("tokenHead",tokenHead);
return new CommonResult().success(tokenMap);
} }
@ApiOperation(value = "刷新token") @ApiOperation(value = "刷新token")
...@@ -62,6 +74,28 @@ public class UmsAdminController { ...@@ -62,6 +74,28 @@ public class UmsAdminController {
if (refreshToken == null) { if (refreshToken == null) {
return new CommonResult().failed(); return new CommonResult().failed();
} }
return new CommonResult().success(token); Map<String,String> tokenMap = new HashMap<>();
tokenMap.put("token",token);
tokenMap.put("tokenHead",tokenHead);
return new CommonResult().success(tokenMap);
}
@ApiOperation(value = "获取用户信息")
@RequestMapping(value = "/info",method = RequestMethod.GET)
@ResponseBody
public Object getAdminInfo(Principal principal){
String username = principal.getName();
UmsAdmin umsAdmin = adminService.getAdminByUsername(username);
Map<String,Object> data = new HashMap<>();
data.put("username",umsAdmin.getUsername());
data.put("roles",new String[]{"TEST"});
data.put("icon",umsAdmin.getIcon());
return new CommonResult().success(data);
}
@ApiOperation(value = "登出功能")
@RequestMapping(value = "/logout",method = RequestMethod.POST)
@ResponseBody
public Object logout(){
return new CommonResult().success(null);
} }
} }
...@@ -14,13 +14,15 @@ import java.util.Map; ...@@ -14,13 +14,15 @@ import java.util.Map;
*/ */
public class CommonResult { public class CommonResult {
//操作成功 //操作成功
public static final int SUCCESS = 0; public static final int SUCCESS = 200;
//操作失败 //操作失败
public static final int FAILED = 1; public static final int FAILED = 500;
//参数校验失败 //参数校验失败
public static final int VALIDATE_FAILED = 2; public static final int VALIDATE_FAILED = 404;
//认证失败 //未认证
public static final int AUTHENTICATE_FAILED = 3; public static final int UNAUTHORIZED = 401;
//未授权
public static final int FORBIDDEN = 403;
private int code; private int code;
private String message; private String message;
private Object data; private Object data;
...@@ -75,13 +77,25 @@ public class CommonResult { ...@@ -75,13 +77,25 @@ public class CommonResult {
} }
/** /**
* 参数验证失败使用 * 未登录时使用
*
* @param message 错误信息
*/
public CommonResult unauthorized(String message) {
this.code = UNAUTHORIZED;
this.message = "暂未登录或token已经过期";
this.data = message;
return this;
}
/**
* 未授权时使用
* *
* @param message 错误信息 * @param message 错误信息
*/ */
public CommonResult authFailed(String message) { public CommonResult forbidden(String message) {
this.code = AUTHENTICATE_FAILED; this.code = FORBIDDEN;
this.message = "认证失败"; this.message = "没有相关权限";
this.data = message; this.data = message;
return this; return this;
} }
......
...@@ -223,448 +223,4 @@ ...@@ -223,448 +223,4 @@
sort = #{sort,jdbcType=INTEGER} sort = #{sort,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsHelpCategory">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="help_count" jdbcType="INTEGER" property="helpCount" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
<result column="sort" jdbcType="INTEGER" property="sort" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, icon, help_count, show_status, sort
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsHelpCategoryExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_help_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_help_category
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_help_category
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsHelpCategoryExample">
delete from cms_help_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsHelpCategory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_help_category (name, icon, help_count,
show_status, sort)
values (#{name,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{helpCount,jdbcType=INTEGER},
#{showStatus,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsHelpCategory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_help_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="icon != null">
icon,
</if>
<if test="helpCount != null">
help_count,
</if>
<if test="showStatus != null">
show_status,
</if>
<if test="sort != null">
sort,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="helpCount != null">
#{helpCount,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsHelpCategoryExample" resultType="java.lang.Integer">
select count(*) from cms_help_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_help_category
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.icon != null">
icon = #{record.icon,jdbcType=VARCHAR},
</if>
<if test="record.helpCount != null">
help_count = #{record.helpCount,jdbcType=INTEGER},
</if>
<if test="record.showStatus != null">
show_status = #{record.showStatus,jdbcType=INTEGER},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_help_category
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
icon = #{record.icon,jdbcType=VARCHAR},
help_count = #{record.helpCount,jdbcType=INTEGER},
show_status = #{record.showStatus,jdbcType=INTEGER},
sort = #{record.sort,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsHelpCategory">
update cms_help_category
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="helpCount != null">
help_count = #{helpCount,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsHelpCategory">
update cms_help_category
set name = #{name,jdbcType=VARCHAR},
icon = #{icon,jdbcType=VARCHAR},
help_count = #{helpCount,jdbcType=INTEGER},
show_status = #{showStatus,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsHelpCategory">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="help_count" jdbcType="INTEGER" property="helpCount" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
<result column="sort" jdbcType="INTEGER" property="sort" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, icon, help_count, show_status, sort
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsHelpCategoryExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_help_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_help_category
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_help_category
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsHelpCategoryExample">
delete from cms_help_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsHelpCategory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_help_category (name, icon, help_count,
show_status, sort)
values (#{name,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{helpCount,jdbcType=INTEGER},
#{showStatus,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsHelpCategory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_help_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="icon != null">
icon,
</if>
<if test="helpCount != null">
help_count,
</if>
<if test="showStatus != null">
show_status,
</if>
<if test="sort != null">
sort,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="helpCount != null">
#{helpCount,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsHelpCategoryExample" resultType="java.lang.Integer">
select count(*) from cms_help_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_help_category
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.icon != null">
icon = #{record.icon,jdbcType=VARCHAR},
</if>
<if test="record.helpCount != null">
help_count = #{record.helpCount,jdbcType=INTEGER},
</if>
<if test="record.showStatus != null">
show_status = #{record.showStatus,jdbcType=INTEGER},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_help_category
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
icon = #{record.icon,jdbcType=VARCHAR},
help_count = #{record.helpCount,jdbcType=INTEGER},
show_status = #{record.showStatus,jdbcType=INTEGER},
sort = #{record.sort,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsHelpCategory">
update cms_help_category
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="helpCount != null">
help_count = #{helpCount,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsHelpCategory">
update cms_help_category
set name = #{name,jdbcType=VARCHAR},
icon = #{icon,jdbcType=VARCHAR},
help_count = #{helpCount,jdbcType=INTEGER},
show_status = #{showStatus,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -208,418 +208,4 @@ ...@@ -208,418 +208,4 @@
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsMemberReport">
<result column="id" jdbcType="BIGINT" property="id" />
<result column="report_type" jdbcType="INTEGER" property="reportType" />
<result column="report_member_name" jdbcType="VARCHAR" property="reportMemberName" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="report_object" jdbcType="VARCHAR" property="reportObject" />
<result column="report_status" jdbcType="INTEGER" property="reportStatus" />
<result column="handle_status" jdbcType="INTEGER" property="handleStatus" />
<result column="note" jdbcType="VARCHAR" property="note" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, report_type, report_member_name, create_time, report_object, report_status, handle_status,
note
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsMemberReportExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_member_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsMemberReportExample">
delete from cms_member_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsMemberReport">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_member_report (report_type, report_member_name, create_time,
report_object, report_status, handle_status,
note)
values (#{reportType,jdbcType=INTEGER}, #{reportMemberName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{reportObject,jdbcType=VARCHAR}, #{reportStatus,jdbcType=INTEGER}, #{handleStatus,jdbcType=INTEGER},
#{note,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsMemberReport">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_member_report
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reportType != null">
report_type,
</if>
<if test="reportMemberName != null">
report_member_name,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="reportObject != null">
report_object,
</if>
<if test="reportStatus != null">
report_status,
</if>
<if test="handleStatus != null">
handle_status,
</if>
<if test="note != null">
note,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportType != null">
#{reportType,jdbcType=INTEGER},
</if>
<if test="reportMemberName != null">
#{reportMemberName,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="reportObject != null">
#{reportObject,jdbcType=VARCHAR},
</if>
<if test="reportStatus != null">
#{reportStatus,jdbcType=INTEGER},
</if>
<if test="handleStatus != null">
#{handleStatus,jdbcType=INTEGER},
</if>
<if test="note != null">
#{note,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsMemberReportExample" resultType="java.lang.Integer">
select count(*) from cms_member_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_member_report
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.reportType != null">
report_type = #{record.reportType,jdbcType=INTEGER},
</if>
<if test="record.reportMemberName != null">
report_member_name = #{record.reportMemberName,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.reportObject != null">
report_object = #{record.reportObject,jdbcType=VARCHAR},
</if>
<if test="record.reportStatus != null">
report_status = #{record.reportStatus,jdbcType=INTEGER},
</if>
<if test="record.handleStatus != null">
handle_status = #{record.handleStatus,jdbcType=INTEGER},
</if>
<if test="record.note != null">
note = #{record.note,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_member_report
set id = #{record.id,jdbcType=BIGINT},
report_type = #{record.reportType,jdbcType=INTEGER},
report_member_name = #{record.reportMemberName,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
report_object = #{record.reportObject,jdbcType=VARCHAR},
report_status = #{record.reportStatus,jdbcType=INTEGER},
handle_status = #{record.handleStatus,jdbcType=INTEGER},
note = #{record.note,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsMemberReport">
<result column="id" jdbcType="BIGINT" property="id" />
<result column="report_type" jdbcType="INTEGER" property="reportType" />
<result column="report_member_name" jdbcType="VARCHAR" property="reportMemberName" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="report_object" jdbcType="VARCHAR" property="reportObject" />
<result column="report_status" jdbcType="INTEGER" property="reportStatus" />
<result column="handle_status" jdbcType="INTEGER" property="handleStatus" />
<result column="note" jdbcType="VARCHAR" property="note" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, report_type, report_member_name, create_time, report_object, report_status, handle_status,
note
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsMemberReportExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_member_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsMemberReportExample">
delete from cms_member_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsMemberReport">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_member_report (report_type, report_member_name, create_time,
report_object, report_status, handle_status,
note)
values (#{reportType,jdbcType=INTEGER}, #{reportMemberName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{reportObject,jdbcType=VARCHAR}, #{reportStatus,jdbcType=INTEGER}, #{handleStatus,jdbcType=INTEGER},
#{note,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsMemberReport">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_member_report
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="reportType != null">
report_type,
</if>
<if test="reportMemberName != null">
report_member_name,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="reportObject != null">
report_object,
</if>
<if test="reportStatus != null">
report_status,
</if>
<if test="handleStatus != null">
handle_status,
</if>
<if test="note != null">
note,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="reportType != null">
#{reportType,jdbcType=INTEGER},
</if>
<if test="reportMemberName != null">
#{reportMemberName,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="reportObject != null">
#{reportObject,jdbcType=VARCHAR},
</if>
<if test="reportStatus != null">
#{reportStatus,jdbcType=INTEGER},
</if>
<if test="handleStatus != null">
#{handleStatus,jdbcType=INTEGER},
</if>
<if test="note != null">
#{note,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsMemberReportExample" resultType="java.lang.Integer">
select count(*) from cms_member_report
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_member_report
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.reportType != null">
report_type = #{record.reportType,jdbcType=INTEGER},
</if>
<if test="record.reportMemberName != null">
report_member_name = #{record.reportMemberName,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.reportObject != null">
report_object = #{record.reportObject,jdbcType=VARCHAR},
</if>
<if test="record.reportStatus != null">
report_status = #{record.reportStatus,jdbcType=INTEGER},
</if>
<if test="record.handleStatus != null">
handle_status = #{record.handleStatus,jdbcType=INTEGER},
</if>
<if test="record.note != null">
note = #{record.note,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_member_report
set id = #{record.id,jdbcType=BIGINT},
report_type = #{record.reportType,jdbcType=INTEGER},
report_member_name = #{record.reportMemberName,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
report_object = #{record.reportObject,jdbcType=VARCHAR},
report_status = #{record.reportStatus,jdbcType=INTEGER},
handle_status = #{record.handleStatus,jdbcType=INTEGER},
note = #{record.note,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -265,532 +265,4 @@ ...@@ -265,532 +265,4 @@
show_status = #{showStatus,jdbcType=INTEGER} show_status = #{showStatus,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsPrefrenceArea">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.macro.mall.model.CmsPrefrenceArea">
<result column="pic" jdbcType="VARBINARY" property="pic" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, sub_title, sort, show_status
</sql>
<sql id="Blob_Column_List">
pic
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.macro.mall.model.CmsPrefrenceAreaExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_prefrence_area
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_prefrence_area
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_prefrence_area
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_prefrence_area
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaExample">
delete from cms_prefrence_area
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsPrefrenceArea">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_prefrence_area (name, sub_title, sort,
show_status, pic)
values (#{name,jdbcType=VARCHAR}, #{subTitle,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{showStatus,jdbcType=INTEGER}, #{pic,jdbcType=VARBINARY})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsPrefrenceArea">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_prefrence_area
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="subTitle != null">
sub_title,
</if>
<if test="sort != null">
sort,
</if>
<if test="showStatus != null">
show_status,
</if>
<if test="pic != null">
pic,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="subTitle != null">
#{subTitle,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
<if test="pic != null">
#{pic,jdbcType=VARBINARY},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaExample" resultType="java.lang.Integer">
select count(*) from cms_prefrence_area
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_prefrence_area
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.subTitle != null">
sub_title = #{record.subTitle,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.showStatus != null">
show_status = #{record.showStatus,jdbcType=INTEGER},
</if>
<if test="record.pic != null">
pic = #{record.pic,jdbcType=VARBINARY},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update cms_prefrence_area
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
sub_title = #{record.subTitle,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
show_status = #{record.showStatus,jdbcType=INTEGER},
pic = #{record.pic,jdbcType=VARBINARY}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_prefrence_area
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
sub_title = #{record.subTitle,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
show_status = #{record.showStatus,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsPrefrenceArea">
update cms_prefrence_area
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="subTitle != null">
sub_title = #{subTitle,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
<if test="pic != null">
pic = #{pic,jdbcType=VARBINARY},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.macro.mall.model.CmsPrefrenceArea">
update cms_prefrence_area
set name = #{name,jdbcType=VARCHAR},
sub_title = #{subTitle,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
show_status = #{showStatus,jdbcType=INTEGER},
pic = #{pic,jdbcType=VARBINARY}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsPrefrenceArea">
update cms_prefrence_area
set name = #{name,jdbcType=VARCHAR},
sub_title = #{subTitle,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
show_status = #{showStatus,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsPrefrenceArea">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="sub_title" jdbcType="VARCHAR" property="subTitle" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.macro.mall.model.CmsPrefrenceArea">
<result column="pic" jdbcType="VARBINARY" property="pic" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, sub_title, sort, show_status
</sql>
<sql id="Blob_Column_List">
pic
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.macro.mall.model.CmsPrefrenceAreaExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_prefrence_area
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_prefrence_area
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from cms_prefrence_area
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_prefrence_area
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaExample">
delete from cms_prefrence_area
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsPrefrenceArea">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_prefrence_area (name, sub_title, sort,
show_status, pic)
values (#{name,jdbcType=VARCHAR}, #{subTitle,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{showStatus,jdbcType=INTEGER}, #{pic,jdbcType=VARBINARY})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsPrefrenceArea">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_prefrence_area
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="subTitle != null">
sub_title,
</if>
<if test="sort != null">
sort,
</if>
<if test="showStatus != null">
show_status,
</if>
<if test="pic != null">
pic,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="subTitle != null">
#{subTitle,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
<if test="pic != null">
#{pic,jdbcType=VARBINARY},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaExample" resultType="java.lang.Integer">
select count(*) from cms_prefrence_area
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_prefrence_area
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.subTitle != null">
sub_title = #{record.subTitle,jdbcType=VARCHAR},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
<if test="record.showStatus != null">
show_status = #{record.showStatus,jdbcType=INTEGER},
</if>
<if test="record.pic != null">
pic = #{record.pic,jdbcType=VARBINARY},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update cms_prefrence_area
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
sub_title = #{record.subTitle,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
show_status = #{record.showStatus,jdbcType=INTEGER},
pic = #{record.pic,jdbcType=VARBINARY}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_prefrence_area
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
sub_title = #{record.subTitle,jdbcType=VARCHAR},
sort = #{record.sort,jdbcType=INTEGER},
show_status = #{record.showStatus,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsPrefrenceArea">
update cms_prefrence_area
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="subTitle != null">
sub_title = #{subTitle,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
<if test="pic != null">
pic = #{pic,jdbcType=VARBINARY},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.macro.mall.model.CmsPrefrenceArea">
update cms_prefrence_area
set name = #{name,jdbcType=VARCHAR},
sub_title = #{subTitle,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
show_status = #{showStatus,jdbcType=INTEGER},
pic = #{pic,jdbcType=VARBINARY}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsPrefrenceArea">
update cms_prefrence_area
set name = #{name,jdbcType=VARCHAR},
sub_title = #{subTitle,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
show_status = #{showStatus,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -176,354 +176,4 @@ ...@@ -176,354 +176,4 @@
product_id = #{productId,jdbcType=BIGINT} product_id = #{productId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="prefrence_area_id" jdbcType="BIGINT" property="prefrenceAreaId" />
<result column="product_id" jdbcType="BIGINT" property="productId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, prefrence_area_id, product_id
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelationExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_prefrence_area_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_prefrence_area_product_relation
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_prefrence_area_product_relation
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelationExample">
delete from cms_prefrence_area_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_prefrence_area_product_relation (prefrence_area_id, product_id)
values (#{prefrenceAreaId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_prefrence_area_product_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="prefrenceAreaId != null">
prefrence_area_id,
</if>
<if test="productId != null">
product_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="prefrenceAreaId != null">
#{prefrenceAreaId,jdbcType=BIGINT},
</if>
<if test="productId != null">
#{productId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelationExample" resultType="java.lang.Integer">
select count(*) from cms_prefrence_area_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_prefrence_area_product_relation
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.prefrenceAreaId != null">
prefrence_area_id = #{record.prefrenceAreaId,jdbcType=BIGINT},
</if>
<if test="record.productId != null">
product_id = #{record.productId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_prefrence_area_product_relation
set id = #{record.id,jdbcType=BIGINT},
prefrence_area_id = #{record.prefrenceAreaId,jdbcType=BIGINT},
product_id = #{record.productId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
update cms_prefrence_area_product_relation
<set>
<if test="prefrenceAreaId != null">
prefrence_area_id = #{prefrenceAreaId,jdbcType=BIGINT},
</if>
<if test="productId != null">
product_id = #{productId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
update cms_prefrence_area_product_relation
set prefrence_area_id = #{prefrenceAreaId,jdbcType=BIGINT},
product_id = #{productId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="prefrence_area_id" jdbcType="BIGINT" property="prefrenceAreaId" />
<result column="product_id" jdbcType="BIGINT" property="productId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, prefrence_area_id, product_id
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelationExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_prefrence_area_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_prefrence_area_product_relation
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_prefrence_area_product_relation
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelationExample">
delete from cms_prefrence_area_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_prefrence_area_product_relation (prefrence_area_id, product_id)
values (#{prefrenceAreaId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_prefrence_area_product_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="prefrenceAreaId != null">
prefrence_area_id,
</if>
<if test="productId != null">
product_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="prefrenceAreaId != null">
#{prefrenceAreaId,jdbcType=BIGINT},
</if>
<if test="productId != null">
#{productId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelationExample" resultType="java.lang.Integer">
select count(*) from cms_prefrence_area_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_prefrence_area_product_relation
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.prefrenceAreaId != null">
prefrence_area_id = #{record.prefrenceAreaId,jdbcType=BIGINT},
</if>
<if test="record.productId != null">
product_id = #{record.productId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_prefrence_area_product_relation
set id = #{record.id,jdbcType=BIGINT},
prefrence_area_id = #{record.prefrenceAreaId,jdbcType=BIGINT},
product_id = #{record.productId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
update cms_prefrence_area_product_relation
<set>
<if test="prefrenceAreaId != null">
prefrence_area_id = #{prefrenceAreaId,jdbcType=BIGINT},
</if>
<if test="productId != null">
product_id = #{productId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsPrefrenceAreaProductRelation">
update cms_prefrence_area_product_relation
set prefrence_area_id = #{prefrenceAreaId,jdbcType=BIGINT},
product_id = #{productId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -223,448 +223,4 @@ ...@@ -223,448 +223,4 @@
sort = #{sort,jdbcType=INTEGER} sort = #{sort,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsSubjectCategory">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="subject_count" jdbcType="INTEGER" property="subjectCount" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
<result column="sort" jdbcType="INTEGER" property="sort" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, icon, subject_count, show_status, sort
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsSubjectCategoryExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_subject_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_subject_category
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_subject_category
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsSubjectCategoryExample">
delete from cms_subject_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsSubjectCategory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_category (name, icon, subject_count,
show_status, sort)
values (#{name,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{subjectCount,jdbcType=INTEGER},
#{showStatus,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsSubjectCategory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="icon != null">
icon,
</if>
<if test="subjectCount != null">
subject_count,
</if>
<if test="showStatus != null">
show_status,
</if>
<if test="sort != null">
sort,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="subjectCount != null">
#{subjectCount,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsSubjectCategoryExample" resultType="java.lang.Integer">
select count(*) from cms_subject_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_subject_category
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.icon != null">
icon = #{record.icon,jdbcType=VARCHAR},
</if>
<if test="record.subjectCount != null">
subject_count = #{record.subjectCount,jdbcType=INTEGER},
</if>
<if test="record.showStatus != null">
show_status = #{record.showStatus,jdbcType=INTEGER},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_subject_category
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
icon = #{record.icon,jdbcType=VARCHAR},
subject_count = #{record.subjectCount,jdbcType=INTEGER},
show_status = #{record.showStatus,jdbcType=INTEGER},
sort = #{record.sort,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsSubjectCategory">
update cms_subject_category
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="subjectCount != null">
subject_count = #{subjectCount,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsSubjectCategory">
update cms_subject_category
set name = #{name,jdbcType=VARCHAR},
icon = #{icon,jdbcType=VARCHAR},
subject_count = #{subjectCount,jdbcType=INTEGER},
show_status = #{showStatus,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsSubjectCategory">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="subject_count" jdbcType="INTEGER" property="subjectCount" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
<result column="sort" jdbcType="INTEGER" property="sort" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, icon, subject_count, show_status, sort
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsSubjectCategoryExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_subject_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_subject_category
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_subject_category
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsSubjectCategoryExample">
delete from cms_subject_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsSubjectCategory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_category (name, icon, subject_count,
show_status, sort)
values (#{name,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{subjectCount,jdbcType=INTEGER},
#{showStatus,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsSubjectCategory">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">
name,
</if>
<if test="icon != null">
icon,
</if>
<if test="subjectCount != null">
subject_count,
</if>
<if test="showStatus != null">
show_status,
</if>
<if test="sort != null">
sort,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="subjectCount != null">
#{subjectCount,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsSubjectCategoryExample" resultType="java.lang.Integer">
select count(*) from cms_subject_category
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_subject_category
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.icon != null">
icon = #{record.icon,jdbcType=VARCHAR},
</if>
<if test="record.subjectCount != null">
subject_count = #{record.subjectCount,jdbcType=INTEGER},
</if>
<if test="record.showStatus != null">
show_status = #{record.showStatus,jdbcType=INTEGER},
</if>
<if test="record.sort != null">
sort = #{record.sort,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_subject_category
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
icon = #{record.icon,jdbcType=VARCHAR},
subject_count = #{record.subjectCount,jdbcType=INTEGER},
show_status = #{record.showStatus,jdbcType=INTEGER},
sort = #{record.sort,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsSubjectCategory">
update cms_subject_category
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="subjectCount != null">
subject_count = #{subjectCount,jdbcType=INTEGER},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsSubjectCategory">
update cms_subject_category
set name = #{name,jdbcType=VARCHAR},
icon = #{icon,jdbcType=VARCHAR},
subject_count = #{subjectCount,jdbcType=INTEGER},
show_status = #{showStatus,jdbcType=INTEGER},
sort = #{sort,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -240,482 +240,4 @@ ...@@ -240,482 +240,4 @@
show_status = #{showStatus,jdbcType=INTEGER} show_status = #{showStatus,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsSubjectComment">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="subject_id" jdbcType="BIGINT" property="subjectId" />
<result column="member_nick_name" jdbcType="VARCHAR" property="memberNickName" />
<result column="member_icon" jdbcType="VARCHAR" property="memberIcon" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, subject_id, member_nick_name, member_icon, content, create_time, show_status
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsSubjectCommentExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_subject_comment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_subject_comment
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_subject_comment
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsSubjectCommentExample">
delete from cms_subject_comment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsSubjectComment">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_comment (subject_id, member_nick_name, member_icon,
content, create_time, show_status
)
values (#{subjectId,jdbcType=BIGINT}, #{memberNickName,jdbcType=VARCHAR}, #{memberIcon,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{showStatus,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsSubjectComment">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_comment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="subjectId != null">
subject_id,
</if>
<if test="memberNickName != null">
member_nick_name,
</if>
<if test="memberIcon != null">
member_icon,
</if>
<if test="content != null">
content,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="showStatus != null">
show_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="subjectId != null">
#{subjectId,jdbcType=BIGINT},
</if>
<if test="memberNickName != null">
#{memberNickName,jdbcType=VARCHAR},
</if>
<if test="memberIcon != null">
#{memberIcon,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsSubjectCommentExample" resultType="java.lang.Integer">
select count(*) from cms_subject_comment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_subject_comment
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.subjectId != null">
subject_id = #{record.subjectId,jdbcType=BIGINT},
</if>
<if test="record.memberNickName != null">
member_nick_name = #{record.memberNickName,jdbcType=VARCHAR},
</if>
<if test="record.memberIcon != null">
member_icon = #{record.memberIcon,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.showStatus != null">
show_status = #{record.showStatus,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_subject_comment
set id = #{record.id,jdbcType=BIGINT},
subject_id = #{record.subjectId,jdbcType=BIGINT},
member_nick_name = #{record.memberNickName,jdbcType=VARCHAR},
member_icon = #{record.memberIcon,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
show_status = #{record.showStatus,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsSubjectComment">
update cms_subject_comment
<set>
<if test="subjectId != null">
subject_id = #{subjectId,jdbcType=BIGINT},
</if>
<if test="memberNickName != null">
member_nick_name = #{memberNickName,jdbcType=VARCHAR},
</if>
<if test="memberIcon != null">
member_icon = #{memberIcon,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsSubjectComment">
update cms_subject_comment
set subject_id = #{subjectId,jdbcType=BIGINT},
member_nick_name = #{memberNickName,jdbcType=VARCHAR},
member_icon = #{memberIcon,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
show_status = #{showStatus,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsSubjectComment">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="subject_id" jdbcType="BIGINT" property="subjectId" />
<result column="member_nick_name" jdbcType="VARCHAR" property="memberNickName" />
<result column="member_icon" jdbcType="VARCHAR" property="memberIcon" />
<result column="content" jdbcType="VARCHAR" property="content" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="show_status" jdbcType="INTEGER" property="showStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, subject_id, member_nick_name, member_icon, content, create_time, show_status
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsSubjectCommentExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_subject_comment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_subject_comment
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_subject_comment
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsSubjectCommentExample">
delete from cms_subject_comment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsSubjectComment">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_comment (subject_id, member_nick_name, member_icon,
content, create_time, show_status
)
values (#{subjectId,jdbcType=BIGINT}, #{memberNickName,jdbcType=VARCHAR}, #{memberIcon,jdbcType=VARCHAR},
#{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{showStatus,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsSubjectComment">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_comment
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="subjectId != null">
subject_id,
</if>
<if test="memberNickName != null">
member_nick_name,
</if>
<if test="memberIcon != null">
member_icon,
</if>
<if test="content != null">
content,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="showStatus != null">
show_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="subjectId != null">
#{subjectId,jdbcType=BIGINT},
</if>
<if test="memberNickName != null">
#{memberNickName,jdbcType=VARCHAR},
</if>
<if test="memberIcon != null">
#{memberIcon,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="showStatus != null">
#{showStatus,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsSubjectCommentExample" resultType="java.lang.Integer">
select count(*) from cms_subject_comment
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_subject_comment
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.subjectId != null">
subject_id = #{record.subjectId,jdbcType=BIGINT},
</if>
<if test="record.memberNickName != null">
member_nick_name = #{record.memberNickName,jdbcType=VARCHAR},
</if>
<if test="record.memberIcon != null">
member_icon = #{record.memberIcon,jdbcType=VARCHAR},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.showStatus != null">
show_status = #{record.showStatus,jdbcType=INTEGER},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_subject_comment
set id = #{record.id,jdbcType=BIGINT},
subject_id = #{record.subjectId,jdbcType=BIGINT},
member_nick_name = #{record.memberNickName,jdbcType=VARCHAR},
member_icon = #{record.memberIcon,jdbcType=VARCHAR},
content = #{record.content,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
show_status = #{record.showStatus,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsSubjectComment">
update cms_subject_comment
<set>
<if test="subjectId != null">
subject_id = #{subjectId,jdbcType=BIGINT},
</if>
<if test="memberNickName != null">
member_nick_name = #{memberNickName,jdbcType=VARCHAR},
</if>
<if test="memberIcon != null">
member_icon = #{memberIcon,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="showStatus != null">
show_status = #{showStatus,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsSubjectComment">
update cms_subject_comment
set subject_id = #{subjectId,jdbcType=BIGINT},
member_nick_name = #{memberNickName,jdbcType=VARCHAR},
member_icon = #{memberIcon,jdbcType=VARCHAR},
content = #{content,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
show_status = #{showStatus,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -176,354 +176,4 @@ ...@@ -176,354 +176,4 @@
product_id = #{productId,jdbcType=BIGINT} product_id = #{productId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsSubjectProductRelation">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="subject_id" jdbcType="BIGINT" property="subjectId" />
<result column="product_id" jdbcType="BIGINT" property="productId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, subject_id, product_id
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsSubjectProductRelationExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_subject_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_subject_product_relation
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_subject_product_relation
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsSubjectProductRelationExample">
delete from cms_subject_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsSubjectProductRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_product_relation (subject_id, product_id)
values (#{subjectId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsSubjectProductRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_product_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="subjectId != null">
subject_id,
</if>
<if test="productId != null">
product_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="subjectId != null">
#{subjectId,jdbcType=BIGINT},
</if>
<if test="productId != null">
#{productId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsSubjectProductRelationExample" resultType="java.lang.Integer">
select count(*) from cms_subject_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_subject_product_relation
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.subjectId != null">
subject_id = #{record.subjectId,jdbcType=BIGINT},
</if>
<if test="record.productId != null">
product_id = #{record.productId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_subject_product_relation
set id = #{record.id,jdbcType=BIGINT},
subject_id = #{record.subjectId,jdbcType=BIGINT},
product_id = #{record.productId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsSubjectProductRelation">
update cms_subject_product_relation
<set>
<if test="subjectId != null">
subject_id = #{subjectId,jdbcType=BIGINT},
</if>
<if test="productId != null">
product_id = #{productId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsSubjectProductRelation">
update cms_subject_product_relation
set subject_id = #{subjectId,jdbcType=BIGINT},
product_id = #{productId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
<resultMap id="BaseResultMap" type="com.macro.mall.model.CmsSubjectProductRelation">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="subject_id" jdbcType="BIGINT" property="subjectId" />
<result column="product_id" jdbcType="BIGINT" property="productId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, subject_id, product_id
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.CmsSubjectProductRelationExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cms_subject_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from cms_subject_product_relation
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from cms_subject_product_relation
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.macro.mall.model.CmsSubjectProductRelationExample">
delete from cms_subject_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.macro.mall.model.CmsSubjectProductRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_product_relation (subject_id, product_id)
values (#{subjectId,jdbcType=BIGINT}, #{productId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsSubjectProductRelation">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cms_subject_product_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="subjectId != null">
subject_id,
</if>
<if test="productId != null">
product_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="subjectId != null">
#{subjectId,jdbcType=BIGINT},
</if>
<if test="productId != null">
#{productId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.CmsSubjectProductRelationExample" resultType="java.lang.Integer">
select count(*) from cms_subject_product_relation
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update cms_subject_product_relation
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.subjectId != null">
subject_id = #{record.subjectId,jdbcType=BIGINT},
</if>
<if test="record.productId != null">
product_id = #{record.productId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update cms_subject_product_relation
set id = #{record.id,jdbcType=BIGINT},
subject_id = #{record.subjectId,jdbcType=BIGINT},
product_id = #{record.productId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.macro.mall.model.CmsSubjectProductRelation">
update cms_subject_product_relation
<set>
<if test="subjectId != null">
subject_id = #{subjectId,jdbcType=BIGINT},
</if>
<if test="productId != null">
product_id = #{productId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.macro.mall.model.CmsSubjectProductRelation">
update cms_subject_product_relation
set subject_id = #{subjectId,jdbcType=BIGINT},
product_id = #{productId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper> </mapper>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment