Commit 776c2a3a authored by shiyu's avatar shiyu

钱币设置

parent 48e385f8
......@@ -47,7 +47,7 @@ public class AdminAdminController {
@GetMapping("/list")
public Object list(String username, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
@RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) {
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->管理员管理->查询,请求参数:username:{},page:{}", username, page);
......
......@@ -55,7 +55,7 @@ public class AdminRoleController {
@GetMapping("/list")
public Object list(String name, @RequestParam(defaultValue = "1") Integer page,
@RequestParam(defaultValue = "10") Integer limit,
@Sort @RequestParam(defaultValue = "add_time") String sort,
@RequestParam(defaultValue = "add_time") String sort,
@Order @RequestParam(defaultValue = "desc") String order) {
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->角色管理->角色查询,请求参数,name:{},page:{}", name, page);
......
......@@ -4,6 +4,7 @@ import com.wwdz.ch.admin.entity.vo.CoinVo;
import com.wwdz.ch.admin.service.ItemService;
import com.wwdz.ch.admin.service.OperateLogService;
import com.wwdz.ch.admin.util.AuthSupport;
import com.wwdz.ch.core.consts.CommonEnum;
import com.wwdz.ch.core.storage.QiniuStorage;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.domain.Item;
......@@ -17,7 +18,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import java.util.*;
......@@ -59,29 +59,20 @@ public class ItemServiceImpl implements ItemService {
public Result findDetails(CoinRequestDto coinRequestDto) {
Map<String, Object> map = new HashMap<>();
try {
//不需要查询新一页数据,则根据id查询明细
if (ObjectUtils.isEmpty(coinRequestDto.getIsRefresh()) || coinRequestDto.getIsRefresh() != 1) {
Item item = itemManager.findDetails(coinRequestDto.getId());
CoinVo coinVo = convertEntity(item);
EntityMapper.copyAttribute(item, coinVo);
map.put("isRefresh", 0);
map.put("data", coinVo);
Item item;
Long itemId = coinRequestDto.getId();
if (!ObjectUtils.isEmpty(itemId)) {
item = itemManager.findDetails(coinRequestDto.getId());
} else {
List<CoinVo> coinVoList = new ArrayList<>();
List<Item> itemList = itemManager.findList(coinRequestDto);
itemList.forEach(coin -> {
CoinVo coinVo = convertEntity(coin);
if (coinVo != null) {
coinVoList.add(coinVo);
}
});
map.put("isRefresh", 1);
map.put("data", coinVoList);
item = itemManager.findOne(coinRequestDto);
}
CoinVo coinVo = convertEntity(item);
EntityMapper.copyAttribute(item, coinVo);
return Result.success(coinVo);
} catch (Exception e) {
logger.error("钱币设置查询明细 error : {}", e);
}
return Result.success(map);
return Result.failed();
}
@Override
......@@ -114,7 +105,8 @@ public class ItemServiceImpl implements ItemService {
Map<String, Object> paramMap = JsonUtils.toMap(item.getExtra());
paramMap.remove("s_url");
paramMap.put("topImage", url);
OperateLog operateLog = OperateLog.of("钱币设置", 1, AuthSupport.adminId(), AuthSupport.userName(), JsonUtils.fromMap(paramMap));
OperateLog operateLog = OperateLog.of(coinRequestDto.getId(), CommonEnum.OperateTypeEnum.COIN_SET.getDes(),
CommonEnum.OperateTypeEnum.COIN_SET.getCode(), AuthSupport.adminId(), AuthSupport.userName(), JsonUtils.fromMap(paramMap));
operateLogService.insert(operateLog);
} catch (Exception e) {
logger.error("钱币设置 error :{}", e);
......
package com.wwdz.ch.core.consts;
public class CommonEnum {
public enum OperateTypeEnum {
COIN_SET(1, "钱币设置"),
;
private int code;
private String des;
OperateTypeEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (OperateTypeEnum operateTypeEnum : OperateTypeEnum.values()) {
if (code == operateTypeEnum.getCode()) {
return operateTypeEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
}
......@@ -6,6 +6,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface ItemMapper {
long countByExample(ItemExample example);
......@@ -80,13 +81,4 @@ public interface ItemMapper {
int updateByPrimaryKeyWithBLOBs(Item record);
int updateByPrimaryKey(Item record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dts_goods
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int logicalDeleteByPrimaryKey(Long id);
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.wwdz.ch.db.dao;
import com.wwdz.ch.db.domain.OperateLog;
import com.wwdz.ch.db.domain.OperateLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......
......@@ -86,6 +86,11 @@ public class Item implements Entity {
*/
private String remark;
/**
* 是否设置过
*/
private Integer isSetted;
/**
* 钱币额外信息
*/
......@@ -124,6 +129,7 @@ public class Item implements Entity {
sb.append(", isDeleted=").append(isDeleted);
sb.append(", bidTime=").append(bidTime);
sb.append(", remark=").append(remark);
sb.append(", isSetted=").append(isSetted);
sb.append(", extra=").append(extra);
sb.append(", images=").append(images);
sb.append(", detail=").append(detail);
......@@ -159,6 +165,7 @@ public class Item implements Entity {
&& (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()))
&& (this.getBidTime() == null ? other.getBidTime() == null : this.getBidTime().equals(other.getBidTime()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getIsSetted() == null ? other.getIsSetted() == null : this.getIsSetted().equals(other.getIsSetted()))
&& (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
&& (this.getImages() == null ? other.getImages() == null : this.getImages().equals(other.getImages()))
&& (this.getDetail() == null ? other.getDetail() == null : this.getDetail().equals(other.getDetail()));
......@@ -183,6 +190,7 @@ public class Item implements Entity {
result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
result = prime * result + ((getBidTime() == null) ? 0 : getBidTime().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getIsSetted() == null) ? 0 : getIsSetted().hashCode());
result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
result = prime * result + ((getImages() == null) ? 0 : getImages().hashCode());
result = prime * result + ((getDetail() == null) ? 0 : getDetail().hashCode());
......@@ -212,6 +220,7 @@ public class Item implements Entity {
isDeleted("is_deleted", "isDeleted", "BIT", false),
bidTime("bid_time", "bidTime", "VARCHAR", false),
remark("remark", "remark", "VARCHAR", false),
isSetted("is_setted", "isSetted", "INTEGER", false),
extra("extra", "extra", "LONGVARCHAR", false),
images("images", "images", "LONGVARCHAR", false),
detail("detail", "detail", "LONGVARCHAR", false);
......
......@@ -393,7 +393,7 @@ public class ItemExample {
}
public Criteria andNameLike(String value) {
addCriterion("`name` like", "%" +value+ "% ", "name");
addCriterion("`name` like", value, "name");
return (Criteria) this;
}
......@@ -2177,6 +2177,138 @@ public class ItemExample {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andIsSettedIsNull() {
addCriterion("is_setted is null");
return (Criteria) this;
}
public Criteria andIsSettedIsNotNull() {
addCriterion("is_setted is not null");
return (Criteria) this;
}
public Criteria andIsSettedEqualTo(Integer value) {
addCriterion("is_setted =", value, "isSetted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsSettedEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("is_setted = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsSettedNotEqualTo(Integer value) {
addCriterion("is_setted <>", value, "isSetted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsSettedNotEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("is_setted <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsSettedGreaterThan(Integer value) {
addCriterion("is_setted >", value, "isSetted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsSettedGreaterThanColumn(Item.Column column) {
addCriterion(new StringBuilder("is_setted > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsSettedGreaterThanOrEqualTo(Integer value) {
addCriterion("is_setted >=", value, "isSetted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsSettedGreaterThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("is_setted >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsSettedLessThan(Integer value) {
addCriterion("is_setted <", value, "isSetted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsSettedLessThanColumn(Item.Column column) {
addCriterion(new StringBuilder("is_setted < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsSettedLessThanOrEqualTo(Integer value) {
addCriterion("is_setted <=", value, "isSetted");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table item
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andIsSettedLessThanOrEqualToColumn(Item.Column column) {
addCriterion(new StringBuilder("is_setted <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andIsSettedIn(List<Integer> values) {
addCriterion("is_setted in", values, "isSetted");
return (Criteria) this;
}
public Criteria andIsSettedNotIn(List<Integer> values) {
addCriterion("is_setted not in", values, "isSetted");
return (Criteria) this;
}
public Criteria andIsSettedBetween(Integer value1, Integer value2) {
addCriterion("is_setted between", value1, value2, "isSetted");
return (Criteria) this;
}
public Criteria andIsSettedNotBetween(Integer value1, Integer value2) {
addCriterion("is_setted not between", value1, value2, "isSetted");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
......
......@@ -16,6 +16,11 @@ import lombok.Data;
public class OperateLog implements Entity {
private Integer id;
/**
* 操作对象的id
*/
private Long itemId;
/**
* 操作描述
*/
......@@ -49,7 +54,8 @@ public class OperateLog implements Entity {
private static final long serialVersionUID = 1L;
public OperateLog(String description, Integer type, Integer operaterCode, String operaterName, String param) {
public OperateLog(Long itemId, String description, Integer type, Integer operaterCode, String operaterName, String param) {
this.itemId = itemId;
this.description = description;
this.type = type;
this.operaterCode = operaterCode;
......@@ -57,10 +63,13 @@ public class OperateLog implements Entity {
this.param = param;
}
public static OperateLog of(String description, Integer type, Integer operaterCode, String operaterName, String param) {
return new OperateLog(description, type, operaterCode, operaterName, param);
public static OperateLog of(Long itemId, String description, Integer type, Integer operaterCode, String operaterName, String param) {
return new OperateLog(itemId, description, type, operaterCode, operaterName, param);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
......@@ -68,6 +77,7 @@ public class OperateLog implements Entity {
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", itemId=").append(itemId);
sb.append(", description=").append(description);
sb.append(", type=").append(type);
sb.append(", createTime=").append(createTime);
......@@ -92,6 +102,7 @@ public class OperateLog implements Entity {
}
OperateLog other = (OperateLog) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
&& (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
......@@ -105,6 +116,7 @@ public class OperateLog implements Entity {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
......@@ -123,6 +135,7 @@ public class OperateLog implements Entity {
*/
public enum Column {
id("id", "id", "INTEGER", false),
itemId("item_id", "itemId", "BIGINT", false),
description("description", "description", "VARCHAR", false),
type("type", "type", "INTEGER", true),
createTime("create_time", "createTime", "TIMESTAMP", false),
......
......@@ -280,6 +280,138 @@ public class OperateLogExample {
return (Criteria) this;
}
public Criteria andItemIdIsNull() {
addCriterion("item_id is null");
return (Criteria) this;
}
public Criteria andItemIdIsNotNull() {
addCriterion("item_id is not null");
return (Criteria) this;
}
public Criteria andItemIdEqualTo(Long value) {
addCriterion("item_id =", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operate_log
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdEqualToColumn(OperateLog.Column column) {
addCriterion(new StringBuilder("item_id = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdNotEqualTo(Long value) {
addCriterion("item_id <>", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operate_log
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdNotEqualToColumn(OperateLog.Column column) {
addCriterion(new StringBuilder("item_id <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdGreaterThan(Long value) {
addCriterion("item_id >", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operate_log
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdGreaterThanColumn(OperateLog.Column column) {
addCriterion(new StringBuilder("item_id > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdGreaterThanOrEqualTo(Long value) {
addCriterion("item_id >=", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operate_log
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdGreaterThanOrEqualToColumn(OperateLog.Column column) {
addCriterion(new StringBuilder("item_id >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdLessThan(Long value) {
addCriterion("item_id <", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operate_log
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdLessThanColumn(OperateLog.Column column) {
addCriterion(new StringBuilder("item_id < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdLessThanOrEqualTo(Long value) {
addCriterion("item_id <=", value, "itemId");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table operate_log
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andItemIdLessThanOrEqualToColumn(OperateLog.Column column) {
addCriterion(new StringBuilder("item_id <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andItemIdIn(List<Long> values) {
addCriterion("item_id in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotIn(List<Long> values) {
addCriterion("item_id not in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdBetween(Long value1, Long value2) {
addCriterion("item_id between", value1, value2, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotBetween(Long value1, Long value2) {
addCriterion("item_id not between", value1, value2, "itemId");
return (Criteria) this;
}
public Criteria andDescriptionIsNull() {
addCriterion("description is null");
return (Criteria) this;
......
......@@ -8,6 +8,8 @@ import java.util.List;
public interface ItemManager {
Item findOne(CoinRequestDto coinRequestDto);
List<Item> findList(CoinRequestDto coinRequestDto);
Item findDetails(Long id);
......
......@@ -19,6 +19,15 @@ public class ItemManagerImpl implements ItemManager {
@Autowired
ItemMapper itemMapper;
@Override
public Item findOne(CoinRequestDto coinRequestDto) {
ItemExample example = new ItemExample();
ItemExample.Criteria criteria = example.createCriteria();
criteria.andIsDeletedEqualTo(false);
criteria.andIsSettedEqualTo(0);
return itemMapper.selectOneByExample(example);
}
@Override
public List<Item> findList(CoinRequestDto coinRequestDto) {
ItemExample example = new ItemExample();
......@@ -46,6 +55,7 @@ public class ItemManagerImpl implements ItemManager {
ItemExample example = new ItemExample();
ItemExample.Criteria criteria = example.createCriteria();
criteria.andIdEqualTo(item.getId());
item.setIsSetted(1);
item.setUpdateTime(new Date());
int num = itemMapper.updateByExampleSelective(item, example);
return num > 0;
......
......@@ -17,6 +17,7 @@
<result column="is_deleted" jdbcType="BIT" property="isDeleted" />
<result column="bid_time" jdbcType="VARCHAR" property="bidTime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="is_setted" jdbcType="INTEGER" property="isSetted" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.wwdz.ch.db.domain.Item">
<result column="extra" jdbcType="LONGVARCHAR" property="extra" />
......@@ -83,7 +84,7 @@
</sql>
<sql id="Base_Column_List">
id, `name`, cid, is_on_sale, is_std, sort, share_image, top_image, price, create_time,
source_type, update_time, is_deleted, bid_time, remark
source_type, update_time, is_deleted, bid_time, remark, is_setted
</sql>
<sql id="Blob_Column_List">
extra, images, detail
......@@ -139,7 +140,8 @@
</when>
<otherwise>
id, `name`, cid, is_on_sale, is_std, sort, share_image, top_image, price, create_time,
source_type, update_time, is_deleted, bid_time, remark, extra, images, detail
source_type, update_time, is_deleted, bid_time, remark, is_setted, extra, images,
detail
</otherwise>
</choose>
from item
......@@ -173,7 +175,8 @@
</when>
<otherwise>
id, `name`, cid, is_on_sale, is_std, sort, share_image, top_image, price, create_time,
source_type, update_time, is_deleted, bid_time, remark, extra, images, detail
source_type, update_time, is_deleted, bid_time, remark, is_setted, extra, images,
detail
</otherwise>
</choose>
from item
......@@ -197,14 +200,16 @@
is_std, sort, share_image,
top_image, price, create_time,
source_type, update_time, is_deleted,
bid_time, remark, extra,
images, detail)
bid_time, remark, is_setted,
extra, images, detail
)
values (#{name,jdbcType=VARCHAR}, #{cid,jdbcType=INTEGER}, #{isOnSale,jdbcType=BIT},
#{isStd,jdbcType=BIT}, #{sort,jdbcType=INTEGER}, #{shareImage,jdbcType=VARCHAR},
#{topImage,jdbcType=VARCHAR}, #{price,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{sourceType,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{isDeleted,jdbcType=BIT},
#{bidTime,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{extra,jdbcType=LONGVARCHAR},
#{images,jdbcType=LONGVARCHAR}, #{detail,jdbcType=LONGVARCHAR})
#{bidTime,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{isSetted,jdbcType=INTEGER},
#{extra,jdbcType=LONGVARCHAR}, #{images,jdbcType=LONGVARCHAR}, #{detail,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.Item">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
......@@ -254,6 +259,9 @@
<if test="remark != null">
remark,
</if>
<if test="isSetted != null">
is_setted,
</if>
<if test="extra != null">
extra,
</if>
......@@ -307,6 +315,9 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="isSetted != null">
#{isSetted,jdbcType=INTEGER},
</if>
<if test="extra != null">
#{extra,jdbcType=LONGVARCHAR},
</if>
......@@ -372,6 +383,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.isSetted != null">
is_setted = #{record.isSetted,jdbcType=INTEGER},
</if>
<if test="record.extra != null">
extra = #{record.extra,jdbcType=LONGVARCHAR},
</if>
......@@ -403,6 +417,7 @@
is_deleted = #{record.isDeleted,jdbcType=BIT},
bid_time = #{record.bidTime,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR},
is_setted = #{record.isSetted,jdbcType=INTEGER},
extra = #{record.extra,jdbcType=LONGVARCHAR},
images = #{record.images,jdbcType=LONGVARCHAR},
detail = #{record.detail,jdbcType=LONGVARCHAR}
......@@ -426,7 +441,8 @@
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
is_deleted = #{record.isDeleted,jdbcType=BIT},
bid_time = #{record.bidTime,jdbcType=VARCHAR},
remark = #{record.remark,jdbcType=VARCHAR}
remark = #{record.remark,jdbcType=VARCHAR},
is_setted = #{record.isSetted,jdbcType=INTEGER}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
......@@ -476,6 +492,9 @@
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="isSetted != null">
is_setted = #{isSetted,jdbcType=INTEGER},
</if>
<if test="extra != null">
extra = #{extra,jdbcType=LONGVARCHAR},
</if>
......@@ -504,6 +523,7 @@
is_deleted = #{isDeleted,jdbcType=BIT},
bid_time = #{bidTime,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
is_setted = #{isSetted,jdbcType=INTEGER},
extra = #{extra,jdbcType=LONGVARCHAR},
images = #{images,jdbcType=LONGVARCHAR},
detail = #{detail,jdbcType=LONGVARCHAR}
......@@ -524,7 +544,8 @@
update_time = #{updateTime,jdbcType=TIMESTAMP},
is_deleted = #{isDeleted,jdbcType=BIT},
bid_time = #{bidTime,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR}
remark = #{remark,jdbcType=VARCHAR},
is_setted = #{isSetted,jdbcType=INTEGER}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectOneByExample" parameterType="com.wwdz.ch.db.domain.ItemExample" resultMap="BaseResultMap">
......@@ -581,7 +602,8 @@
</when>
<otherwise>
id, `name`, cid, is_on_sale, is_std, sort, share_image, top_image, price, create_time,
source_type, update_time, is_deleted, bid_time, remark, extra, images, detail
source_type, update_time, is_deleted, bid_time, remark, is_setted, extra, images,
detail
</otherwise>
</choose>
from item
......@@ -593,13 +615,5 @@
</if>
limit 1
</select>
<update id="logicalDeleteByPrimaryKey" parameterType="java.lang.Long">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
@project https://github.com/itfsw/mybatis-generator-plugin
-->
update item set is_deleted = 1
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
......@@ -3,6 +3,7 @@
<mapper namespace="com.wwdz.ch.db.dao.OperateLogMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.OperateLog">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="type" jdbcType="INTEGER" property="type" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
......@@ -71,7 +72,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, description, `type`, create_time, operater_code, operater_name
id, item_id, description, `type`, create_time, operater_code, operater_name
</sql>
<sql id="Blob_Column_List">
param
......@@ -126,7 +127,8 @@
</foreach>
</when>
<otherwise>
id, description, `type`, create_time, operater_code, operater_name, param
id, item_id, description, `type`, create_time, operater_code, operater_name, param
</otherwise>
</choose>
from operate_log
......@@ -159,7 +161,8 @@
</foreach>
</when>
<otherwise>
id, description, `type`, create_time, operater_code, operater_name, param
id, item_id, description, `type`, create_time, operater_code, operater_name, param
</otherwise>
</choose>
from operate_log
......@@ -179,12 +182,12 @@
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
SELECT LAST_INSERT_ID()
</selectKey>
insert into operate_log (description, `type`, create_time,
operater_code, operater_name, param
)
values (#{description,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{operaterCode,jdbcType=INTEGER}, #{operaterName,jdbcType=VARCHAR}, #{param,jdbcType=LONGVARCHAR}
)
insert into operate_log (item_id, description, `type`,
create_time, operater_code, operater_name,
param)
values (#{itemId,jdbcType=BIGINT}, #{description,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{operaterCode,jdbcType=INTEGER}, #{operaterName,jdbcType=VARCHAR},
#{param,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.OperateLog">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
......@@ -192,6 +195,9 @@
</selectKey>
insert into operate_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="itemId != null">
item_id,
</if>
<if test="description != null">
description,
</if>
......@@ -212,6 +218,9 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="itemId != null">
#{itemId,jdbcType=BIGINT},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
......@@ -244,6 +253,9 @@
<if test="record.id != null">
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.itemId != null">
item_id = #{record.itemId,jdbcType=BIGINT},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
......@@ -270,6 +282,7 @@
<update id="updateByExampleWithBLOBs" parameterType="map">
update operate_log
set id = #{record.id,jdbcType=INTEGER},
item_id = #{record.itemId,jdbcType=BIGINT},
description = #{record.description,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
......@@ -283,6 +296,7 @@
<update id="updateByExample" parameterType="map">
update operate_log
set id = #{record.id,jdbcType=INTEGER},
item_id = #{record.itemId,jdbcType=BIGINT},
description = #{record.description,jdbcType=VARCHAR},
`type` = #{record.type,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
......@@ -295,6 +309,9 @@
<update id="updateByPrimaryKeySelective" parameterType="com.wwdz.ch.db.domain.OperateLog">
update operate_log
<set>
<if test="itemId != null">
item_id = #{itemId,jdbcType=BIGINT},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
......@@ -318,7 +335,8 @@
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.wwdz.ch.db.domain.OperateLog">
update operate_log
set description = #{description,jdbcType=VARCHAR},
set item_id = #{itemId,jdbcType=BIGINT},
description = #{description,jdbcType=VARCHAR},
`type` = #{type,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
operater_code = #{operaterCode,jdbcType=INTEGER},
......@@ -328,7 +346,8 @@
</update>
<update id="updateByPrimaryKey" parameterType="com.wwdz.ch.db.domain.OperateLog">
update operate_log
set description = #{description,jdbcType=VARCHAR},
set item_id = #{itemId,jdbcType=BIGINT},
description = #{description,jdbcType=VARCHAR},
`type` = #{type,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
operater_code = #{operaterCode,jdbcType=INTEGER},
......@@ -388,7 +407,8 @@
</foreach>
</when>
<otherwise>
id, description, `type`, create_time, operater_code, operater_name, param
id, item_id, description, `type`, create_time, operater_code, operater_name, param
</otherwise>
</choose>
from operate_log
......
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