Commit dd517567 by guojuxing

规范字典表名称

parent f849b6e8
...@@ -8,7 +8,7 @@ import java.util.Date; ...@@ -8,7 +8,7 @@ import java.util.Date;
* @Description: * @Description:
* @date 2020-03-26 15:08 * @date 2020-03-26 15:08
*/ */
public class GicDictDTO implements Serializable { public class DictDTO implements Serializable {
private static final long serialVersionUID = -573633208657720956L; private static final long serialVersionUID = -573633208657720956L;
/** /**
...@@ -119,7 +119,7 @@ public class GicDictDTO implements Serializable { ...@@ -119,7 +119,7 @@ public class GicDictDTO implements Serializable {
@Override @Override
public String toString() { public String toString() {
return "GicDictDTO{" + return "DictDTO{" +
"dictId='" + dictId + '\'' + "dictId='" + dictId + '\'' +
", dictType='" + dictType + '\'' + ", dictType='" + dictType + '\'' +
", dictCode='" + dictCode + '\'' + ", dictCode='" + dictCode + '\'' +
......
package com.gic.store.service; package com.gic.store.service;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.store.dto.GicDictDTO; import com.gic.store.dto.DictDTO;
/** /**
* @author zhiwj * @author zhiwj
...@@ -17,8 +17,8 @@ public interface DictApiService { ...@@ -17,8 +17,8 @@ public interface DictApiService {
* @author zhiwj * @author zhiwj
* @param dictType * @param dictType
* @param dictCode * @param dictCode
* @return com.gic.api.base.commons.ServiceResponse<com.gic.store.dto.GicDictDTO> * @return com.gic.api.base.commons.ServiceResponse<com.gic.store.dto.DictDTO>
* @throws * @throws
*/ */
ServiceResponse<GicDictDTO> getDictByCode(String dictType, String dictCode); ServiceResponse<DictDTO> getDictByCode(String dictType, String dictCode);
} }
package com.gic.store.dao.mapper; package com.gic.store.dao.mapper;
import com.gic.store.entity.TabGicDict; import com.gic.store.entity.TabDict;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
/** /**
* *
...@@ -16,7 +16,7 @@ public interface DictMapper { ...@@ -16,7 +16,7 @@ public interface DictMapper {
* @param record 实体对象 * @param record 实体对象
* @return 更新条目数 * @return 更新条目数
*/ */
int insert(TabGicDict record); int insert(TabDict record);
/** /**
* 动态插入一条记录 * 动态插入一条记录
...@@ -24,7 +24,7 @@ public interface DictMapper { ...@@ -24,7 +24,7 @@ public interface DictMapper {
* @param record 实体对象 * @param record 实体对象
* @return 更新条目数 * @return 更新条目数
*/ */
int insertSelective(TabGicDict record); int insertSelective(TabDict record);
/** /**
* 根据主键查询 * 根据主键查询
...@@ -32,7 +32,7 @@ public interface DictMapper { ...@@ -32,7 +32,7 @@ public interface DictMapper {
* @param dictId 主键 * @param dictId 主键
* @return 实体对象 * @return 实体对象
*/ */
TabGicDict selectByPrimaryKey(String dictId); TabDict selectByPrimaryKey(String dictId);
/** /**
* 根据主键动态更新记录 * 根据主键动态更新记录
...@@ -40,7 +40,7 @@ public interface DictMapper { ...@@ -40,7 +40,7 @@ public interface DictMapper {
* @param record 实体对象 * @param record 实体对象
* @return 更新条目数 * @return 更新条目数
*/ */
int updateByPrimaryKeySelective(TabGicDict record); int updateByPrimaryKeySelective(TabDict record);
/** /**
* 根据主键更新记录 * 根据主键更新记录
...@@ -48,7 +48,7 @@ public interface DictMapper { ...@@ -48,7 +48,7 @@ public interface DictMapper {
* @param record 实体对象 * @param record 实体对象
* @return 更新条目数 * @return 更新条目数
*/ */
int updateByPrimaryKey(TabGicDict record); int updateByPrimaryKey(TabDict record);
/** /**
* getDictByCode * getDictByCode
...@@ -57,8 +57,8 @@ public interface DictMapper { ...@@ -57,8 +57,8 @@ public interface DictMapper {
* @author zhiwj * @author zhiwj
* @param dictType * @param dictType
* @param dictCode * @param dictCode
* @return com.gic.store.entity.TabGicDict * @return com.gic.store.entity.TabDict
* @throws * @throws
*/ */
TabGicDict getDictByCode(@Param("dictType") String dictType, @Param("dictCode") String dictCode); TabDict getDictByCode(@Param("dictType") String dictType, @Param("dictCode") String dictCode);
} }
\ No newline at end of file
...@@ -3,16 +3,13 @@ package com.gic.store.entity; ...@@ -3,16 +3,13 @@ package com.gic.store.entity;
import java.util.Date; import java.util.Date;
/** /**
* tab_gic_dict
*/
/**
* *
* @ClassName: TabGicDict * @ClassName: TabDict
* @Description: * @Description:
* @author zhiwj * @author zhiwj
* @date 2020-09-09 18:35 * @date 2020-09-09 18:35
*/ */
public class TabGicDict { public class TabDict {
/** /**
* *
*/ */
......
package com.gic.store.service; package com.gic.store.service;
import com.gic.store.entity.TabGicDict; import com.gic.store.entity.TabDict;
/** /**
* @author zhiwj * @author zhiwj
...@@ -16,9 +16,9 @@ public interface DictService { ...@@ -16,9 +16,9 @@ public interface DictService {
* @author zhiwj * @author zhiwj
* @param dictType * @param dictType
* @param dictValue * @param dictValue
* @return com.gic.store.entity.TabGicDict * @return com.gic.store.entity.TabDict
* @throws * @throws
*/ */
TabGicDict getDictByCode(String dictType, String dictValue); TabDict getDictByCode(String dictType, String dictValue);
} }
package com.gic.store.service.impl; package com.gic.store.service.impl;
import com.gic.store.dao.mapper.DictMapper; import com.gic.store.dao.mapper.DictMapper;
import com.gic.store.entity.TabGicDict; import com.gic.store.entity.TabDict;
import com.gic.store.service.DictService; import com.gic.store.service.DictService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -19,7 +19,7 @@ public class DictServiceImpl implements DictService { ...@@ -19,7 +19,7 @@ public class DictServiceImpl implements DictService {
@Override @Override
public TabGicDict getDictByCode(String dictType, String dictCode) { public TabDict getDictByCode(String dictType, String dictCode) {
return dictMapper.getDictByCode(dictType, dictCode); return dictMapper.getDictByCode(dictType, dictCode);
} }
} }
...@@ -3,8 +3,8 @@ package com.gic.store.service.outer.impl; ...@@ -3,8 +3,8 @@ package com.gic.store.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.enterprise.response.EnterpriseServiceResponse; import com.gic.enterprise.response.EnterpriseServiceResponse;
import com.gic.store.dto.GicDictDTO; import com.gic.store.dto.DictDTO;
import com.gic.store.entity.TabGicDict; import com.gic.store.entity.TabDict;
import com.gic.store.service.DictApiService; import com.gic.store.service.DictApiService;
import com.gic.store.service.DictService; import com.gic.store.service.DictService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -22,9 +22,9 @@ public class DictApiServiceImpl implements DictApiService { ...@@ -22,9 +22,9 @@ public class DictApiServiceImpl implements DictApiService {
private DictService dictService; private DictService dictService;
@Override @Override
public ServiceResponse<GicDictDTO> getDictByCode(String dictType, String dictCode) { public ServiceResponse<DictDTO> getDictByCode(String dictType, String dictCode) {
TabGicDict dict = dictService.getDictByCode(dictType, dictCode); TabDict dict = dictService.getDictByCode(dictType, dictCode);
GicDictDTO gicDictDTO = EntityUtil.changeEntityByJSON(GicDictDTO.class, dict); DictDTO gicDictDTO = EntityUtil.changeEntityByJSON(DictDTO.class, dict);
return EnterpriseServiceResponse.success(gicDictDTO); return EnterpriseServiceResponse.success(gicDictDTO);
} }
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gic.store.dao.mapper.DictMapper"> <mapper namespace="com.gic.store.dao.mapper.DictMapper">
<resultMap id="BaseResultMap" type="com.gic.store.entity.TabGicDict"> <resultMap id="BaseResultMap" type="com.gic.store.entity.TabDict">
<id column="DICT_ID" jdbcType="CHAR" property="dictId" /> <id column="DICT_ID" jdbcType="CHAR" property="dictId" />
<result column="DICT_TYPE" jdbcType="VARCHAR" property="dictType" /> <result column="DICT_TYPE" jdbcType="VARCHAR" property="dictType" />
<result column="DICT_CODE" jdbcType="VARCHAR" property="dictCode" /> <result column="DICT_CODE" jdbcType="VARCHAR" property="dictCode" />
...@@ -17,19 +17,19 @@ ...@@ -17,19 +17,19 @@
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_gic_dict from tab_dict
where DICT_ID = #{dictId,jdbcType=CHAR} where DICT_ID = #{dictId,jdbcType=CHAR}
</select> </select>
<insert id="insert" parameterType="com.gic.store.entity.TabGicDict"> <insert id="insert" parameterType="com.gic.store.entity.TabDict">
insert into tab_gic_dict (DICT_ID, DICT_TYPE, DICT_CODE, insert into tab_dict (DICT_ID, DICT_TYPE, DICT_CODE,
DICT_VALUE, DICT_NAME, DICT_STATUS, DICT_VALUE, DICT_NAME, DICT_STATUS,
CREATE_DATE, DICT_SORT) CREATE_DATE, DICT_SORT)
values (#{dictId,jdbcType=CHAR}, #{dictType,jdbcType=VARCHAR}, #{dictCode,jdbcType=VARCHAR}, values (#{dictId,jdbcType=CHAR}, #{dictType,jdbcType=VARCHAR}, #{dictCode,jdbcType=VARCHAR},
#{dictValue,jdbcType=VARCHAR}, #{dictName,jdbcType=VARCHAR}, #{dictStatus,jdbcType=INTEGER}, #{dictValue,jdbcType=VARCHAR}, #{dictName,jdbcType=VARCHAR}, #{dictStatus,jdbcType=INTEGER},
#{createDate,jdbcType=TIMESTAMP}, #{dictSort,jdbcType=INTEGER}) #{createDate,jdbcType=TIMESTAMP}, #{dictSort,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.store.entity.TabGicDict"> <insert id="insertSelective" parameterType="com.gic.store.entity.TabDict">
insert into tab_gic_dict insert into tab_dict
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dictId != null"> <if test="dictId != null">
DICT_ID, DICT_ID,
...@@ -83,8 +83,8 @@ ...@@ -83,8 +83,8 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.store.entity.TabGicDict"> <update id="updateByPrimaryKeySelective" parameterType="com.gic.store.entity.TabDict">
update tab_gic_dict update tab_dict
<set> <set>
<if test="dictType != null"> <if test="dictType != null">
DICT_TYPE = #{dictType,jdbcType=VARCHAR}, DICT_TYPE = #{dictType,jdbcType=VARCHAR},
...@@ -110,8 +110,8 @@ ...@@ -110,8 +110,8 @@
</set> </set>
where DICT_ID = #{dictId,jdbcType=CHAR} where DICT_ID = #{dictId,jdbcType=CHAR}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.gic.store.entity.TabGicDict"> <update id="updateByPrimaryKey" parameterType="com.gic.store.entity.TabDict">
update tab_gic_dict update tab_dict
set DICT_TYPE = #{dictType,jdbcType=VARCHAR}, set DICT_TYPE = #{dictType,jdbcType=VARCHAR},
DICT_CODE = #{dictCode,jdbcType=VARCHAR}, DICT_CODE = #{dictCode,jdbcType=VARCHAR},
DICT_VALUE = #{dictValue,jdbcType=VARCHAR}, DICT_VALUE = #{dictValue,jdbcType=VARCHAR},
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
<select id="getDictByCode" resultMap="BaseResultMap"> <select id="getDictByCode" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from tab_gic_dict from tab_dict
where where
dict_type = #{dictType} and dict_code = #{dictCode} dict_type = #{dictType} and dict_code = #{dictCode}
</select> </select>
......
...@@ -468,7 +468,7 @@ public class ClerkImportController { ...@@ -468,7 +468,7 @@ public class ClerkImportController {
validate = false; validate = false;
} }
} }
GicDictDTO dict = this.dictApiService.getDictByCode(Constants.NATION_CODE_DICT, nationcode).getResult(); DictDTO dict = this.dictApiService.getDictByCode(Constants.NATION_CODE_DICT, nationcode).getResult();
if (dict == null) { if (dict == null) {
bean.setErrorMessage("区号错误"); bean.setErrorMessage("区号错误");
validate = false; validate = false;
......
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