commit
518ebce9ca
@ -0,0 +1,68 @@ |
||||
package com.bweb.controller.api; |
||||
|
||||
import com.hfkj.api.ApiMerService; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.utils.DateUtil; |
||||
import com.hfkj.common.utils.IDGenerator; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.common.utils.WxUtils; |
||||
import com.hfkj.entity.ApiMer; |
||||
import com.hfkj.model.ResponseData; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
|
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
import java.util.Date; |
||||
|
||||
|
||||
@Controller |
||||
@RequestMapping(value = "/apiMer") |
||||
@Api(value = "api商户") |
||||
public class ApiMerController { |
||||
|
||||
Logger log = LoggerFactory.getLogger(ApiMerController.class); |
||||
|
||||
@Resource |
||||
private ApiMerService apiMerService; |
||||
|
||||
@RequestMapping(value="/insertMerchant",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "增加商户") |
||||
public ResponseData insertMer(@RequestBody ApiMer apiMer) { |
||||
try { |
||||
|
||||
|
||||
if (StringUtils.isBlank(apiMer.getMerName()) |
||||
|| StringUtils.isBlank(apiMer.getContact()) |
||||
|| StringUtils.isBlank(apiMer.getContactPhone()) |
||||
) { |
||||
log.error("ApiMerchantsController -> insertMerchant() error!","参数错误"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
apiMer.setCreateTime(new Date()); |
||||
apiMer.setUpdateTime(new Date()); |
||||
apiMer.setStatus(1); |
||||
apiMer.setAppId(DateUtil.date2String(new Date(), "yyyyMM") + IDGenerator.nextId(5)); |
||||
apiMer.setAppSecret(WxUtils.MD5(apiMer.getAppId() , true)); |
||||
apiMerService.create(apiMer); |
||||
|
||||
return ResponseMsgUtil.success("新增成功"); |
||||
} catch (Exception e) { |
||||
log.error("ApiMerchantsController -> insertMerchant() error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,140 @@ |
||||
package com.bweb.controller.goods; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.github.pagehelper.PageHelper; |
||||
import com.github.pagehelper.PageInfo; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.security.SessionObject; |
||||
import com.hfkj.common.security.UserCenter; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.entity.CouponDiscountPackage; |
||||
import com.hfkj.entity.GoodPresent; |
||||
import com.hfkj.entity.GoodsMsg; |
||||
import com.hfkj.entity.GoodsType; |
||||
import com.hfkj.haioil.HaiOilService; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.SecUserSessionObject; |
||||
import com.hfkj.service.discount.CouponDiscountPackageService; |
||||
import com.hfkj.service.goods.GoodPresentService; |
||||
import com.hfkj.sysenum.SecUserObjectTypeEnum; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.servlet.http.HttpServletRequest; |
||||
import java.util.Date; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
@Controller |
||||
@RequestMapping(value="/goodPresent") |
||||
@Api(value="商品赠送") |
||||
public class GoodPresentController { |
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GoodPresentController.class); |
||||
|
||||
@Resource |
||||
private GoodPresentService goodPresentService; |
||||
|
||||
@Resource |
||||
private CouponDiscountPackageService discountPackageService; |
||||
|
||||
@Resource |
||||
private UserCenter userCenter; |
||||
|
||||
@RequestMapping(value="/createGoodPresent",method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "创建商品赠送") |
||||
public ResponseData createGoodPresent(@RequestBody GoodPresent body, HttpServletRequest request) { |
||||
|
||||
try { |
||||
|
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); |
||||
|
||||
if (!userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); |
||||
} |
||||
|
||||
if (body == null |
||||
|| body.getKey() == null |
||||
|| body.getType() == null |
||||
|| body.getSpecsId() == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
CouponDiscountPackage discountPackage = new CouponDiscountPackage(); |
||||
if (body.getType() == 1) { |
||||
discountPackage = discountPackageService.findDiscountPackageByKey(body.getKey()); |
||||
if (discountPackage == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券包不存在"); |
||||
} |
||||
body.setName(discountPackage.getTitle()); |
||||
} else { |
||||
Map<String , Object> map = new HashMap<>(); |
||||
map.put("discountPkNo" , body.getKey()); |
||||
JSONObject jsonObject = HaiOilService.queryPkDetail(map); |
||||
body.setName(jsonObject.getJSONObject("return_data").getString("discountPkName")); |
||||
} |
||||
|
||||
|
||||
body.setCreateTime(new Date()); |
||||
body.setUpdateTime(new Date()); |
||||
body.setStatus(1); |
||||
goodPresentService.create(body); |
||||
|
||||
return ResponseMsgUtil.success("操作成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
|
||||
} |
||||
|
||||
@RequestMapping(value="/getLisPresent",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "查询列表") |
||||
public ResponseData getLisPresent(@RequestParam(value = "specsId" , required = false) Long specsId) { |
||||
try { |
||||
|
||||
Map<String , Object> map = new HashMap<>(); |
||||
map.put("specsId", specsId); |
||||
return ResponseMsgUtil.success(goodPresentService.getList(map)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
@RequestMapping(value="/delete",method = RequestMethod.GET) |
||||
@ResponseBody |
||||
@ApiOperation(value = "删除") |
||||
public ResponseData delete(@RequestParam(value = "id" , required = false) Long id, HttpServletRequest request) { |
||||
try { |
||||
|
||||
SessionObject sessionObject = userCenter.getSessionObject(request); |
||||
SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); |
||||
|
||||
if (!userModel.getAccount().getObjectType().equals(SecUserObjectTypeEnum.type1.getCode())) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); |
||||
} |
||||
|
||||
goodPresentService.delete(id , false); |
||||
|
||||
return ResponseMsgUtil.success("删除成功"); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("error!",e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,101 @@ |
||||
package com.cweb.controller.output; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.hfkj.api.ApiMerService; |
||||
import com.hfkj.common.exception.ErrorCode; |
||||
import com.hfkj.common.exception.ErrorHelp; |
||||
import com.hfkj.common.exception.SysCode; |
||||
import com.hfkj.common.security.UserCenter; |
||||
import com.hfkj.common.utils.ResponseMsgUtil; |
||||
import com.hfkj.common.utils.SignatureUtil; |
||||
import com.hfkj.entity.*; |
||||
import com.hfkj.model.ResponseData; |
||||
import com.hfkj.model.UserSessionObject; |
||||
import com.hfkj.service.SecDictionaryService; |
||||
import com.hfkj.service.discount.CouponDiscountPackageService; |
||||
import com.hfkj.service.discount.CouponDiscountService; |
||||
import com.hfkj.service.discount.CouponDiscountUserRelService; |
||||
import com.hfkj.service.user.BsUserService; |
||||
import com.hfkj.sysenum.UserLoginPlatform; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.slf4j.Logger; |
||||
import org.slf4j.LoggerFactory; |
||||
import org.springframework.stereotype.Controller; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.*; |
||||
import java.util.concurrent.ConcurrentHashMap; |
||||
import java.util.function.Function; |
||||
import java.util.function.Predicate; |
||||
import java.util.stream.Collectors; |
||||
|
||||
@Controller |
||||
@RequestMapping(value="/output") |
||||
@Api(value="输出外部接口") |
||||
public class OutputController { |
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(OutputController.class); |
||||
|
||||
@Resource |
||||
private ApiMerService apiMerService; |
||||
|
||||
@Resource |
||||
private CouponDiscountUserRelService discountUserRelService; |
||||
@Resource |
||||
private BsUserService bsUserService; |
||||
|
||||
@RequestMapping(value = "/getListUserDiscount", method = RequestMethod.POST) |
||||
@ResponseBody |
||||
@ApiOperation(value = "获取用户优惠券列表") |
||||
public ResponseData getListUserDiscount(@RequestBody JSONObject body) { |
||||
try { |
||||
|
||||
if (body == null |
||||
|| StringUtils.isBlank(body.getString("status")) |
||||
|| StringUtils.isBlank(body.getString("phone")) |
||||
|| StringUtils.isBlank(body.getString("sign")) |
||||
|| StringUtils.isBlank(body.getString("appid")) |
||||
) { |
||||
log.error("LoginController --> phone() error!", "请求参数校验失败"); |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
||||
} |
||||
|
||||
// 查询api商户信息
|
||||
ApiMer apiMer = apiMerService.queryDetail(body.getString("appid")); |
||||
|
||||
Map<String , Object> map = new HashMap<>(); |
||||
map.put("appid" , body.getString("appid")); |
||||
map.put("phone" , body.getString("phone")); |
||||
map.put("status" , body.getString("status")); |
||||
String sign = SignatureUtil.createSign(map , apiMer.getAppSecret()); |
||||
if (!body.getString("sign").equals(sign)) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "签名校验失败!"); |
||||
} |
||||
|
||||
// 查询用户信息
|
||||
BsUser user = bsUserService.getUser(body.getString("phone")); |
||||
|
||||
if (user == null) { |
||||
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户不存在!"); |
||||
} |
||||
|
||||
Map<String, Object> mapPost = new HashMap<>(); |
||||
|
||||
mapPost.put("userId", user.getId()); |
||||
mapPost.put("status", body.getInteger("status")); |
||||
|
||||
return ResponseMsgUtil.success(discountUserRelService.getList(mapPost)); |
||||
|
||||
} catch (Exception e) { |
||||
log.error("GoodsDetailController --> getListUser() error!", e); |
||||
return ResponseMsgUtil.exception(e); |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,68 @@ |
||||
package com.hfkj.api; |
||||
|
||||
import com.hfkj.entity.ApiMer; |
||||
|
||||
import java.util.List; |
||||
|
||||
public interface ApiMerService { |
||||
|
||||
/** |
||||
* @MethodName create |
||||
* @Description: 创建api商户 |
||||
* @param apiMer |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/5 下午3:19 |
||||
*/ |
||||
void create(ApiMer apiMer); |
||||
|
||||
/** |
||||
* @MethodName update |
||||
* @Description: /** |
||||
* @Description: 更新api商户 |
||||
* @param apiMer |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/5 下午3:19 |
||||
*/ |
||||
void update(ApiMer apiMer); |
||||
|
||||
/** |
||||
* @MethodName delete |
||||
* @Description: 删除api商户 |
||||
* @param id |
||||
* @param fullDelete |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/5 下午3:19 |
||||
*/ |
||||
void delete(Long id , Boolean fullDelete); |
||||
|
||||
/** |
||||
* @MethodName queryDetail |
||||
* @Description: 查询api商户详情 |
||||
* @param id |
||||
* @return: com.hfkj.entity.ApiMer |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/5 下午3:19 |
||||
*/ |
||||
ApiMer queryDetail(Long id); |
||||
|
||||
/** |
||||
* @MethodName queryDetail |
||||
* @Description: 根据appId查询商户 |
||||
* @param appId |
||||
* @return: com.hfkj.entity.ApiMer |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/5 下午3:20 |
||||
*/ |
||||
ApiMer queryDetail(String appId); |
||||
|
||||
/** |
||||
* @MethodName queryList |
||||
* @Description: 查询api商户列表 |
||||
* @param apiMer |
||||
* @return: java.util.List<com.hfkj.entity.ApiMer> |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/5 下午3:20 |
||||
*/ |
||||
List<ApiMer> queryList(ApiMer apiMer); |
||||
|
||||
} |
@ -0,0 +1,68 @@ |
||||
package com.hfkj.api.impl; |
||||
|
||||
import com.hfkj.api.ApiMerService; |
||||
import com.hfkj.dao.ApiMerMapper; |
||||
import com.hfkj.entity.ApiMer; |
||||
import com.hfkj.entity.ApiMerExample; |
||||
import com.hfkj.entity.BsOrderGoods; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.Collections; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
@Service("apiMerService") |
||||
public class ApiMerServiceImpl implements ApiMerService { |
||||
|
||||
@Resource |
||||
private ApiMerMapper apiMerMapper; |
||||
|
||||
@Override |
||||
public void create(ApiMer apiMer) { |
||||
apiMerMapper.insert(apiMer); |
||||
} |
||||
|
||||
@Override |
||||
public void update(ApiMer apiMer) { |
||||
apiMerMapper.updateByPrimaryKey(apiMer); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(Long id, Boolean fullDelete) { |
||||
if (fullDelete) { |
||||
apiMerMapper.deleteByPrimaryKey(id); |
||||
} else { |
||||
ApiMer apiMer = queryDetail(id); |
||||
apiMer.setStatus(0); |
||||
apiMer.setUpdateTime(new Date()); |
||||
update(apiMer); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public ApiMer queryDetail(Long id) { |
||||
return apiMerMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public ApiMer queryDetail(String appId) { |
||||
ApiMerExample example = new ApiMerExample(); |
||||
ApiMerExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
criteria.andAppIdEqualTo(appId).andStatusEqualTo(1); |
||||
|
||||
List<ApiMer> list = apiMerMapper.selectByExample(example); |
||||
|
||||
if (!list.isEmpty()) { |
||||
return list.get(0); |
||||
} |
||||
|
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public List<ApiMer> queryList(ApiMer apiMer) { |
||||
return Collections.emptyList(); |
||||
} |
||||
} |
@ -0,0 +1,125 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.ApiMer; |
||||
import com.hfkj.entity.ApiMerExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface ApiMerMapper extends ApiMerMapperExt { |
||||
@SelectProvider(type=ApiMerSqlProvider.class, method="countByExample") |
||||
long countByExample(ApiMerExample example); |
||||
|
||||
@DeleteProvider(type=ApiMerSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(ApiMerExample example); |
||||
|
||||
@Delete({ |
||||
"delete from api_mer", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into api_mer (contact, contact_phone, ", |
||||
"mer_name, app_id, ", |
||||
"app_secret, create_time, ", |
||||
"update_time, `status`, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{contact,jdbcType=VARCHAR}, #{contactPhone,jdbcType=VARCHAR}, ", |
||||
"#{merName,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, ", |
||||
"#{appSecret,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(ApiMer record); |
||||
|
||||
@InsertProvider(type=ApiMerSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(ApiMer record); |
||||
|
||||
@SelectProvider(type=ApiMerSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="contact", property="contact", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="app_secret", property="appSecret", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<ApiMer> selectByExample(ApiMerExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, contact, contact_phone, mer_name, app_id, app_secret, create_time, update_time, ", |
||||
"`status`, ext_1, ext_2, ext_3", |
||||
"from api_mer", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="contact", property="contact", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="contact_phone", property="contactPhone", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="app_id", property="appId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="app_secret", property="appSecret", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
ApiMer selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=ApiMerSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") ApiMer record, @Param("example") ApiMerExample example); |
||||
|
||||
@UpdateProvider(type=ApiMerSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") ApiMer record, @Param("example") ApiMerExample example); |
||||
|
||||
@UpdateProvider(type=ApiMerSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(ApiMer record); |
||||
|
||||
@Update({ |
||||
"update api_mer", |
||||
"set contact = #{contact,jdbcType=VARCHAR},", |
||||
"contact_phone = #{contactPhone,jdbcType=VARCHAR},", |
||||
"mer_name = #{merName,jdbcType=VARCHAR},", |
||||
"app_id = #{appId,jdbcType=VARCHAR},", |
||||
"app_secret = #{appSecret,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(ApiMer record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface ApiMerMapperExt { |
||||
} |
@ -0,0 +1,332 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.ApiMer; |
||||
import com.hfkj.entity.ApiMerExample.Criteria; |
||||
import com.hfkj.entity.ApiMerExample.Criterion; |
||||
import com.hfkj.entity.ApiMerExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class ApiMerSqlProvider { |
||||
|
||||
public String countByExample(ApiMerExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("api_mer"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(ApiMerExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("api_mer"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(ApiMer record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("api_mer"); |
||||
|
||||
if (record.getContact() != null) { |
||||
sql.VALUES("contact", "#{contact,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactPhone() != null) { |
||||
sql.VALUES("contact_phone", "#{contactPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAppId() != null) { |
||||
sql.VALUES("app_id", "#{appId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAppSecret() != null) { |
||||
sql.VALUES("app_secret", "#{appSecret,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(ApiMerExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("contact"); |
||||
sql.SELECT("contact_phone"); |
||||
sql.SELECT("mer_name"); |
||||
sql.SELECT("app_id"); |
||||
sql.SELECT("app_secret"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("api_mer"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
ApiMer record = (ApiMer) parameter.get("record"); |
||||
ApiMerExample example = (ApiMerExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("api_mer"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getContact() != null) { |
||||
sql.SET("contact = #{record.contact,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactPhone() != null) { |
||||
sql.SET("contact_phone = #{record.contactPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAppId() != null) { |
||||
sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAppSecret() != null) { |
||||
sql.SET("app_secret = #{record.appSecret,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("api_mer"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("contact = #{record.contact,jdbcType=VARCHAR}"); |
||||
sql.SET("contact_phone = #{record.contactPhone,jdbcType=VARCHAR}"); |
||||
sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); |
||||
sql.SET("app_id = #{record.appId,jdbcType=VARCHAR}"); |
||||
sql.SET("app_secret = #{record.appSecret,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
ApiMerExample example = (ApiMerExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(ApiMer record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("api_mer"); |
||||
|
||||
if (record.getContact() != null) { |
||||
sql.SET("contact = #{contact,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getContactPhone() != null) { |
||||
sql.SET("contact_phone = #{contactPhone,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getMerName() != null) { |
||||
sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAppId() != null) { |
||||
sql.SET("app_id = #{appId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getAppSecret() != null) { |
||||
sql.SET("app_secret = #{appSecret,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, ApiMerExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,120 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.GoodPresent; |
||||
import com.hfkj.entity.GoodPresentExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface GoodPresentMapper extends GoodPresentMapperExt { |
||||
@SelectProvider(type=GoodPresentSqlProvider.class, method="countByExample") |
||||
long countByExample(GoodPresentExample example); |
||||
|
||||
@DeleteProvider(type=GoodPresentSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(GoodPresentExample example); |
||||
|
||||
@Delete({ |
||||
"delete from good_present", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int deleteByPrimaryKey(Long id); |
||||
|
||||
@Insert({ |
||||
"insert into good_present (`type`, `key`, ", |
||||
"`name`, specs_id, create_time, ", |
||||
"update_time, `status`, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{type,jdbcType=INTEGER}, #{key,jdbcType=VARCHAR}, ", |
||||
"#{name,jdbcType=VARCHAR}, #{specsId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(GoodPresent record); |
||||
|
||||
@InsertProvider(type=GoodPresentSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(GoodPresent record); |
||||
|
||||
@SelectProvider(type=GoodPresentSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="key", property="key", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="specs_id", property="specsId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<GoodPresent> selectByExample(GoodPresentExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, `type`, `key`, `name`, specs_id, create_time, update_time, `status`, ext_1, ", |
||||
"ext_2, ext_3", |
||||
"from good_present", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), |
||||
@Result(column="type", property="type", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="key", property="key", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="specs_id", property="specsId", jdbcType=JdbcType.BIGINT), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
GoodPresent selectByPrimaryKey(Long id); |
||||
|
||||
@UpdateProvider(type=GoodPresentSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") GoodPresent record, @Param("example") GoodPresentExample example); |
||||
|
||||
@UpdateProvider(type=GoodPresentSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") GoodPresent record, @Param("example") GoodPresentExample example); |
||||
|
||||
@UpdateProvider(type=GoodPresentSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(GoodPresent record); |
||||
|
||||
@Update({ |
||||
"update good_present", |
||||
"set `type` = #{type,jdbcType=INTEGER},", |
||||
"`key` = #{key,jdbcType=VARCHAR},", |
||||
"`name` = #{name,jdbcType=VARCHAR},", |
||||
"specs_id = #{specsId,jdbcType=BIGINT},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=BIGINT}" |
||||
}) |
||||
int updateByPrimaryKey(GoodPresent record); |
||||
} |
@ -0,0 +1,7 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface GoodPresentMapperExt { |
||||
} |
@ -0,0 +1,318 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.GoodPresent; |
||||
import com.hfkj.entity.GoodPresentExample.Criteria; |
||||
import com.hfkj.entity.GoodPresentExample.Criterion; |
||||
import com.hfkj.entity.GoodPresentExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class GoodPresentSqlProvider { |
||||
|
||||
public String countByExample(GoodPresentExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("good_present"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(GoodPresentExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("good_present"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(GoodPresent record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("good_present"); |
||||
|
||||
if (record.getType() != null) { |
||||
sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getKey() != null) { |
||||
sql.VALUES("`key`", "#{key,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getName() != null) { |
||||
sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSpecsId() != null) { |
||||
sql.VALUES("specs_id", "#{specsId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(GoodPresentExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("`type`"); |
||||
sql.SELECT("`key`"); |
||||
sql.SELECT("`name`"); |
||||
sql.SELECT("specs_id"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("good_present"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
GoodPresent record = (GoodPresent) parameter.get("record"); |
||||
GoodPresentExample example = (GoodPresentExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("good_present"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getType() != null) { |
||||
sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getKey() != null) { |
||||
sql.SET("`key` = #{record.key,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getName() != null) { |
||||
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSpecsId() != null) { |
||||
sql.SET("specs_id = #{record.specsId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("good_present"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=BIGINT}"); |
||||
sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); |
||||
sql.SET("`key` = #{record.key,jdbcType=VARCHAR}"); |
||||
sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); |
||||
sql.SET("specs_id = #{record.specsId,jdbcType=BIGINT}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
GoodPresentExample example = (GoodPresentExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(GoodPresent record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("good_present"); |
||||
|
||||
if (record.getType() != null) { |
||||
sql.SET("`type` = #{type,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getKey() != null) { |
||||
sql.SET("`key` = #{key,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getName() != null) { |
||||
sql.SET("`name` = #{name,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getSpecsId() != null) { |
||||
sql.SET("specs_id = #{specsId,jdbcType=BIGINT}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=BIGINT}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, GoodPresentExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,108 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.JdSku; |
||||
import com.hfkj.entity.JdSkuExample; |
||||
import java.util.List; |
||||
import org.apache.ibatis.annotations.Delete; |
||||
import org.apache.ibatis.annotations.DeleteProvider; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.InsertProvider; |
||||
import org.apache.ibatis.annotations.Options; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Result; |
||||
import org.apache.ibatis.annotations.Results; |
||||
import org.apache.ibatis.annotations.Select; |
||||
import org.apache.ibatis.annotations.SelectProvider; |
||||
import org.apache.ibatis.annotations.Update; |
||||
import org.apache.ibatis.annotations.UpdateProvider; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.springframework.stereotype.Repository; |
||||
|
||||
/** |
||||
* |
||||
* 代码由工具生成,请勿修改!!! |
||||
* 如果需要扩展请在其父类进行扩展 |
||||
* |
||||
**/ |
||||
@Repository |
||||
public interface JdSkuMapper extends JdSkuMapperExt { |
||||
@SelectProvider(type=JdSkuSqlProvider.class, method="countByExample") |
||||
long countByExample(JdSkuExample example); |
||||
|
||||
@DeleteProvider(type=JdSkuSqlProvider.class, method="deleteByExample") |
||||
int deleteByExample(JdSkuExample example); |
||||
|
||||
@Delete({ |
||||
"delete from jd_sku", |
||||
"where id = #{id,jdbcType=INTEGER}" |
||||
}) |
||||
int deleteByPrimaryKey(Integer id); |
||||
|
||||
@Insert({ |
||||
"insert into jd_sku (sku_id, create_time, ", |
||||
"update_time, `status`, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values (#{skuId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", |
||||
"#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" |
||||
}) |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insert(JdSku record); |
||||
|
||||
@InsertProvider(type=JdSkuSqlProvider.class, method="insertSelective") |
||||
@Options(useGeneratedKeys=true,keyProperty="id") |
||||
int insertSelective(JdSku record); |
||||
|
||||
@SelectProvider(type=JdSkuSqlProvider.class, method="selectByExample") |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), |
||||
@Result(column="sku_id", property="skuId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
List<JdSku> selectByExample(JdSkuExample example); |
||||
|
||||
@Select({ |
||||
"select", |
||||
"id, sku_id, create_time, update_time, `status`, ext_1, ext_2, ext_3", |
||||
"from jd_sku", |
||||
"where id = #{id,jdbcType=INTEGER}" |
||||
}) |
||||
@Results({ |
||||
@Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true), |
||||
@Result(column="sku_id", property="skuId", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), |
||||
@Result(column="status", property="status", jdbcType=JdbcType.INTEGER), |
||||
@Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), |
||||
@Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) |
||||
}) |
||||
JdSku selectByPrimaryKey(Integer id); |
||||
|
||||
@UpdateProvider(type=JdSkuSqlProvider.class, method="updateByExampleSelective") |
||||
int updateByExampleSelective(@Param("record") JdSku record, @Param("example") JdSkuExample example); |
||||
|
||||
@UpdateProvider(type=JdSkuSqlProvider.class, method="updateByExample") |
||||
int updateByExample(@Param("record") JdSku record, @Param("example") JdSkuExample example); |
||||
|
||||
@UpdateProvider(type=JdSkuSqlProvider.class, method="updateByPrimaryKeySelective") |
||||
int updateByPrimaryKeySelective(JdSku record); |
||||
|
||||
@Update({ |
||||
"update jd_sku", |
||||
"set sku_id = #{skuId,jdbcType=VARCHAR},", |
||||
"create_time = #{createTime,jdbcType=TIMESTAMP},", |
||||
"update_time = #{updateTime,jdbcType=TIMESTAMP},", |
||||
"`status` = #{status,jdbcType=INTEGER},", |
||||
"ext_1 = #{ext1,jdbcType=VARCHAR},", |
||||
"ext_2 = #{ext2,jdbcType=VARCHAR},", |
||||
"ext_3 = #{ext3,jdbcType=VARCHAR}", |
||||
"where id = #{id,jdbcType=INTEGER}" |
||||
}) |
||||
int updateByPrimaryKey(JdSku record); |
||||
} |
@ -0,0 +1,39 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.JdSku; |
||||
import com.hfkj.model.goods.JdGoodsModel; |
||||
import org.apache.ibatis.annotations.Insert; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.apache.ibatis.annotations.Select; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* mapper扩展类 |
||||
*/ |
||||
public interface JdSkuMapperExt { |
||||
|
||||
|
||||
|
||||
@Insert({ |
||||
"<script>", |
||||
"insert into jd_sku (sku_id, create_time, ", |
||||
"update_time, `status`, ", |
||||
"ext_1, ext_2, ext_3)", |
||||
"values ", |
||||
"<foreach collection='list' item='item' index='index' separator=','>", |
||||
"(#{item.skuId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP}, ", |
||||
"#{item.updateTime,jdbcType=TIMESTAMP}, #{item.status,jdbcType=INTEGER}, ", |
||||
"#{item.ext1,jdbcType=VARCHAR}, #{item.ext2,jdbcType=VARCHAR}, #{item.ext3,jdbcType=VARCHAR})" , |
||||
"</foreach>", |
||||
"</script>" |
||||
}) |
||||
void insertJdSkuBatch(@Param(value = "list") List<JdSku> list); |
||||
|
||||
|
||||
@Select("<script>" + |
||||
" SELECT third_id from goods_msg where third_id is not null;" + |
||||
"</script>") |
||||
List<Long> getJdList(); |
||||
} |
@ -0,0 +1,276 @@ |
||||
package com.hfkj.dao; |
||||
|
||||
import com.hfkj.entity.JdSku; |
||||
import com.hfkj.entity.JdSkuExample.Criteria; |
||||
import com.hfkj.entity.JdSkuExample.Criterion; |
||||
import com.hfkj.entity.JdSkuExample; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import org.apache.ibatis.jdbc.SQL; |
||||
|
||||
public class JdSkuSqlProvider { |
||||
|
||||
public String countByExample(JdSkuExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.SELECT("count(*)").FROM("jd_sku"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String deleteByExample(JdSkuExample example) { |
||||
SQL sql = new SQL(); |
||||
sql.DELETE_FROM("jd_sku"); |
||||
applyWhere(sql, example, false); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String insertSelective(JdSku record) { |
||||
SQL sql = new SQL(); |
||||
sql.INSERT_INTO("jd_sku"); |
||||
|
||||
if (record.getSkuId() != null) { |
||||
sql.VALUES("sku_id", "#{skuId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String selectByExample(JdSkuExample example) { |
||||
SQL sql = new SQL(); |
||||
if (example != null && example.isDistinct()) { |
||||
sql.SELECT_DISTINCT("id"); |
||||
} else { |
||||
sql.SELECT("id"); |
||||
} |
||||
sql.SELECT("sku_id"); |
||||
sql.SELECT("create_time"); |
||||
sql.SELECT("update_time"); |
||||
sql.SELECT("`status`"); |
||||
sql.SELECT("ext_1"); |
||||
sql.SELECT("ext_2"); |
||||
sql.SELECT("ext_3"); |
||||
sql.FROM("jd_sku"); |
||||
applyWhere(sql, example, false); |
||||
|
||||
if (example != null && example.getOrderByClause() != null) { |
||||
sql.ORDER_BY(example.getOrderByClause()); |
||||
} |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExampleSelective(Map<String, Object> parameter) { |
||||
JdSku record = (JdSku) parameter.get("record"); |
||||
JdSkuExample example = (JdSkuExample) parameter.get("example"); |
||||
|
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("jd_sku"); |
||||
|
||||
if (record.getId() != null) { |
||||
sql.SET("id = #{record.id,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getSkuId() != null) { |
||||
sql.SET("sku_id = #{record.skuId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByExample(Map<String, Object> parameter) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("jd_sku"); |
||||
|
||||
sql.SET("id = #{record.id,jdbcType=INTEGER}"); |
||||
sql.SET("sku_id = #{record.skuId,jdbcType=VARCHAR}"); |
||||
sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); |
||||
sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); |
||||
sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); |
||||
sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); |
||||
|
||||
JdSkuExample example = (JdSkuExample) parameter.get("example"); |
||||
applyWhere(sql, example, true); |
||||
return sql.toString(); |
||||
} |
||||
|
||||
public String updateByPrimaryKeySelective(JdSku record) { |
||||
SQL sql = new SQL(); |
||||
sql.UPDATE("jd_sku"); |
||||
|
||||
if (record.getSkuId() != null) { |
||||
sql.SET("sku_id = #{skuId,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getCreateTime() != null) { |
||||
sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getUpdateTime() != null) { |
||||
sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); |
||||
} |
||||
|
||||
if (record.getStatus() != null) { |
||||
sql.SET("`status` = #{status,jdbcType=INTEGER}"); |
||||
} |
||||
|
||||
if (record.getExt1() != null) { |
||||
sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt2() != null) { |
||||
sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
if (record.getExt3() != null) { |
||||
sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); |
||||
} |
||||
|
||||
sql.WHERE("id = #{id,jdbcType=INTEGER}"); |
||||
|
||||
return sql.toString(); |
||||
} |
||||
|
||||
protected void applyWhere(SQL sql, JdSkuExample example, boolean includeExamplePhrase) { |
||||
if (example == null) { |
||||
return; |
||||
} |
||||
|
||||
String parmPhrase1; |
||||
String parmPhrase1_th; |
||||
String parmPhrase2; |
||||
String parmPhrase2_th; |
||||
String parmPhrase3; |
||||
String parmPhrase3_th; |
||||
if (includeExamplePhrase) { |
||||
parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} else { |
||||
parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; |
||||
parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; |
||||
parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; |
||||
parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; |
||||
parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; |
||||
parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; |
||||
} |
||||
|
||||
StringBuilder sb = new StringBuilder(); |
||||
List<Criteria> oredCriteria = example.getOredCriteria(); |
||||
boolean firstCriteria = true; |
||||
for (int i = 0; i < oredCriteria.size(); i++) { |
||||
Criteria criteria = oredCriteria.get(i); |
||||
if (criteria.isValid()) { |
||||
if (firstCriteria) { |
||||
firstCriteria = false; |
||||
} else { |
||||
sb.append(" or "); |
||||
} |
||||
|
||||
sb.append('('); |
||||
List<Criterion> criterions = criteria.getAllCriteria(); |
||||
boolean firstCriterion = true; |
||||
for (int j = 0; j < criterions.size(); j++) { |
||||
Criterion criterion = criterions.get(j); |
||||
if (firstCriterion) { |
||||
firstCriterion = false; |
||||
} else { |
||||
sb.append(" and "); |
||||
} |
||||
|
||||
if (criterion.isNoValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
} else if (criterion.isSingleValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isBetweenValue()) { |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); |
||||
} |
||||
} else if (criterion.isListValue()) { |
||||
sb.append(criterion.getCondition()); |
||||
sb.append(" ("); |
||||
List<?> listItems = (List<?>) criterion.getValue(); |
||||
boolean comma = false; |
||||
for (int k = 0; k < listItems.size(); k++) { |
||||
if (comma) { |
||||
sb.append(", "); |
||||
} else { |
||||
comma = true; |
||||
} |
||||
if (criterion.getTypeHandler() == null) { |
||||
sb.append(String.format(parmPhrase3, i, j, k)); |
||||
} else { |
||||
sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
sb.append(')'); |
||||
} |
||||
} |
||||
|
||||
if (sb.length() > 0) { |
||||
sql.WHERE(sb.toString()); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,241 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* api_mer |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class ApiMer implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 联系人 |
||||
*/ |
||||
private String contact; |
||||
|
||||
/** |
||||
* 联系人电话 |
||||
*/ |
||||
private String contactPhone; |
||||
|
||||
/** |
||||
* 商户名称 |
||||
*/ |
||||
private String merName; |
||||
|
||||
/** |
||||
* app_id |
||||
*/ |
||||
private String appId; |
||||
|
||||
/** |
||||
* appSecret |
||||
*/ |
||||
private String appSecret; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 状态 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* ext_1 |
||||
*/ |
||||
private String ext1; |
||||
|
||||
/** |
||||
* ext_2 |
||||
*/ |
||||
private String ext2; |
||||
|
||||
/** |
||||
* ext_3 |
||||
*/ |
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getContact() { |
||||
return contact; |
||||
} |
||||
|
||||
public void setContact(String contact) { |
||||
this.contact = contact; |
||||
} |
||||
|
||||
public String getContactPhone() { |
||||
return contactPhone; |
||||
} |
||||
|
||||
public void setContactPhone(String contactPhone) { |
||||
this.contactPhone = contactPhone; |
||||
} |
||||
|
||||
public String getMerName() { |
||||
return merName; |
||||
} |
||||
|
||||
public void setMerName(String merName) { |
||||
this.merName = merName; |
||||
} |
||||
|
||||
public String getAppId() { |
||||
return appId; |
||||
} |
||||
|
||||
public void setAppId(String appId) { |
||||
this.appId = appId; |
||||
} |
||||
|
||||
public String getAppSecret() { |
||||
return appSecret; |
||||
} |
||||
|
||||
public void setAppSecret(String appSecret) { |
||||
this.appSecret = appSecret; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
ApiMer other = (ApiMer) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getContact() == null ? other.getContact() == null : this.getContact().equals(other.getContact())) |
||||
&& (this.getContactPhone() == null ? other.getContactPhone() == null : this.getContactPhone().equals(other.getContactPhone())) |
||||
&& (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) |
||||
&& (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId())) |
||||
&& (this.getAppSecret() == null ? other.getAppSecret() == null : this.getAppSecret().equals(other.getAppSecret())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getContact() == null) ? 0 : getContact().hashCode()); |
||||
result = prime * result + ((getContactPhone() == null) ? 0 : getContactPhone().hashCode()); |
||||
result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); |
||||
result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode()); |
||||
result = prime * result + ((getAppSecret() == null) ? 0 : getAppSecret().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", contact=").append(contact); |
||||
sb.append(", contactPhone=").append(contactPhone); |
||||
sb.append(", merName=").append(merName); |
||||
sb.append(", appId=").append(appId); |
||||
sb.append(", appSecret=").append(appSecret); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,225 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* good_present |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class GoodPresent implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 1:内部优惠券包 2:嗨加油优惠券包 |
||||
*/ |
||||
private Integer type; |
||||
|
||||
/** |
||||
* 赠送内容编码 |
||||
*/ |
||||
private String key; |
||||
|
||||
/** |
||||
* 名称 |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* 商品规格id |
||||
*/ |
||||
private Long specsId; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 状态 1:正常 0:删除 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* ext_1 |
||||
*/ |
||||
private String ext1; |
||||
|
||||
/** |
||||
* ext_2 |
||||
*/ |
||||
private String ext2; |
||||
|
||||
/** |
||||
* ext_3 |
||||
*/ |
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Long getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Long id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public Integer getType() { |
||||
return type; |
||||
} |
||||
|
||||
public void setType(Integer type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getKey() { |
||||
return key; |
||||
} |
||||
|
||||
public void setKey(String key) { |
||||
this.key = key; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
|
||||
public Long getSpecsId() { |
||||
return specsId; |
||||
} |
||||
|
||||
public void setSpecsId(Long specsId) { |
||||
this.specsId = specsId; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
GoodPresent other = (GoodPresent) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) |
||||
&& (this.getKey() == null ? other.getKey() == null : this.getKey().equals(other.getKey())) |
||||
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) |
||||
&& (this.getSpecsId() == null ? other.getSpecsId() == null : this.getSpecsId().equals(other.getSpecsId())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode()); |
||||
result = prime * result + ((getKey() == null) ? 0 : getKey().hashCode()); |
||||
result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); |
||||
result = prime * result + ((getSpecsId() == null) ? 0 : getSpecsId().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", type=").append(type); |
||||
sb.append(", key=").append(key); |
||||
sb.append(", name=").append(name); |
||||
sb.append(", specsId=").append(specsId); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,933 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class GoodPresentExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public GoodPresentExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
public void setLimit(Integer limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public Integer getLimit() { |
||||
return limit; |
||||
} |
||||
|
||||
public void setOffset(Long offset) { |
||||
this.offset = offset; |
||||
} |
||||
|
||||
public Long getOffset() { |
||||
return offset; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andIdIsNull() { |
||||
addCriterion("id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIsNotNull() { |
||||
addCriterion("id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdEqualTo(Long value) { |
||||
addCriterion("id =", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotEqualTo(Long value) { |
||||
addCriterion("id <>", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThan(Long value) { |
||||
addCriterion("id >", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("id >=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThan(Long value) { |
||||
addCriterion("id <", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("id <=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIn(List<Long> values) { |
||||
addCriterion("id in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotIn(List<Long> values) { |
||||
addCriterion("id not in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) { |
||||
addCriterion("id between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("id not between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeIsNull() { |
||||
addCriterion("`type` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeIsNotNull() { |
||||
addCriterion("`type` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeEqualTo(Integer value) { |
||||
addCriterion("`type` =", value, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeNotEqualTo(Integer value) { |
||||
addCriterion("`type` <>", value, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeGreaterThan(Integer value) { |
||||
addCriterion("`type` >", value, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("`type` >=", value, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeLessThan(Integer value) { |
||||
addCriterion("`type` <", value, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeLessThanOrEqualTo(Integer value) { |
||||
addCriterion("`type` <=", value, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeIn(List<Integer> values) { |
||||
addCriterion("`type` in", values, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeNotIn(List<Integer> values) { |
||||
addCriterion("`type` not in", values, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeBetween(Integer value1, Integer value2) { |
||||
addCriterion("`type` between", value1, value2, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andTypeNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("`type` not between", value1, value2, "type"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyIsNull() { |
||||
addCriterion("`key` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyIsNotNull() { |
||||
addCriterion("`key` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyEqualTo(String value) { |
||||
addCriterion("`key` =", value, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyNotEqualTo(String value) { |
||||
addCriterion("`key` <>", value, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyGreaterThan(String value) { |
||||
addCriterion("`key` >", value, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyGreaterThanOrEqualTo(String value) { |
||||
addCriterion("`key` >=", value, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyLessThan(String value) { |
||||
addCriterion("`key` <", value, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyLessThanOrEqualTo(String value) { |
||||
addCriterion("`key` <=", value, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyLike(String value) { |
||||
addCriterion("`key` like", value, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyNotLike(String value) { |
||||
addCriterion("`key` not like", value, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyIn(List<String> values) { |
||||
addCriterion("`key` in", values, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyNotIn(List<String> values) { |
||||
addCriterion("`key` not in", values, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyBetween(String value1, String value2) { |
||||
addCriterion("`key` between", value1, value2, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andKeyNotBetween(String value1, String value2) { |
||||
addCriterion("`key` not between", value1, value2, "key"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameIsNull() { |
||||
addCriterion("`name` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameIsNotNull() { |
||||
addCriterion("`name` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameEqualTo(String value) { |
||||
addCriterion("`name` =", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameNotEqualTo(String value) { |
||||
addCriterion("`name` <>", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameGreaterThan(String value) { |
||||
addCriterion("`name` >", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) { |
||||
addCriterion("`name` >=", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameLessThan(String value) { |
||||
addCriterion("`name` <", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) { |
||||
addCriterion("`name` <=", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameLike(String value) { |
||||
addCriterion("`name` like", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameNotLike(String value) { |
||||
addCriterion("`name` not like", value, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameIn(List<String> values) { |
||||
addCriterion("`name` in", values, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameNotIn(List<String> values) { |
||||
addCriterion("`name` not in", values, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameBetween(String value1, String value2) { |
||||
addCriterion("`name` between", value1, value2, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) { |
||||
addCriterion("`name` not between", value1, value2, "name"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdIsNull() { |
||||
addCriterion("specs_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdIsNotNull() { |
||||
addCriterion("specs_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdEqualTo(Long value) { |
||||
addCriterion("specs_id =", value, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdNotEqualTo(Long value) { |
||||
addCriterion("specs_id <>", value, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdGreaterThan(Long value) { |
||||
addCriterion("specs_id >", value, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdGreaterThanOrEqualTo(Long value) { |
||||
addCriterion("specs_id >=", value, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdLessThan(Long value) { |
||||
addCriterion("specs_id <", value, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdLessThanOrEqualTo(Long value) { |
||||
addCriterion("specs_id <=", value, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdIn(List<Long> values) { |
||||
addCriterion("specs_id in", values, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdNotIn(List<Long> values) { |
||||
addCriterion("specs_id not in", values, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdBetween(Long value1, Long value2) { |
||||
addCriterion("specs_id between", value1, value2, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSpecsIdNotBetween(Long value1, Long value2) { |
||||
addCriterion("specs_id not between", value1, value2, "specsId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNull() { |
||||
addCriterion("create_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNotNull() { |
||||
addCriterion("create_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) { |
||||
addCriterion("create_time =", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) { |
||||
addCriterion("create_time <>", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) { |
||||
addCriterion("create_time >", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("create_time >=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) { |
||||
addCriterion("create_time <", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("create_time <=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) { |
||||
addCriterion("create_time in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) { |
||||
addCriterion("create_time not in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("create_time between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("create_time not between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeIsNull() { |
||||
addCriterion("update_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeIsNotNull() { |
||||
addCriterion("update_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeEqualTo(Date value) { |
||||
addCriterion("update_time =", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(Date value) { |
||||
addCriterion("update_time <>", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeGreaterThan(Date value) { |
||||
addCriterion("update_time >", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("update_time >=", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeLessThan(Date value) { |
||||
addCriterion("update_time <", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("update_time <=", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeIn(List<Date> values) { |
||||
addCriterion("update_time in", values, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Date> values) { |
||||
addCriterion("update_time not in", values, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("update_time between", value1, value2, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("update_time not between", value1, value2, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNull() { |
||||
addCriterion("`status` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNotNull() { |
||||
addCriterion("`status` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusEqualTo(Integer value) { |
||||
addCriterion("`status` =", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) { |
||||
addCriterion("`status` <>", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) { |
||||
addCriterion("`status` >", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` >=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThan(Integer value) { |
||||
addCriterion("`status` <", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` <=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIn(List<Integer> values) { |
||||
addCriterion("`status` in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) { |
||||
addCriterion("`status` not in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` not between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNull() { |
||||
addCriterion("ext_1 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNotNull() { |
||||
addCriterion("ext_1 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1EqualTo(String value) { |
||||
addCriterion("ext_1 =", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotEqualTo(String value) { |
||||
addCriterion("ext_1 <>", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThan(String value) { |
||||
addCriterion("ext_1 >", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 >=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThan(String value) { |
||||
addCriterion("ext_1 <", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 <=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Like(String value) { |
||||
addCriterion("ext_1 like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotLike(String value) { |
||||
addCriterion("ext_1 not like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1In(List<String> values) { |
||||
addCriterion("ext_1 in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotIn(List<String> values) { |
||||
addCriterion("ext_1 not in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Between(String value1, String value2) { |
||||
addCriterion("ext_1 between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotBetween(String value1, String value2) { |
||||
addCriterion("ext_1 not between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNull() { |
||||
addCriterion("ext_2 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNotNull() { |
||||
addCriterion("ext_2 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2EqualTo(String value) { |
||||
addCriterion("ext_2 =", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotEqualTo(String value) { |
||||
addCriterion("ext_2 <>", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThan(String value) { |
||||
addCriterion("ext_2 >", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 >=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThan(String value) { |
||||
addCriterion("ext_2 <", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 <=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Like(String value) { |
||||
addCriterion("ext_2 like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotLike(String value) { |
||||
addCriterion("ext_2 not like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2In(List<String> values) { |
||||
addCriterion("ext_2 in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotIn(List<String> values) { |
||||
addCriterion("ext_2 not in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Between(String value1, String value2) { |
||||
addCriterion("ext_2 between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotBetween(String value1, String value2) { |
||||
addCriterion("ext_2 not between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNull() { |
||||
addCriterion("ext_3 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNotNull() { |
||||
addCriterion("ext_3 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3EqualTo(String value) { |
||||
addCriterion("ext_3 =", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotEqualTo(String value) { |
||||
addCriterion("ext_3 <>", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThan(String value) { |
||||
addCriterion("ext_3 >", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 >=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThan(String value) { |
||||
addCriterion("ext_3 <", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 <=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Like(String value) { |
||||
addCriterion("ext_3 like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotLike(String value) { |
||||
addCriterion("ext_3 not like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3In(List<String> values) { |
||||
addCriterion("ext_3 in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotIn(List<String> values) { |
||||
addCriterion("ext_3 not in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Between(String value1, String value2) { |
||||
addCriterion("ext_3 between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotBetween(String value1, String value2) { |
||||
addCriterion("ext_3 not between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,177 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.io.Serializable; |
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* jd_sku |
||||
* @author |
||||
*/ |
||||
/** |
||||
* |
||||
* 代码由工具生成 |
||||
* |
||||
**/ |
||||
public class JdSku implements Serializable { |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Integer id; |
||||
|
||||
/** |
||||
* sku编码 |
||||
*/ |
||||
private String skuId; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
private Date createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
private Date updateTime; |
||||
|
||||
/** |
||||
* 状态 |
||||
*/ |
||||
private Integer status; |
||||
|
||||
/** |
||||
* ext_1 |
||||
*/ |
||||
private String ext1; |
||||
|
||||
/** |
||||
* ext_2 |
||||
*/ |
||||
private String ext2; |
||||
|
||||
/** |
||||
* ext_3 |
||||
*/ |
||||
private String ext3; |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
public Integer getId() { |
||||
return id; |
||||
} |
||||
|
||||
public void setId(Integer id) { |
||||
this.id = id; |
||||
} |
||||
|
||||
public String getSkuId() { |
||||
return skuId; |
||||
} |
||||
|
||||
public void setSkuId(String skuId) { |
||||
this.skuId = skuId; |
||||
} |
||||
|
||||
public Date getCreateTime() { |
||||
return createTime; |
||||
} |
||||
|
||||
public void setCreateTime(Date createTime) { |
||||
this.createTime = createTime; |
||||
} |
||||
|
||||
public Date getUpdateTime() { |
||||
return updateTime; |
||||
} |
||||
|
||||
public void setUpdateTime(Date updateTime) { |
||||
this.updateTime = updateTime; |
||||
} |
||||
|
||||
public Integer getStatus() { |
||||
return status; |
||||
} |
||||
|
||||
public void setStatus(Integer status) { |
||||
this.status = status; |
||||
} |
||||
|
||||
public String getExt1() { |
||||
return ext1; |
||||
} |
||||
|
||||
public void setExt1(String ext1) { |
||||
this.ext1 = ext1; |
||||
} |
||||
|
||||
public String getExt2() { |
||||
return ext2; |
||||
} |
||||
|
||||
public void setExt2(String ext2) { |
||||
this.ext2 = ext2; |
||||
} |
||||
|
||||
public String getExt3() { |
||||
return ext3; |
||||
} |
||||
|
||||
public void setExt3(String ext3) { |
||||
this.ext3 = ext3; |
||||
} |
||||
|
||||
@Override |
||||
public boolean equals(Object that) { |
||||
if (this == that) { |
||||
return true; |
||||
} |
||||
if (that == null) { |
||||
return false; |
||||
} |
||||
if (getClass() != that.getClass()) { |
||||
return false; |
||||
} |
||||
JdSku other = (JdSku) that; |
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) |
||||
&& (this.getSkuId() == null ? other.getSkuId() == null : this.getSkuId().equals(other.getSkuId())) |
||||
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) |
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) |
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) |
||||
&& (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) |
||||
&& (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) |
||||
&& (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); |
||||
} |
||||
|
||||
@Override |
||||
public int hashCode() { |
||||
final int prime = 31; |
||||
int result = 1; |
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); |
||||
result = prime * result + ((getSkuId() == null) ? 0 : getSkuId().hashCode()); |
||||
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); |
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); |
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); |
||||
result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); |
||||
result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); |
||||
result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public String toString() { |
||||
StringBuilder sb = new StringBuilder(); |
||||
sb.append(getClass().getSimpleName()); |
||||
sb.append(" ["); |
||||
sb.append("Hash = ").append(hashCode()); |
||||
sb.append(", id=").append(id); |
||||
sb.append(", skuId=").append(skuId); |
||||
sb.append(", createTime=").append(createTime); |
||||
sb.append(", updateTime=").append(updateTime); |
||||
sb.append(", status=").append(status); |
||||
sb.append(", ext1=").append(ext1); |
||||
sb.append(", ext2=").append(ext2); |
||||
sb.append(", ext3=").append(ext3); |
||||
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
sb.append("]"); |
||||
return sb.toString(); |
||||
} |
||||
} |
@ -0,0 +1,743 @@ |
||||
package com.hfkj.entity; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
public class JdSkuExample { |
||||
protected String orderByClause; |
||||
|
||||
protected boolean distinct; |
||||
|
||||
protected List<Criteria> oredCriteria; |
||||
|
||||
private Integer limit; |
||||
|
||||
private Long offset; |
||||
|
||||
public JdSkuExample() { |
||||
oredCriteria = new ArrayList<Criteria>(); |
||||
} |
||||
|
||||
public void setOrderByClause(String orderByClause) { |
||||
this.orderByClause = orderByClause; |
||||
} |
||||
|
||||
public String getOrderByClause() { |
||||
return orderByClause; |
||||
} |
||||
|
||||
public void setDistinct(boolean distinct) { |
||||
this.distinct = distinct; |
||||
} |
||||
|
||||
public boolean isDistinct() { |
||||
return distinct; |
||||
} |
||||
|
||||
public List<Criteria> getOredCriteria() { |
||||
return oredCriteria; |
||||
} |
||||
|
||||
public void or(Criteria criteria) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
|
||||
public Criteria or() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
oredCriteria.add(criteria); |
||||
return criteria; |
||||
} |
||||
|
||||
public Criteria createCriteria() { |
||||
Criteria criteria = createCriteriaInternal(); |
||||
if (oredCriteria.size() == 0) { |
||||
oredCriteria.add(criteria); |
||||
} |
||||
return criteria; |
||||
} |
||||
|
||||
protected Criteria createCriteriaInternal() { |
||||
Criteria criteria = new Criteria(); |
||||
return criteria; |
||||
} |
||||
|
||||
public void clear() { |
||||
oredCriteria.clear(); |
||||
orderByClause = null; |
||||
distinct = false; |
||||
} |
||||
|
||||
public void setLimit(Integer limit) { |
||||
this.limit = limit; |
||||
} |
||||
|
||||
public Integer getLimit() { |
||||
return limit; |
||||
} |
||||
|
||||
public void setOffset(Long offset) { |
||||
this.offset = offset; |
||||
} |
||||
|
||||
public Long getOffset() { |
||||
return offset; |
||||
} |
||||
|
||||
protected abstract static class GeneratedCriteria { |
||||
protected List<Criterion> criteria; |
||||
|
||||
protected GeneratedCriteria() { |
||||
super(); |
||||
criteria = new ArrayList<Criterion>(); |
||||
} |
||||
|
||||
public boolean isValid() { |
||||
return criteria.size() > 0; |
||||
} |
||||
|
||||
public List<Criterion> getAllCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
public List<Criterion> getCriteria() { |
||||
return criteria; |
||||
} |
||||
|
||||
protected void addCriterion(String condition) { |
||||
if (condition == null) { |
||||
throw new RuntimeException("Value for condition cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value, String property) { |
||||
if (value == null) { |
||||
throw new RuntimeException("Value for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value)); |
||||
} |
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) { |
||||
if (value1 == null || value2 == null) { |
||||
throw new RuntimeException("Between values for " + property + " cannot be null"); |
||||
} |
||||
criteria.add(new Criterion(condition, value1, value2)); |
||||
} |
||||
|
||||
public Criteria andIdIsNull() { |
||||
addCriterion("id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIsNotNull() { |
||||
addCriterion("id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdEqualTo(Integer value) { |
||||
addCriterion("id =", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotEqualTo(Integer value) { |
||||
addCriterion("id <>", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThan(Integer value) { |
||||
addCriterion("id >", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("id >=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThan(Integer value) { |
||||
addCriterion("id <", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Integer value) { |
||||
addCriterion("id <=", value, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdIn(List<Integer> values) { |
||||
addCriterion("id in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotIn(List<Integer> values) { |
||||
addCriterion("id not in", values, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdBetween(Integer value1, Integer value2) { |
||||
addCriterion("id between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andIdNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("id not between", value1, value2, "id"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdIsNull() { |
||||
addCriterion("sku_id is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdIsNotNull() { |
||||
addCriterion("sku_id is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdEqualTo(String value) { |
||||
addCriterion("sku_id =", value, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdNotEqualTo(String value) { |
||||
addCriterion("sku_id <>", value, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdGreaterThan(String value) { |
||||
addCriterion("sku_id >", value, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdGreaterThanOrEqualTo(String value) { |
||||
addCriterion("sku_id >=", value, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdLessThan(String value) { |
||||
addCriterion("sku_id <", value, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdLessThanOrEqualTo(String value) { |
||||
addCriterion("sku_id <=", value, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdLike(String value) { |
||||
addCriterion("sku_id like", value, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdNotLike(String value) { |
||||
addCriterion("sku_id not like", value, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdIn(List<String> values) { |
||||
addCriterion("sku_id in", values, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdNotIn(List<String> values) { |
||||
addCriterion("sku_id not in", values, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdBetween(String value1, String value2) { |
||||
addCriterion("sku_id between", value1, value2, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andSkuIdNotBetween(String value1, String value2) { |
||||
addCriterion("sku_id not between", value1, value2, "skuId"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNull() { |
||||
addCriterion("create_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIsNotNull() { |
||||
addCriterion("create_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeEqualTo(Date value) { |
||||
addCriterion("create_time =", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotEqualTo(Date value) { |
||||
addCriterion("create_time <>", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThan(Date value) { |
||||
addCriterion("create_time >", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("create_time >=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThan(Date value) { |
||||
addCriterion("create_time <", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("create_time <=", value, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeIn(List<Date> values) { |
||||
addCriterion("create_time in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotIn(List<Date> values) { |
||||
addCriterion("create_time not in", values, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("create_time between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andCreateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("create_time not between", value1, value2, "createTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeIsNull() { |
||||
addCriterion("update_time is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeIsNotNull() { |
||||
addCriterion("update_time is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeEqualTo(Date value) { |
||||
addCriterion("update_time =", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(Date value) { |
||||
addCriterion("update_time <>", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeGreaterThan(Date value) { |
||||
addCriterion("update_time >", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { |
||||
addCriterion("update_time >=", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeLessThan(Date value) { |
||||
addCriterion("update_time <", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { |
||||
addCriterion("update_time <=", value, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeIn(List<Date> values) { |
||||
addCriterion("update_time in", values, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeNotIn(List<Date> values) { |
||||
addCriterion("update_time not in", values, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeBetween(Date value1, Date value2) { |
||||
addCriterion("update_time between", value1, value2, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { |
||||
addCriterion("update_time not between", value1, value2, "updateTime"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNull() { |
||||
addCriterion("`status` is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIsNotNull() { |
||||
addCriterion("`status` is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusEqualTo(Integer value) { |
||||
addCriterion("`status` =", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) { |
||||
addCriterion("`status` <>", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) { |
||||
addCriterion("`status` >", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` >=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThan(Integer value) { |
||||
addCriterion("`status` <", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) { |
||||
addCriterion("`status` <=", value, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusIn(List<Integer> values) { |
||||
addCriterion("`status` in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) { |
||||
addCriterion("`status` not in", values, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) { |
||||
addCriterion("`status` not between", value1, value2, "status"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNull() { |
||||
addCriterion("ext_1 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1IsNotNull() { |
||||
addCriterion("ext_1 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1EqualTo(String value) { |
||||
addCriterion("ext_1 =", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotEqualTo(String value) { |
||||
addCriterion("ext_1 <>", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThan(String value) { |
||||
addCriterion("ext_1 >", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 >=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThan(String value) { |
||||
addCriterion("ext_1 <", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_1 <=", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Like(String value) { |
||||
addCriterion("ext_1 like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotLike(String value) { |
||||
addCriterion("ext_1 not like", value, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1In(List<String> values) { |
||||
addCriterion("ext_1 in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotIn(List<String> values) { |
||||
addCriterion("ext_1 not in", values, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1Between(String value1, String value2) { |
||||
addCriterion("ext_1 between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt1NotBetween(String value1, String value2) { |
||||
addCriterion("ext_1 not between", value1, value2, "ext1"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNull() { |
||||
addCriterion("ext_2 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2IsNotNull() { |
||||
addCriterion("ext_2 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2EqualTo(String value) { |
||||
addCriterion("ext_2 =", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotEqualTo(String value) { |
||||
addCriterion("ext_2 <>", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThan(String value) { |
||||
addCriterion("ext_2 >", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 >=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThan(String value) { |
||||
addCriterion("ext_2 <", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_2 <=", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Like(String value) { |
||||
addCriterion("ext_2 like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotLike(String value) { |
||||
addCriterion("ext_2 not like", value, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2In(List<String> values) { |
||||
addCriterion("ext_2 in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotIn(List<String> values) { |
||||
addCriterion("ext_2 not in", values, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2Between(String value1, String value2) { |
||||
addCriterion("ext_2 between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt2NotBetween(String value1, String value2) { |
||||
addCriterion("ext_2 not between", value1, value2, "ext2"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNull() { |
||||
addCriterion("ext_3 is null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3IsNotNull() { |
||||
addCriterion("ext_3 is not null"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3EqualTo(String value) { |
||||
addCriterion("ext_3 =", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotEqualTo(String value) { |
||||
addCriterion("ext_3 <>", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThan(String value) { |
||||
addCriterion("ext_3 >", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3GreaterThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 >=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThan(String value) { |
||||
addCriterion("ext_3 <", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3LessThanOrEqualTo(String value) { |
||||
addCriterion("ext_3 <=", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Like(String value) { |
||||
addCriterion("ext_3 like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotLike(String value) { |
||||
addCriterion("ext_3 not like", value, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3In(List<String> values) { |
||||
addCriterion("ext_3 in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotIn(List<String> values) { |
||||
addCriterion("ext_3 not in", values, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3Between(String value1, String value2) { |
||||
addCriterion("ext_3 between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
|
||||
public Criteria andExt3NotBetween(String value1, String value2) { |
||||
addCriterion("ext_3 not between", value1, value2, "ext3"); |
||||
return (Criteria) this; |
||||
} |
||||
} |
||||
|
||||
/** |
||||
*/ |
||||
public static class Criteria extends GeneratedCriteria { |
||||
|
||||
protected Criteria() { |
||||
super(); |
||||
} |
||||
} |
||||
|
||||
public static class Criterion { |
||||
private String condition; |
||||
|
||||
private Object value; |
||||
|
||||
private Object secondValue; |
||||
|
||||
private boolean noValue; |
||||
|
||||
private boolean singleValue; |
||||
|
||||
private boolean betweenValue; |
||||
|
||||
private boolean listValue; |
||||
|
||||
private String typeHandler; |
||||
|
||||
public String getCondition() { |
||||
return condition; |
||||
} |
||||
|
||||
public Object getValue() { |
||||
return value; |
||||
} |
||||
|
||||
public Object getSecondValue() { |
||||
return secondValue; |
||||
} |
||||
|
||||
public boolean isNoValue() { |
||||
return noValue; |
||||
} |
||||
|
||||
public boolean isSingleValue() { |
||||
return singleValue; |
||||
} |
||||
|
||||
public boolean isBetweenValue() { |
||||
return betweenValue; |
||||
} |
||||
|
||||
public boolean isListValue() { |
||||
return listValue; |
||||
} |
||||
|
||||
public String getTypeHandler() { |
||||
return typeHandler; |
||||
} |
||||
|
||||
protected Criterion(String condition) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.typeHandler = null; |
||||
this.noValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.typeHandler = typeHandler; |
||||
if (value instanceof List<?>) { |
||||
this.listValue = true; |
||||
} else { |
||||
this.singleValue = true; |
||||
} |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value) { |
||||
this(condition, value, null); |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { |
||||
super(); |
||||
this.condition = condition; |
||||
this.value = value; |
||||
this.secondValue = secondValue; |
||||
this.typeHandler = typeHandler; |
||||
this.betweenValue = true; |
||||
} |
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) { |
||||
this(condition, value, secondValue, null); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,19 @@ |
||||
package com.hfkj.model.discount; |
||||
|
||||
import com.hfkj.entity.CouponDiscountUserRel; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class CouponDiscountUserRelModel extends CouponDiscountUserRel { |
||||
|
||||
/** |
||||
* 优惠券来源 |
||||
*/ |
||||
private Integer source; |
||||
|
||||
/** |
||||
* 优惠券编号 |
||||
*/ |
||||
private String discountNo; |
||||
|
||||
} |
@ -0,0 +1,68 @@ |
||||
package com.hfkj.service.goods; |
||||
|
||||
|
||||
import com.hfkj.entity.GoodPresent; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
public interface GoodPresentService { |
||||
|
||||
/** |
||||
* @Author Sum1Dream |
||||
* @Name create |
||||
* @Description // 创建
|
||||
* @Date 15:12 2024/4/19 |
||||
* @Param GoodsBrand |
||||
* @return void |
||||
*/ |
||||
void create(GoodPresent goodPresent); |
||||
|
||||
/** |
||||
* @MethodName update |
||||
* @Description: 更新 |
||||
* @param goodPresent |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/18 下午3:39 |
||||
*/ |
||||
void update(GoodPresent goodPresent); |
||||
|
||||
/** |
||||
* @MethodName findById |
||||
* @Description: |
||||
* @param id |
||||
* @return: com.hfkj.entity.GoodPresent |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/18 下午3:38 |
||||
*/ |
||||
GoodPresent findById(Long id); |
||||
|
||||
/** |
||||
* @MethodName getList |
||||
* @Description: 查询列表 |
||||
* @param map |
||||
* @return: java.util.List<com.hfkj.entity.GoodPresent> |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/18 下午3:39 |
||||
*/ |
||||
List<GoodPresent> getList(Map<String , Object> map); |
||||
|
||||
/** |
||||
* @MethodName delete |
||||
* @Description: 删除 |
||||
* @param id |
||||
* @param fullDelete |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/18 下午3:42 |
||||
*/ |
||||
void delete(Long id , Boolean fullDelete); |
||||
|
||||
/** |
||||
* @MethodName PresentDiscountPackage |
||||
* @Description: |
||||
* @param specsId |
||||
* @Author: Sum1Dream |
||||
* @Date: 2024/12/30 下午3:47 |
||||
*/ |
||||
void presentDiscountPackage(Long specsId, String phone) throws Exception; |
||||
} |
@ -0,0 +1,86 @@ |
||||
package com.hfkj.service.goods.impl; |
||||
|
||||
import com.hfkj.dao.GoodPresentMapper; |
||||
import com.hfkj.entity.CouponDiscountPackage; |
||||
import com.hfkj.entity.GoodPresent; |
||||
import com.hfkj.entity.GoodPresentExample; |
||||
import com.hfkj.entity.GoodsBrand; |
||||
import com.hfkj.haioil.HaiOilService; |
||||
import com.hfkj.service.discount.CouponDiscountPackageService; |
||||
import com.hfkj.service.goods.GoodPresentService; |
||||
import org.apache.commons.collections4.MapUtils; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.util.*; |
||||
|
||||
@Service("goodPresentService") |
||||
public class GoodPresentServiceImpl implements GoodPresentService { |
||||
|
||||
@Resource |
||||
private GoodPresentMapper goodPresentMapper; |
||||
|
||||
@Resource |
||||
private CouponDiscountPackageService couponDiscountPackageService; |
||||
|
||||
@Override |
||||
public void create(GoodPresent goodPresent) { |
||||
goodPresentMapper.insert(goodPresent); |
||||
} |
||||
|
||||
@Override |
||||
public void update(GoodPresent goodPresent) { |
||||
goodPresentMapper.updateByPrimaryKey(goodPresent); |
||||
} |
||||
|
||||
@Override |
||||
public GoodPresent findById(Long id) { |
||||
return goodPresentMapper.selectByPrimaryKey(id); |
||||
} |
||||
|
||||
@Override |
||||
public List<GoodPresent> getList(Map<String, Object> map) { |
||||
GoodPresentExample example = new GoodPresentExample(); |
||||
GoodPresentExample.Criteria criteria = example.createCriteria(); |
||||
|
||||
if (MapUtils.getLong(map, "specsId") != null) { |
||||
criteria.andSpecsIdEqualTo(MapUtils.getLong(map, "specsId")); |
||||
} |
||||
criteria.andStatusNotEqualTo(0); |
||||
|
||||
return goodPresentMapper.selectByExample(example); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(Long id, Boolean fullDelete) { |
||||
if (fullDelete) { |
||||
goodPresentMapper.deleteByPrimaryKey(id); |
||||
} else { |
||||
GoodPresent goodPresent = findById(id); |
||||
goodPresent.setStatus(0); |
||||
goodPresent.setUpdateTime(new Date()); |
||||
update(goodPresent); |
||||
} |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public void presentDiscountPackage(Long specsId , String phone) throws Exception { |
||||
Map<String , Object> map = new HashMap<>(); |
||||
map.put("specsId",specsId); |
||||
List<GoodPresent> list = getList(map); |
||||
|
||||
for (GoodPresent goodPresent : list) { |
||||
if (goodPresent.getType() == 1) { |
||||
CouponDiscountPackage discountPackage = couponDiscountPackageService.findDiscountPackageByKey(goodPresent.getKey()); |
||||
couponDiscountPackageService.giveDiscountPackage(discountPackage.getId().intValue() , phone); |
||||
} else { |
||||
map.put("discountPkNo" , goodPresent.getKey()); |
||||
map.put("number" , 1); |
||||
map.put("phone" , phone); |
||||
HaiOilService.pushPk(map); |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue