Skip to content

Commit

Permalink
fixbug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangshibin committed Jul 9, 2019
1 parent e036171 commit 4e8f0d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
10 changes: 5 additions & 5 deletions molicode-dao/src/main/resources/mapper/CommonExtInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<if test="status != null">AND status = #{status}</if>
<if test="created != null">AND created = #{created}</if>
<if test="modified != null">AND modified = #{modified}</if>
<if test="type != null">AND type = #{type}</if>
<if test="type != null">AND `type` = #{type}</if>
</where>
</sql>

Expand All @@ -54,20 +54,20 @@


<sql id="All-FIELDS">
id,owner_type,owner_code,ext_key,ext_value,creator,operator,concurrent_version,data_version,status,created,modified,type
id,owner_type,owner_code,ext_key,ext_value,creator,operator,concurrent_version,data_version,status,created,modified,`type`
</sql>

<insert id="add" parameterType="com.shareyi.molicode.domain.conf.CommonExtInfo"
keyProperty="id" useGeneratedKeys="true">
INSERT INTO AC_COMMON_EXT_INFO (owner_type,owner_code,ext_key,ext_value,creator,operator,concurrent_version,data_version,status,created,modified,type)
INSERT INTO AC_COMMON_EXT_INFO (owner_type,owner_code,ext_key,ext_value,creator,operator,concurrent_version,data_version,status,created,modified,`type`)
VALUES(#{ownerType},#{ownerCode},#{extKey},#{extValue},#{creator},#{operator},#{concurrentVersion},#{dataVersion},#{status},#{created},#{modified},#{type})
</insert>


<!-- 批量添加数据 -->
<insert id="batchAdd" parameterType="java.util.List">
INSERT INTO AC_COMMON_EXT_INFO
(owner_type,owner_code,ext_key,ext_value,creator,operator,concurrent_version,data_version,status,created,modified,type)
(owner_type,owner_code,ext_key,ext_value,creator,operator,concurrent_version,data_version,status,created,modified,`type`)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(#{item.ownerType},#{item.ownerCode},#{item.extKey},#{item.extValue},#{item.creator},#{item.operator},#{item.concurrentVersion},#{item.dataVersion},#{item.status},#{item.created},#{item.modified},#{type})
Expand All @@ -84,7 +84,7 @@
<if test="operator !=null">operator = #{operator},</if>
<if test="dataVersion !=null">data_version = #{dataVersion},</if>
<if test="status !=null">status = #{status},</if>
<if test="type !=null">type = #{type},</if>
<if test="type !=null">`type` = #{type},</if>

concurrent_version = concurrent_version + 1
</set>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ public Class getBizClass() {
return CommonExtInfo.class;
}


@Override
public CommonExtInfo supplyAddInfo(CommonExtInfo dto) {
super.supplyAddInfo(dto);
//默认设置为text
if (dto.getType() == null) {
dto.setType(DataTypeEnum.TEXT.getCode());
}
return dto;
}

public Map<String, Map<String, String>> buildConfigMap(List<CommonExtInfo> list) {
Map<String, Map<String, String>> dataMap = new HashMap<>();
if (CollectionUtils.isEmpty(list)) {
Expand Down

0 comments on commit 4e8f0d1

Please sign in to comment.