Commit c99cc022 by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents 999584f6 d8bb0670
package com.gic.enterprise.dto;
import java.io.Serializable;
import java.util.Date;
/**
* tab_table_setting
*/
public class TableSettingDTO implements Serializable {
/**
*
*/
private Integer tableId;
/**
*
*/
private String tableName;
/**
*
*/
private String saveExtInterface;
/**
*
*/
private String delExtInterface;
/**
*
*/
private String extInterface;
/**
*
*/
private String remark;
/**
*
*/
private Date createTime;
/**
*
*/
private String repeateSetting;
/**
* 1重复更新 0不更新
*/
private Integer repeateOpt;
/**
*
*/
private String createtor;
/**
*
*/
private String createtorName;
public Integer getTableId() {
return tableId;
}
public void setTableId(Integer tableId) {
this.tableId = tableId;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getSaveExtInterface() {
return saveExtInterface;
}
public void setSaveExtInterface(String saveExtInterface) {
this.saveExtInterface = saveExtInterface;
}
public String getDelExtInterface() {
return delExtInterface;
}
public void setDelExtInterface(String delExtInterface) {
this.delExtInterface = delExtInterface;
}
public String getExtInterface() {
return extInterface;
}
public void setExtInterface(String extInterface) {
this.extInterface = extInterface;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getRepeateSetting() {
return repeateSetting;
}
public void setRepeateSetting(String repeateSetting) {
this.repeateSetting = repeateSetting;
}
public Integer getRepeateOpt() {
return repeateOpt;
}
public void setRepeateOpt(Integer repeateOpt) {
this.repeateOpt = repeateOpt;
}
public String getCreatetor() {
return createtor;
}
public void setCreatetor(String createtor) {
this.createtor = createtor;
}
public String getCreatetorName() {
return createtorName;
}
public void setCreatetorName(String createtorName) {
this.createtorName = createtorName;
}
}
\ No newline at end of file
package com.gic.enterprise.dto;
import java.io.Serializable;
import java.util.Date;
/**
* tab_table_setting_field
*/
public class TableSettingFieldDTO implements Serializable {
/**
*
*/
private Integer fieldId;
/**
*
*/
private Integer tableId;
/**
*
*/
private String fieldKey;
/**
*
*/
private String fieldName;
/**
*
*/
private String fieldType;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getFieldId() {
return fieldId;
}
public void setFieldId(Integer fieldId) {
this.fieldId = fieldId;
}
public Integer getTableId() {
return tableId;
}
public void setTableId(Integer tableId) {
this.tableId = tableId;
}
public String getFieldKey() {
return fieldKey;
}
public void setFieldKey(String fieldKey) {
this.fieldKey = fieldKey;
}
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public String getFieldType() {
return fieldType;
}
public void setFieldType(String fieldType) {
this.fieldType = fieldType;
}
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;
}
}
\ No newline at end of file
package com.gic.enterprise.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.TableSettingDTO;
import com.gic.enterprise.dto.TableSettingFieldDTO;
import java.util.List;
public interface TableSettingApiService {
/**
* saveTableSetting
* @Title: saveTableSetting
* @Description: 保存表配置
* @author taogs
* @param tableSettingDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<String> saveTableSetting(TableSettingDTO tableSettingDTO);
/**
* pageTableSetting
* @Title: pageTableSetting
* @Description: 查询表配置
* @author taogs
* @param search
* @param pageNum
* @param pageSize
* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<com.gic.enterprise.dto.TableSettingDTO>>
* @throws
*/
ServiceResponse<Page<TableSettingDTO>> pageTableSetting(String search, Integer pageNum, Integer pageSize);
/**
* getTableSetting
* @Title: getTableSetting
* @Description: 获取表详情
* @author taogs
* @param tableId
* @return com.gic.api.base.commons.ServiceResponse<com.gic.enterprise.dto.TableSettingDTO>
* @throws
*/
ServiceResponse<TableSettingDTO> getTableSetting(Integer tableId);
/**
* delTableSetting
* @Title: delTableSetting
* @Description: 删除表配置
* @author taogs
* @param tableId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> delTableSetting(Integer tableId);
/**
* saveTableField
* @Title: saveTableField
* @Description: 保存字段
* @author taogs
* @param fieldDTO
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> saveTableField(TableSettingFieldDTO fieldDTO);
/**
* listTableField
* @Title: listTableField
* @Description: 查询表字段
* @author taogs
* @param tableId
* @return com.gic.api.base.commons.ServiceResponse<java.util.List<com.gic.enterprise.dto.TableSettingFieldDTO>>
* @throws
*/
ServiceResponse<List<TableSettingFieldDTO>> listTableField(Integer tableId);
/**
* delField
* @Title: delField
* @Description: 删除字段
* @author taogs
* @param fieldId
* @return com.gic.api.base.commons.ServiceResponse<java.lang.Void>
* @throws
*/
ServiceResponse<Void> delField(Integer fieldId);
}
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabTableSettingField;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabTableSettingFieldMapper {
/**
* 根据主键删除
*
* @param fieldId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer fieldId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabTableSettingField record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabTableSettingField record);
/**
* 根据主键查询
*
* @param fieldId 主键
* @return 实体对象
*/
TabTableSettingField selectByPrimaryKey(Integer fieldId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabTableSettingField record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabTableSettingField record);
/**
* listField
* @Title: listField
* @Description:
* @author taogs
* @param tableId
* @return java.util.List<com.gic.enterprise.entity.TabTableSettingField>
* @throws
*/
List<TabTableSettingField> listField(@Param("tableId") Integer tableId);
TabTableSettingField getFieldByKey(@Param("tableId") Integer tableId, @Param("fieldKey") String fieldKey);
}
\ No newline at end of file
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabTableSetting;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
public interface TabTableSettingMapper {
/**
* 根据主键删除
*
* @param tableId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer tableId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabTableSetting record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabTableSetting record);
/**
* 根据主键查询
*
* @param tableId 主键
* @return 实体对象
*/
TabTableSetting selectByPrimaryKey(Integer tableId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabTableSetting record);
/**
* 根据主键更新记录,包括二进制大对象
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeyWithBLOBs(TabTableSetting record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabTableSetting record);
Page<TabTableSetting> pageTableSetting(@Param("search") String search);
TabTableSetting getTableSettingByTableName(@Param("tableName") String tableName);
}
\ No newline at end of file
package com.gic.enterprise.entity;
import java.util.Date;
/**
* tab_table_setting
*/
public class TabTableSetting {
/**
*
*/
private Integer tableId;
/**
*
*/
private String tableName;
/**
*
*/
private String saveExtInterface;
/**
*
*/
private String delExtInterface;
/**
*
*/
private String extInterface;
/**
*
*/
private String remark;
/**
*
*/
private String repeateSetting;
/**
* 1重复更新 0不更新
*/
private Integer repeateOpt;
/**
*
*/
private String createtor;
/**
*
*/
private String createtorName;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* 1删除 0正常
*/
private Integer deleteFlag;
/**
*
*/
private String fields;
public Integer getTableId() {
return tableId;
}
public void setTableId(Integer tableId) {
this.tableId = tableId;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getSaveExtInterface() {
return saveExtInterface;
}
public void setSaveExtInterface(String saveExtInterface) {
this.saveExtInterface = saveExtInterface;
}
public String getDelExtInterface() {
return delExtInterface;
}
public void setDelExtInterface(String delExtInterface) {
this.delExtInterface = delExtInterface;
}
public String getExtInterface() {
return extInterface;
}
public void setExtInterface(String extInterface) {
this.extInterface = extInterface;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getRepeateSetting() {
return repeateSetting;
}
public void setRepeateSetting(String repeateSetting) {
this.repeateSetting = repeateSetting;
}
public Integer getRepeateOpt() {
return repeateOpt;
}
public void setRepeateOpt(Integer repeateOpt) {
this.repeateOpt = repeateOpt;
}
public String getCreatetor() {
return createtor;
}
public void setCreatetor(String createtor) {
this.createtor = createtor;
}
public String getCreatetorName() {
return createtorName;
}
public void setCreatetorName(String createtorName) {
this.createtorName = createtorName;
}
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 getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public String getFields() {
return fields;
}
public void setFields(String fields) {
this.fields = fields;
}
}
\ No newline at end of file
package com.gic.enterprise.entity;
import java.util.Date;
/**
* tab_table_setting_field
*/
public class TabTableSettingField {
/**
*
*/
private Integer fieldId;
/**
*
*/
private Integer tableId;
/**
*
*/
private String fieldKey;
/**
*
*/
private String fieldName;
/**
*
*/
private String fieldType;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer deleteFlag;
public Integer getFieldId() {
return fieldId;
}
public void setFieldId(Integer fieldId) {
this.fieldId = fieldId;
}
public Integer getTableId() {
return tableId;
}
public void setTableId(Integer tableId) {
this.tableId = tableId;
}
public String getFieldKey() {
return fieldKey;
}
public void setFieldKey(String fieldKey) {
this.fieldKey = fieldKey;
}
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public String getFieldType() {
return fieldType;
}
public void setFieldType(String fieldType) {
this.fieldType = fieldType;
}
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 getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
}
\ No newline at end of file
package com.gic.enterprise.service;
import com.gic.enterprise.dto.TableSettingFieldDTO;
import java.util.List;
public interface TableSettingFieldService {
String saveTableField(TableSettingFieldDTO tableSettingFieldDTO);
List<TableSettingFieldDTO> listTableField(Integer tableId);
void delTableField(Integer fieldId);
}
package com.gic.enterprise.service;
import com.gic.enterprise.entity.TabTableSetting;
import com.github.pagehelper.Page;
public interface TableSettingService {
String saveTableSetting(TabTableSetting tabTableSetting);
Page<TabTableSetting> pageTableSetting(String search);
TabTableSetting getTableSetting(Integer tableId);
void delTabSetting(Integer tableId);
}
package com.gic.enterprise.service.impl;
import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.dao.mapper.TabTableSettingFieldMapper;
import com.gic.enterprise.dto.TableSettingFieldDTO;
import com.gic.enterprise.entity.TabTableSettingField;
import com.gic.enterprise.service.TableSettingFieldService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
@Service
public class TableSettingFieldServiceImpl implements TableSettingFieldService {
@Autowired
private TabTableSettingFieldMapper tabTableSettingFieldMapper;
@Override
public String saveTableField(TableSettingFieldDTO tableSettingFieldDTO) {
TabTableSettingField tab = EntityUtil.changeEntityByJSON(TabTableSettingField.class, tableSettingFieldDTO);
Date date = new Date();
tab.setUpdateTime(date);
TabTableSettingField field = tabTableSettingFieldMapper.getFieldByKey(tab.getTableId(), tab.getFieldKey());
if(tab.getFieldId() != null){
if(field != null){
if(field.getFieldId() != tab.getFieldId()){
return "该字段已经存在";
}
}
tabTableSettingFieldMapper.updateByPrimaryKeySelective(tab);
} else {
if(field != null){
return "该字段已经存在";
}
tab.setCreateTime(date);
tabTableSettingFieldMapper.insertSelective(tab);
}
return null;
}
@Override
public List<TableSettingFieldDTO> listTableField(Integer tableId) {
List<TabTableSettingField> list = tabTableSettingFieldMapper.listField(tableId);
return EntityUtil.changeEntityListByJSON(TableSettingFieldDTO.class, list);
}
@Override
public void delTableField(Integer fieldId) {
TabTableSettingField field = new TabTableSettingField();
field.setFieldId(fieldId);
field.setDeleteFlag(1);
tabTableSettingFieldMapper.updateByPrimaryKeySelective(field);
}
}
package com.gic.enterprise.service.impl;
import com.gic.enterprise.dao.mapper.TabTableSettingMapper;
import com.gic.enterprise.entity.TabTableSetting;
import com.gic.enterprise.service.TableSettingService;
import com.github.pagehelper.Page;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service
public class TableSettingServiceImpl implements TableSettingService {
private static final Logger log = LogManager.getLogger(TableSettingServiceImpl.class);
@Autowired
private TabTableSettingMapper tabTableSettingMapper;
@Override
public String saveTableSetting(TabTableSetting tabTableSetting) {
tabTableSetting.setUpdateTime(new Date());
if(tabTableSetting.getTableId() == null){
//校验是否重复
TabTableSetting existTable = tabTableSettingMapper.getTableSettingByTableName(tabTableSetting.getTableName());
if(existTable != null){
return "表名已经存在";
}
tabTableSetting.setCreateTime(new Date());
tabTableSettingMapper.insertSelective(tabTableSetting);
} else {
tabTableSettingMapper.updateByPrimaryKeySelective(tabTableSetting);
}
return null;
}
@Override
public Page<TabTableSetting> pageTableSetting(String search) {
Page<TabTableSetting> page = tabTableSettingMapper.pageTableSetting(search);
return page;
}
@Override
public TabTableSetting getTableSetting(Integer tableId) {
return tabTableSettingMapper.selectByPrimaryKey(tableId);
}
@Override
public void delTabSetting(Integer tableId) {
TabTableSetting tabTableSetting = new TabTableSetting();
tabTableSetting.setTableId(tableId);
tabTableSetting.setDeleteFlag(1);
tabTableSettingMapper.updateByPrimaryKeySelective(tabTableSetting);
}
}
package com.gic.enterprise.service.outer.impl;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.dto.TableSettingDTO;
import com.gic.enterprise.dto.TableSettingFieldDTO;
import com.gic.enterprise.entity.TabTableSetting;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.service.TableSettingApiService;
import com.gic.enterprise.service.TableSettingFieldService;
import com.gic.enterprise.service.TableSettingService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("tableSettingApiService")
public class TableSettingApiServiceImpl implements TableSettingApiService {
@Autowired
private TableSettingService tableSettingService;
@Autowired
private TableSettingFieldService tableSettingFieldService;
@Override
public ServiceResponse<String> saveTableSetting(TableSettingDTO tableSettingDTO) {
String result = tableSettingService.saveTableSetting(EntityUtil.changeEntityByJSON(TabTableSetting.class, tableSettingDTO));
if(StringUtils.isBlank(result)){
return ServiceResponse.success();
}
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), result);
}
@Override
public ServiceResponse<Page<TableSettingDTO>> pageTableSetting(String search, Integer pageNum, Integer pageSize) {
PageHelper.startPage(pageNum, pageSize);
com.github.pagehelper.Page<TabTableSetting> page = tableSettingService.pageTableSetting(search);
return ServiceResponse.success(PageHelperUtils.changePageHelperToCurrentPage(page, TableSettingDTO.class));
}
@Override
public ServiceResponse<TableSettingDTO> getTableSetting(Integer tableId) {
return ServiceResponse.success(EntityUtil.changeEntityByJSON(TableSettingDTO.class, tableSettingService.getTableSetting(tableId)));
}
@Override
public ServiceResponse<Void> delTableSetting(Integer tableId) {
tableSettingService.delTabSetting(tableId);
return ServiceResponse.success();
}
@Override
public ServiceResponse<Void> saveTableField(TableSettingFieldDTO fieldDTO) {
String result = tableSettingFieldService.saveTableField(fieldDTO);
if(StringUtils.isBlank(result)){
return ServiceResponse.success();
}
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), result);
}
@Override
public ServiceResponse<List<TableSettingFieldDTO>> listTableField(Integer tableId) {
List<TableSettingFieldDTO> list = tableSettingFieldService.listTableField(tableId);
return ServiceResponse.success(EntityUtil.changeEntityListByJSON(TableSettingFieldDTO.class, list));
}
@Override
public ServiceResponse<Void> delField(Integer fieldId) {
tableSettingFieldService.delTableField(fieldId);
return ServiceResponse.success();
}
}
......@@ -133,6 +133,7 @@
<dubbo:service interface="com.gic.enterprise.service.EnterpriseGoodsResourceApiService" ref="enterpriseGoodsResourceApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.UnionEnterpriseAuthApiService" ref="unionEnterpriseAuthApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.UnionEnterpriseAuthResDetailApiService" ref="unionEnterpriseAuthResDetailApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.TableSettingApiService" ref="tableSettingApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.ProductMarketApiService" ref="productMarketApiService" timeout="6000" />
<dubbo:service interface="com.gic.enterprise.service.BlackListApiService" ref="blackListApiService" timeout="6000" />
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.enterprise.dao.mapper.TabTableSettingFieldMapper">
<resultMap id="BaseResultMap" type="com.gic.enterprise.entity.TabTableSettingField">
<id column="field_id" jdbcType="INTEGER" property="fieldId" />
<result column="table_id" jdbcType="INTEGER" property="tableId" />
<result column="field_key" jdbcType="VARCHAR" property="fieldKey" />
<result column="field_name" jdbcType="VARCHAR" property="fieldName" />
<result column="field_type" jdbcType="VARCHAR" property="fieldType" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
</resultMap>
<sql id="Base_Column_List">
field_id, table_id, field_key, field_name, field_type, create_time, update_time,
delete_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_table_setting_field
where field_id = #{fieldId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_table_setting_field
where field_id = #{fieldId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabTableSettingField">
insert into tab_table_setting_field (field_id, table_id, field_key,
field_name, field_type, create_time,
update_time, delete_flag)
values (#{fieldId,jdbcType=INTEGER}, #{tableId,jdbcType=INTEGER}, #{fieldKey,jdbcType=VARCHAR},
#{fieldName,jdbcType=VARCHAR}, #{fieldType,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabTableSettingField">
insert into tab_table_setting_field
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fieldId != null">
field_id,
</if>
<if test="tableId != null">
table_id,
</if>
<if test="fieldKey != null">
field_key,
</if>
<if test="fieldName != null">
field_name,
</if>
<if test="fieldType != null">
field_type,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fieldId != null">
#{fieldId,jdbcType=INTEGER},
</if>
<if test="tableId != null">
#{tableId,jdbcType=INTEGER},
</if>
<if test="fieldKey != null">
#{fieldKey,jdbcType=VARCHAR},
</if>
<if test="fieldName != null">
#{fieldName,jdbcType=VARCHAR},
</if>
<if test="fieldType != null">
#{fieldType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabTableSettingField">
update tab_table_setting_field
<set>
<if test="tableId != null">
table_id = #{tableId,jdbcType=INTEGER},
</if>
<if test="fieldKey != null">
field_key = #{fieldKey,jdbcType=VARCHAR},
</if>
<if test="fieldName != null">
field_name = #{fieldName,jdbcType=VARCHAR},
</if>
<if test="fieldType != null">
field_type = #{fieldType,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
</set>
where field_id = #{fieldId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.enterprise.entity.TabTableSettingField">
update tab_table_setting_field
set table_id = #{tableId,jdbcType=INTEGER},
field_key = #{fieldKey,jdbcType=VARCHAR},
field_name = #{fieldName,jdbcType=VARCHAR},
field_type = #{fieldType,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where field_id = #{fieldId,jdbcType=INTEGER}
</update>
<select id="listField" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_table_setting_field
where table_id = #{tableId,jdbcType=INTEGER} and delete_flag = 0
</select>
<select id="getFieldByKey" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_table_setting_field
where table_id = #{tableId,jdbcType=INTEGER} and delete_flag = 0 and field_key = #{fieldKey}
</select>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.enterprise.dao.mapper.TabTableSettingMapper">
<resultMap id="BaseResultMap" type="com.gic.enterprise.entity.TabTableSetting">
<id column="table_id" jdbcType="INTEGER" property="tableId" />
<result column="table_name" jdbcType="VARCHAR" property="tableName" />
<result column="save_ext_interface" jdbcType="VARCHAR" property="saveExtInterface" />
<result column="del_ext_interface" jdbcType="VARCHAR" property="delExtInterface" />
<result column="ext_interface" jdbcType="VARCHAR" property="extInterface" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="repeate_setting" jdbcType="VARCHAR" property="repeateSetting" />
<result column="repeate_opt" jdbcType="INTEGER" property="repeateOpt" />
<result column="createtor" jdbcType="VARCHAR" property="createtor" />
<result column="createtor_name" jdbcType="VARCHAR" property="createtorName" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="delete_flag" jdbcType="INTEGER" property="deleteFlag" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.gic.enterprise.entity.TabTableSetting">
<result column="fields" jdbcType="LONGVARCHAR" property="fields" />
</resultMap>
<sql id="Base_Column_List">
table_id, table_name, save_ext_interface, del_ext_interface, ext_interface, remark,
repeate_setting, repeate_opt, createtor, createtor_name, create_time, update_time,
delete_flag
</sql>
<sql id="Blob_Column_List">
fields
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from tab_table_setting
where table_id = #{tableId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_table_setting
where table_id = #{tableId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.enterprise.entity.TabTableSetting">
insert into tab_table_setting (table_id, table_name, save_ext_interface,
del_ext_interface, ext_interface, remark,
repeate_setting, repeate_opt, createtor,
createtor_name, create_time, update_time,
delete_flag, fields)
values (#{tableId,jdbcType=INTEGER}, #{tableName,jdbcType=VARCHAR}, #{saveExtInterface,jdbcType=VARCHAR},
#{delExtInterface,jdbcType=VARCHAR}, #{extInterface,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
#{repeateSetting,jdbcType=VARCHAR}, #{repeateOpt,jdbcType=INTEGER}, #{createtor,jdbcType=VARCHAR},
#{createtorName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{deleteFlag,jdbcType=INTEGER}, #{fields,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabTableSetting">
insert into tab_table_setting
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="tableId != null">
table_id,
</if>
<if test="tableName != null">
table_name,
</if>
<if test="saveExtInterface != null">
save_ext_interface,
</if>
<if test="delExtInterface != null">
del_ext_interface,
</if>
<if test="extInterface != null">
ext_interface,
</if>
<if test="remark != null">
remark,
</if>
<if test="repeateSetting != null">
repeate_setting,
</if>
<if test="repeateOpt != null">
repeate_opt,
</if>
<if test="createtor != null">
createtor,
</if>
<if test="createtorName != null">
createtor_name,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="fields != null">
fields,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="tableId != null">
#{tableId,jdbcType=INTEGER},
</if>
<if test="tableName != null">
#{tableName,jdbcType=VARCHAR},
</if>
<if test="saveExtInterface != null">
#{saveExtInterface,jdbcType=VARCHAR},
</if>
<if test="delExtInterface != null">
#{delExtInterface,jdbcType=VARCHAR},
</if>
<if test="extInterface != null">
#{extInterface,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="repeateSetting != null">
#{repeateSetting,jdbcType=VARCHAR},
</if>
<if test="repeateOpt != null">
#{repeateOpt,jdbcType=INTEGER},
</if>
<if test="createtor != null">
#{createtor,jdbcType=VARCHAR},
</if>
<if test="createtorName != null">
#{createtorName,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="fields != null">
#{fields,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabTableSetting">
update tab_table_setting
<set>
<if test="tableName != null">
table_name = #{tableName,jdbcType=VARCHAR},
</if>
<if test="saveExtInterface != null">
save_ext_interface = #{saveExtInterface,jdbcType=VARCHAR},
</if>
<if test="delExtInterface != null">
del_ext_interface = #{delExtInterface,jdbcType=VARCHAR},
</if>
<if test="extInterface != null">
ext_interface = #{extInterface,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="repeateSetting != null">
repeate_setting = #{repeateSetting,jdbcType=VARCHAR},
</if>
<if test="repeateOpt != null">
repeate_opt = #{repeateOpt,jdbcType=INTEGER},
</if>
<if test="createtor != null">
createtor = #{createtor,jdbcType=VARCHAR},
</if>
<if test="createtorName != null">
createtor_name = #{createtorName,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="fields != null">
fields = #{fields,jdbcType=LONGVARCHAR},
</if>
</set>
where table_id = #{tableId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.gic.enterprise.entity.TabTableSetting">
update tab_table_setting
set table_name = #{tableName,jdbcType=VARCHAR},
save_ext_interface = #{saveExtInterface,jdbcType=VARCHAR},
del_ext_interface = #{delExtInterface,jdbcType=VARCHAR},
ext_interface = #{extInterface,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
repeate_setting = #{repeateSetting,jdbcType=VARCHAR},
repeate_opt = #{repeateOpt,jdbcType=INTEGER},
createtor = #{createtor,jdbcType=VARCHAR},
createtor_name = #{createtorName,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
fields = #{fields,jdbcType=LONGVARCHAR}
where table_id = #{tableId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.enterprise.entity.TabTableSetting">
update tab_table_setting
set table_name = #{tableName,jdbcType=VARCHAR},
save_ext_interface = #{saveExtInterface,jdbcType=VARCHAR},
del_ext_interface = #{delExtInterface,jdbcType=VARCHAR},
ext_interface = #{extInterface,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
repeate_setting = #{repeateSetting,jdbcType=VARCHAR},
repeate_opt = #{repeateOpt,jdbcType=INTEGER},
createtor = #{createtor,jdbcType=VARCHAR},
createtor_name = #{createtorName,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
delete_flag = #{deleteFlag,jdbcType=INTEGER}
where table_id = #{tableId,jdbcType=INTEGER}
</update>
<select id="pageTableSetting" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
from tab_table_setting
where delete_flag = 0
<if test="search != null and search !=''">
and (table_name like concat('%',search,'%') or remark like concat('%',search,'%'))
</if>
</select>
<select id="getTableSettingByTableName" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
from tab_table_setting
where delete_flag = 0
and table_name = #{tableName}
</select>
</mapper>
\ No newline at end of file
package com.gic.operation.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.authcenter.security.core.util.UserUtils;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.dto.TableSettingDTO;
import com.gic.enterprise.dto.TableSettingFieldDTO;
import com.gic.enterprise.response.EnterpriseRestResponse;
import com.gic.enterprise.service.TableSettingApiService;
import com.gic.operation.web.qo.TableSettingFieldQO;
import com.gic.operation.web.qo.TableSettingQO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List;
@Controller
public class TableSettingController {
@Autowired
private TableSettingApiService tableSettingApiService;
@RequestMapping("save-table-setting")
@ResponseBody
public RestResponse saveTableSetting(TableSettingQO param){
TableSettingDTO tableSettingDTO = EntityUtil.changeEntityByJSON(TableSettingDTO.class, param);
tableSettingDTO.setCreatetor(UserUtils.getUser().getId().toString());
tableSettingDTO.setCreatetorName(UserUtils.getUser().getUsername());
ServiceResponse<String> response = tableSettingApiService.saveTableSetting(tableSettingDTO);
if(response.isSuccess()){
return RestResponse.success();
}
return EnterpriseRestResponse.failure(response);
}
@RequestMapping("page-table-setting")
@ResponseBody
public RestResponse pageTableSetting(String search, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "20") Integer pageSize){
Page<TableSettingDTO> result = tableSettingApiService.pageTableSetting(search, pageNum, pageSize).getResult();
return RestResponse.success(result);
}
@RequestMapping("get-table-setting")
@ResponseBody
public RestResponse getTableSetting(Integer tableId){
TableSettingDTO result = tableSettingApiService.getTableSetting(tableId).getResult();
return RestResponse.success(result);
}
@RequestMapping("del-table-setting")
@ResponseBody
public RestResponse delTableSetting(Integer tableId){
ServiceResponse<Void> response = tableSettingApiService.delTableSetting(tableId);
return RestResponse.success();
}
@RequestMapping("add-table-field")
@ResponseBody
public RestResponse addTableField(TableSettingFieldQO qo){
TableSettingFieldDTO tableSettingFieldDTO = EntityUtil.changeEntityByJSON(TableSettingFieldDTO.class, qo);
ServiceResponse<Void> response = tableSettingApiService.saveTableField(tableSettingFieldDTO);
if(response.isSuccess()){
return RestResponse.success();
}
return EnterpriseRestResponse.failure(response);
}
@RequestMapping("list-table-field")
@ResponseBody
public RestResponse listTableField(Integer tableId){
List<TableSettingFieldDTO> result = tableSettingApiService.listTableField(tableId).getResult();
return RestResponse.success(result);
}
@RequestMapping("del-table-field")
@ResponseBody
public RestResponse delTableField(Integer fielId){
tableSettingApiService.delField(fielId);
return RestResponse.success();
}
}
package com.gic.operation.web.qo;
import java.io.Serializable;
import java.util.Date;
/**
* tab_table_setting_field
*/
public class TableSettingFieldQO implements Serializable {
/**
*
*/
private Integer fieldId;
/**
*
*/
private Integer tableId;
/**
*
*/
private String fieldKey;
/**
*
*/
private String fieldName;
/**
*
*/
private String fieldType;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getFieldId() {
return fieldId;
}
public void setFieldId(Integer fieldId) {
this.fieldId = fieldId;
}
public Integer getTableId() {
return tableId;
}
public void setTableId(Integer tableId) {
this.tableId = tableId;
}
public String getFieldKey() {
return fieldKey;
}
public void setFieldKey(String fieldKey) {
this.fieldKey = fieldKey;
}
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
public String getFieldType() {
return fieldType;
}
public void setFieldType(String fieldType) {
this.fieldType = fieldType;
}
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;
}
}
\ No newline at end of file
package com.gic.operation.web.qo;
import java.io.Serializable;
import java.util.Date;
/**
* tab_table_setting
*/
public class TableSettingQO implements Serializable {
/**
*
*/
private Integer tableId;
/**
*
*/
private String tableName;
/**
*
*/
private String saveExtInterface;
/**
*
*/
private String delExtInterface;
/**
*
*/
private String extInterface;
/**
*
*/
private String remark;
/**
*
*/
private String repeateSetting;
/**
* 1重复更新 0不更新
*/
private Integer repeateOpt;
/**
*
*/
private String createtor;
/**
*
*/
private String createtorName;
/**
*
*/
private String fields;
public Integer getTableId() {
return tableId;
}
public void setTableId(Integer tableId) {
this.tableId = tableId;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getSaveExtInterface() {
return saveExtInterface;
}
public void setSaveExtInterface(String saveExtInterface) {
this.saveExtInterface = saveExtInterface;
}
public String getDelExtInterface() {
return delExtInterface;
}
public void setDelExtInterface(String delExtInterface) {
this.delExtInterface = delExtInterface;
}
public String getExtInterface() {
return extInterface;
}
public void setExtInterface(String extInterface) {
this.extInterface = extInterface;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getRepeateSetting() {
return repeateSetting;
}
public void setRepeateSetting(String repeateSetting) {
this.repeateSetting = repeateSetting;
}
public Integer getRepeateOpt() {
return repeateOpt;
}
public void setRepeateOpt(Integer repeateOpt) {
this.repeateOpt = repeateOpt;
}
public String getCreatetor() {
return createtor;
}
public void setCreatetor(String createtor) {
this.createtor = createtor;
}
public String getCreatetorName() {
return createtorName;
}
public void setCreatetorName(String createtorName) {
this.createtorName = createtorName;
}
public String getFields() {
return fields;
}
public void setFields(String fields) {
this.fields = fields;
}
}
\ No newline at end of file
......@@ -96,4 +96,5 @@
<dubbo:reference interface="com.gic.enterprise.service.ProductMarketApiService" id="productMarketApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.BlackListApiService" id="blackListApiService" timeout="6000" />
<dubbo:reference interface="com.gic.enterprise.service.TableSettingApiService" id="tableSettingApiService" timeout="6000" />
</beans>
\ No newline at end of file
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