Commit 828745b3 by 张新旗

代码永远在路上

parent 5a6d6601
......@@ -50,13 +50,13 @@ public class AppController extends BaseController {
}
@RequestMapping("/getHomeOrder")
public AjaxResult getHomeOrder(HttpServletRequest request){
public AjaxResult getHomeOrder(HttpServletRequest request,String shopId){
LoginUser loginUser = tokenService.getLoginUser(request);
if(loginUser ==null){
return AjaxResult.success();
}
String openId = loginUser.getOpenId();
Map<String,String> info = orderService.getMyFristOrder(openId);
Map<String,String> info = orderService.getMyFristOrder(openId,shopId);
return AjaxResult.success("操作成功",info);
}
@RequestMapping("/getWaitTine")
......
......@@ -2,6 +2,7 @@ package com.soss.web.controller.coffee;
import java.util.List;
import com.soss.common.exception.ServiceException;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -46,7 +47,12 @@ public class GoodsController extends BaseController
*/
@GetMapping("/putShop")
public AjaxResult putShop(@RequestParam("goodsId") Long goodsId, @RequestParam("boo") boolean boo){
try{
return AjaxResult.success(goodsService.putShop(goodsId,boo));
}catch (ServiceException serviceException){
return AjaxResult.error(99,serviceException.getMessage());
}
}
/**
......
......@@ -101,9 +101,9 @@ weixin:
# REFLC7NYqwUo9KpvvmWv
sms:
aliyun:
accessKeyId:
accessKeySecret:
signName:
accessKeyId: LTAI5tEBoPGkpG6qy39h9dWj
accessKeySecret: B9c9aTIG5pmHWnlaRl4gGB12qmBtB4
signName: 深圳好饮
push:
appkey: 59c9290134b359212290c075
secret: 026756e7d5688089898db088
......
......@@ -57,6 +57,18 @@ public class Spec extends BaseEntity
@Excel(name = "规格编码")
private String code;
@Override
public String getRemark() {
return remark;
}
@Override
public void setRemark(String remark) {
this.remark = remark;
}
private String remark;
private List<SpecRule> specRules;
public List<SpecRule> getSpecRules() {
......
......@@ -2,6 +2,8 @@ package com.soss.system.mapper;
import java.util.List;
import com.soss.system.domain.Goods;
import com.soss.system.domain.GoodsSku;
import org.apache.ibatis.annotations.Param;
/**
* 商品Mapper接口
......@@ -60,4 +62,10 @@ public interface GoodsMapper
public int deleteGoodsByIds(String[] ids);
Integer selectCount(String id);
List<Goods> selectSpec(String query);
List<Goods> selectSpecNoState(@Param("query") String query, @Param("state") String s);
void updateGoodsSpec(long id);
}
......@@ -74,9 +74,13 @@ public interface OrderMapper
List<Order> selectOrderByShopId(@Param("status") List<String> status,@Param("shopId") String shopId);
Order selectHomeByUserId(@Param("userId") String openId,@Param("status") List<String> status);
Order selectHomeByUserId(@Param("userId") String openId, @Param("status") List<String> status, @Param("shopId") String shopId);
void updateTimeOut(@Param("status") String productionCompleted,@Param("timeout") String timeout);
List<Order> selectOrderByUserId(@Param("userId") String openId,@Param("status") List<String> status);
void updateCancel(@Param("status") String unpaid, @Param("timeout") int i);
List<Order> selectOrderByTime(@Param("status")String unpaid, @Param("timeout")int i);
}
......@@ -2,21 +2,46 @@ package com.soss.system.schedule;
import com.soss.system.constants.OrderStatusConstant;
import com.soss.system.domain.Order;
import com.soss.system.domain.OrderOperationLog;
import com.soss.system.mapper.OrderMapper;
import com.soss.system.mapper.OrderOperationLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
@Component
public class OrderSchedule {
@Autowired
private OrderMapper orderMapper;
@Value("${timeout}")
private String timeout;
@Autowired
private OrderOperationLogMapper operationLogMapper;
@Scheduled(fixedDelay = 60*1000)
private void process() {
orderMapper.updateTimeOut(OrderStatusConstant.productionCompleted,timeout);
//orderMapper.updateCancel(OrderStatusConstant.Unpaid,15);
List<Order> orders = orderMapper.selectOrderByTime(OrderStatusConstant.Unpaid, 15);
if(orders!=null &&orders.size()>0){
for (Order order : orders) {
order.setState(OrderStatusConstant.UnpaidCancel);
order.setUpdatedAt(new Date());
orderMapper.updateOrder(order);
OrderOperationLog operationLog =new OrderOperationLog();
operationLog.setOperationUser("系统");
operationLog.setStatus("已取消");
operationLog.setOrderId(String.valueOf(order.getId()));
operationLog.setContent("超时自动取消");
operationLog.setCreateAt(new Date());
operationLog.setOperation("取消订单");
operationLogMapper.insertOrderOperationLog(operationLog);
}
}
}
}
......@@ -98,7 +98,7 @@ public class GoodsServiceImpl implements IGoodsService
@Transactional
public int insertGoods(Goods goods)
{
if(goods.getDiscount().compareTo(goods.getPrice())>0){
if(goods.getDiscount().compareTo(goods.getPrice())>=0){
throw new ServiceException("折扣价不能大于等于原价");
}
goods.setCode(GenerateCode.getCode("G"));
......@@ -261,6 +261,12 @@ public class GoodsServiceImpl implements IGoodsService
@Override
public String putShop(Long goodsId, boolean boo) {
GoodsSku goodsSku =new GoodsSku();
goodsSku.setGoodsId(goodsId);
List<GoodsSku> goodsSkus = goodsSkuMapper.selectGoodsSkuList(goodsSku);
if(goodsSkus.isEmpty()){
throw new ServiceException("商品信息不全,请修改商品");
}
Goods goods = new Goods();
goods.setId(goodsId);
goods.setState("3");
......
......@@ -72,7 +72,8 @@ public class MachineApiServiceImpl {
shopGoodsSku.setSkuId(Long.parseLong(skuId));
List<ShopGoodsSku> shopGoodsSkus = shopGoodsSkuMapper.selectShopGoodsSkuList(shopGoodsSku);
if(shopGoodsSkus.isEmpty()){
throw new ServiceException(skuId+"不存在");
log.info("当前sku【{}】不存在",skuId);
//throw new ServiceException(skuId+"不存在");
}
for (ShopGoodsSku goodsSkus : shopGoodsSkus) {
Long goodsId = goodsSkus.getGoodsId();
......
......@@ -100,7 +100,7 @@ public class OrderRefundServiceImpl implements IOrderRefundService
}
// 制作中、制作完成、聚餐中、已完成
String state = order.getState();
List<String> status = Arrays.asList(OrderStatusConstant.production,OrderStatusConstant.productionCompleted,OrderStatusConstant.Taking,OrderStatusConstant.completed);
List<String> status = Arrays.asList(OrderStatusConstant.production,OrderStatusConstant.productionCompleted,OrderStatusConstant.Taking,OrderStatusConstant.completed,OrderStatusConstant.timeout);
if(OrderStatusConstant.Paid.equals(state)){
orderRefund.setRefundAmount(order.getAmount());
// 4 支付制作中 5 制作完成未取 6 取餐中 7 取餐完成
......
......@@ -69,6 +69,8 @@ public class OrderServiceImpl implements IOrderService
private SendMessageUtils sendMessageUtils;
@Autowired
private OrderTakingServiceImpl orderTakingService;
@Autowired
private CustomerMapper customerMapper;
......@@ -243,6 +245,11 @@ public class OrderServiceImpl implements IOrderService
order.setFinishTime(new Date());
orderOperationLogService.insertOrderOperationLog(order);
jiGuangPushService.pushOrderState(order);
Customer customer = customerMapper.selectCustomerById(order.getUserId());
if(!"1".equals(customer.getAllow())){
}
}
/**
......@@ -426,10 +433,10 @@ public class OrderServiceImpl implements IOrderService
String redisKey = "shopId"+format+shopId;
RedisAtomicInteger redisAtomicInteger = new RedisAtomicInteger(redisKey,SpringUtils.getBean(StringRedisTemplate.class).getConnectionFactory());
if(0 == redisAtomicInteger.get()){
redisAtomicInteger.set(30);
redisAtomicInteger.set((int)(1000*Math.random()));
}
redisAtomicInteger.expire(1, TimeUnit.DAYS);
int andIncrement = redisAtomicInteger.getAndIncrement();
int andIncrement = redisAtomicInteger.getAndAdd(3);
return key+String.format("%03d",andIncrement);
}
//获取订单号
......@@ -495,9 +502,9 @@ public class OrderServiceImpl implements IOrderService
return null;
}
public Map<String,String> getMyFristOrder(String openId) {
public Map<String,String> getMyFristOrder(String openId,String shopId) {
List<String> status = Arrays.asList("2","3","4","7");
Order order = orderMapper.selectHomeByUserId(openId,status);
Order order = orderMapper.selectHomeByUserId(openId,status,shopId);
if(order ==null){
return null;
}
......
......@@ -4,9 +4,11 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import com.soss.system.domain.Goods;
import com.soss.system.domain.Machine;
import com.soss.system.domain.ShopGoods;
import com.soss.system.jiguang.impl.JiGuangPushServiceImpl;
import com.soss.system.mapper.GoodsCategoryMapper;
import com.soss.system.mapper.MachineMapper;
import com.soss.system.mapper.OrderMapper;
......@@ -33,6 +35,8 @@ public class ShopRecommendServiceImpl implements IShopRecommendService
private OrderMapper orderMapper;
@Autowired
private GoodsCategoryMapper goodsCategoryMapper;
@Autowired
private JiGuangPushServiceImpl jiGuangPushService;
/**
* 查询推荐和今日特惠
......@@ -78,10 +82,24 @@ public class ShopRecommendServiceImpl implements IShopRecommendService
shopRecommend.setCreatedAt(new Date());
shopRecommend.setRecDate(new Date());
shopRecommendMapper.insertShopRecommend(shopRecommend);
updateApplication(Long.parseLong(shopRecommend.getShopId()));
shopRecommend.setTurn(shopRecommend.getId());
return shopRecommendMapper.updateShopRecommend(shopRecommend);
}
public void updateApplication(long shopId){
Machine machine = new Machine();
machine.setShopId(shopId);
List<Machine> machines = machineMapper.selectMachineList(machine);
if(!machines.isEmpty()){
JSONObject jsonObject = new JSONObject();
jsonObject.put("action","GOODS_CHANGED");
jsonObject.put("timestamp",System.currentTimeMillis());
jiGuangPushService.push(machines.get(0).getCode(),jsonObject);
}
}
/**
* 修改推荐和今日特惠
*
......@@ -166,6 +184,7 @@ public class ShopRecommendServiceImpl implements IShopRecommendService
shopRecommend.setType(type);
shopRecommend.setGoodsId(goodsId);
ShopRecommend frist = shopRecommendMapper.selectShopRecommendList(shopRecommend).get(0);
updateApplication(Long.parseLong(shopRecommend.getShopId()));
return shopRecommendMapper.deleteShopRecommendById(frist.getId());
}
......
package com.soss.system.service.impl;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.soss.common.core.domain.AjaxResult;
import com.soss.common.exception.ServiceException;
import com.soss.common.utils.StringUtils;
import com.soss.system.domain.*;
import com.soss.system.domain.vo.orderTaking.*;
import com.soss.system.jiguang.impl.JiGuangPushServiceImpl;
import com.soss.system.service.IShopService;
import com.soss.system.mapper.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.core.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
/**
* 店铺Service业务层处理
......@@ -48,6 +52,10 @@ public class ShopServiceImpl implements IShopService
@Autowired
private ShopRecommendMapper shopRecommendMapper;
@Autowired
private JiGuangPushServiceImpl jiGuangPushService;
@Autowired
private GoodsTagMapper goodsTagMapper;
......@@ -191,10 +199,16 @@ public class ShopServiceImpl implements IShopService
shopGoodsSku.setUpdatedAt(new Date());
shopGoodsSkuMapper.insertShopGoodsSku(shopGoodsSku);
}
updateApplication(machine1.getCode());
}
return null;
}
public void updateApplication(String code){
JSONObject jsonObject = new JSONObject();
jsonObject.put("action","GOODS_CHANGED");
jsonObject.put("timestamp",System.currentTimeMillis());
jiGuangPushService.push(code,jsonObject);
}
@Override
public List<GoodsCategory> getCategoryGoods(long shopId) {
......@@ -312,6 +326,13 @@ public class ShopServiceImpl implements IShopService
shopGoodsSkuMapper.deleteByGoodsIds(shopId,goodsIds);
shopGoodsMapper.deleteByShopIdGoods(shopId,goodsIds);
shopRecommendMapper.deleteByShopIdGoods(shopId,goodsIds);
Machine machine = new Machine();
machine.setShopId(shopId);
List<Machine> machines = machineMapper.selectMachineList(machine);
if(!machines.isEmpty()){
Machine machine1 =machines .get(0);
updateApplication(machine1.getCode());
}
return null;
}
......@@ -356,13 +377,92 @@ public class ShopServiceImpl implements IShopService
return AjaxResult.error("该产品已经不存在");
}else{
ShopGoodsSku shopGoodsSku1 = shopGoodsSkus.get(0);
if(!"1".equals(shopGoodsSku1.getState())){
return AjaxResult.error("该产品已经告罄");
}
JSONObject jsonObject = new JSONObject();
jsonObject.put("state",shopGoodsSku1.getState());
Goods goods = goodsMapper.selectGoodsById(String.valueOf(shopGoodsSku1.getGoodsId()));
jsonObject.put("goods",getGoodsVo(goods,shopGoodsSku1.getShopId()));
AjaxResult.success(jsonObject);
}
return AjaxResult.success();
}
public GoodsVo getGoodsVo(Goods good,Long shopId){
GoodsVo goodsVo =new GoodsVo();
goodsVo.setGoodsId(String.valueOf(good.getId()));
goodsVo.setName(good.getName());
goodsVo.setDesc(good.getDesc());
goodsVo.setDiscount(good.getDiscount().stripTrailingZeros().toPlainString());
goodsVo.setPrice(good.getPrice().stripTrailingZeros().toPlainString());
goodsVo.setPics(JSONObject.parseObject(good.getPics()));
goodsVo.setRemarks(good.getRemarks());
goodsVo.setSpecs(buildGoodsSpec(good.getSpec()));
goodsVo.setSpecString(null);
GoodsTag goodsTag = new GoodsTag();
goodsTag.setState("1");
goodsTag.setGoodsId(Long.parseLong(goodsVo.getGoodsId()));
List<GoodsTag> goodsTags = goodsTagMapper.selectGoodsTagList(goodsTag);
List<String> tags = goodsTags.stream().map(GoodsTag::getTag).collect(Collectors.toList());
goodsVo.setTags(tags);
//获取产品信息
List<SkuVo> skuVos = shopGoodsSkuMapper.selectSkuByGoodAndShop(shopId, goodsVo.getGoodsId());
buildSkuRules(skuVos);
goodsVo.setSkus(skuVos);
return goodsVo;
}
private JSONArray buildGoodsSpec(String specs) {
List<Spec> specList = JSONObject.parseArray(specs,Spec.class);
List<SpecVo> specVos = new ArrayList<>();
for (Spec spec : specList) {
SpecVo specVo = new SpecVo();
specVos.add(specVo);
specVo.setSpecId(String.valueOf(spec.getId()));
specVo.setSpecName(spec.getName());
List<SpecRuleVo> specRuleVos = new ArrayList<>();
specVo.setRules(specRuleVos);
for (SpecRule specRule : spec.getSpecRules()) {
SpecRuleVo specRuleVo = new SpecRuleVo();
specRuleVos.add(specRuleVo);
specRuleVo.setRuleId(String.valueOf(specRule.getId()));
specRuleVo.setPrice(specRule.getAmount().stripTrailingZeros().toPlainString());
specRuleVo.setRuleName(specRule.getName());
specRuleVo.setIsDefault(String.valueOf(specRule.getIsDefault()));
specRuleVo.setIsRecommend(specRule.getIsRecommend());
}
}
return JSONArray.parseArray(JSONObject.toJSONString(specVos));
}
private void buildSkuRules(List<SkuVo> skuVos) {
if(CollectionUtils.isEmpty(skuVos)){
return;
}
for (SkuVo skuVo : skuVos) {
String rules = skuVo.getRulesString();
List<SpecRule> specRuleList = JSONObject.parseArray(rules, SpecRule.class);
boolean boo =true;
List<SkuRuleVo> skuRuleVos = new ArrayList<>();
for (SpecRule specRule : specRuleList) {
SkuRuleVo skuRuleVo = new SkuRuleVo();
skuRuleVos.add(skuRuleVo);
skuRuleVo.setPrice(specRule.getAmount().stripTrailingZeros().toPlainString());
skuRuleVo.setRuleId(String.valueOf(specRule.getId()));
skuRuleVo.setSpecId(String.valueOf(specRule.getSpecId()));
skuRuleVo.setRuleName(specRule.getName());
if(0L == specRule.getIsDefault()){
boo =false;
}
}
skuVo.setIsDefault("0");
if(boo){
skuVo.setIsDefault("1");
}
skuVo.setRules(JSONObject.parseArray(JSONObject.toJSONString(skuRuleVos)));
skuVo.setRulesString(null);
}
}
}
......@@ -5,17 +5,11 @@ import java.util.List;
import com.soss.common.exception.ServiceException;
import com.soss.common.utils.GenerateCode;
import com.soss.system.domain.GoodsSku;
import com.soss.system.domain.SpecRule;
import com.soss.system.domain.SpecRuleMaterial;
import com.soss.system.mapper.GoodsSkuMapper;
import com.soss.system.domain.*;
import com.soss.system.mapper.*;
import com.soss.system.service.ISpecService;
import com.soss.system.mapper.SpecRuleMapper;
import com.soss.system.mapper.SpecRuleMaterialMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.soss.system.mapper.SpecMapper;
import com.soss.system.domain.Spec;
import org.springframework.transaction.annotation.Transactional;
/**
......@@ -35,6 +29,8 @@ public class SpecServiceImpl implements ISpecService
private SpecRuleMaterialMapper specRuleMaterialMapper;
@Autowired
private GoodsSkuMapper goodsSkuMapper;
@Autowired
private GoodsMapper goodsMapper;
/**
* 查询规格
......@@ -139,13 +135,17 @@ public class SpecServiceImpl implements ISpecService
@Override
public int updateSpec(Spec spec)
{
if(2 == spec.getState()){
/**
* where
* is_deleted ='0' and
* rule_list like concat('%',#{query},'%')
*/
String query ="\"specId\": "+spec.getId();
List<GoodsSku> goodsSkus = goodsSkuMapper.selectSpec(query);
if(!goodsSkus.isEmpty()){
List<Goods> goods = goodsMapper.selectSpec(query);
if(!goods.isEmpty()){
throw new ServiceException("当前还有商品使用,请先删除商品");
}
}
spec.setIsDeleted(0);
spec.setUpdatedAt(new Date());
int i = specMapper.updateSpec(spec);
......@@ -160,7 +160,7 @@ public class SpecServiceImpl implements ISpecService
}else{
spec.setIsShow(0L);
}
deleteGoodsSku(String.valueOf(spec.getId()));
long specId = spec.getId();
if(spec.getIsShow()==1L){
for (SpecRule specRule : specRules) {
......@@ -208,7 +208,8 @@ public class SpecServiceImpl implements ISpecService
{
String query ="\"specId\": "+id;
List<GoodsSku> goodsSkus = goodsSkuMapper.selectSpec(query);
if(!goodsSkus.isEmpty()){
List<Goods> goods = goodsMapper.selectSpec(query);
if(!goods.isEmpty()){
throw new ServiceException("当前还有商品使用,请先删除商品");
}
long specId = Long.parseLong(id);
......@@ -217,6 +218,23 @@ public class SpecServiceImpl implements ISpecService
Spec spec = specMapper.selectSpecById(id);
spec.setIsDeleted(1);
spec.setUpdatedAt(new Date());
deleteGoodsSku(id);
return specMapper.updateSpec(spec);
}
public void deleteGoodsSku(String specId){
String query ="\"specId\": "+specId;
List<Goods> goods = goodsMapper.selectSpecNoState(query,"3");
for (Goods good : goods) {
goodsMapper.updateGoodsSpec(good.getId());
GoodsSku goodsSku = new GoodsSku();
goodsSku.setGoodsId(good.getId());
List<GoodsSku> goodsSkus = goodsSkuMapper.selectGoodsSkuList(goodsSku);
for (GoodsSku skus : goodsSkus) {
goodsSkuMapper.deleteGoodsSkuById(String.valueOf(skus.getId()));
}
}
}
}
......@@ -147,4 +147,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCount" resultType="integer">
select count(*) from goods where category=#{id}
</select>
<select id="selectSpec" resultMap="GoodsResult">
<include refid="selectGoodsVo"/>
<where>
spec like concat('%',#{query},'%')
and state ='3'
</where>
</select>
<select id="selectSpecNoState" resultMap="GoodsResult">
<include refid="selectGoodsVo"/>
<where>
spec like concat('%',#{query},'%')
and state !=#{state}
</where>
</select>
<update id="updateGoodsSpec">
update goods set spec =null where id = #{id}
</update>
</mapper>
\ No newline at end of file
......@@ -211,8 +211,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item}
</foreach>
and user_id = #{userId}
and shop_id =#{shopId}
</where>
order by created_at desc limit 1
order by created_at limit 1
</select>
<update id="updateTimeOut">
update `order` set state='7' where state =#{status} and updated_at &lt; DATE_SUB(NOW() ,interval #{timeout} SECOND)
......@@ -240,4 +241,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and shop_id = #{shopId}
</where>
</select>
<select id="selectOrderByTime" resultType="com.soss.system.domain.Order">
<include refid="selectOrderVo"/>
where state =#{status} and updated_at &lt; DATE_SUB(NOW() ,interval #{timeout} SECOND)
</select>
<update id="updateCancel">
update `order` set state='8' where state =#{status} and updated_at &lt; DATE_SUB(NOW() ,interval #{timeout} SECOND)
</update>
</mapper>
\ No newline at end of file
......@@ -14,10 +14,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="code" column="code" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectSpecVo">
select id, name, state, is_show, is_deleted, is_neccessary, created_at, updated_at, code from spec
select id, name, state, is_show, is_deleted, is_neccessary, created_at, updated_at, code,remark from spec
</sql>
<select id="selectSpecList" parameterType="Spec" resultMap="SpecResult">
......@@ -52,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="code != null">code,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if>
......@@ -62,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="code != null">#{code},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
......@@ -75,6 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isNeccessary != null and isNeccessary != ''">is_neccessary = #{isNeccessary},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="code != null">code = #{code},</if>
<if test="remark != null">code = #{remark},</if>
</trim>
where id = #{id}
</update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment