Browse Source

议题项目分类字典表,根据id+customerId联合主键修改

dev_shibei_match
zhangyongzhangyong 4 years ago
parent
commit
c589a9d00e
  1. 10
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java
  2. 6
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
  3. 33
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

10
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java

@ -157,4 +157,14 @@ public interface IssueProjectCategoryDictDao extends BaseDao<IssueProjectCategor
* @Date 14:10 2021-03-22
**/
LinkedList<CustomerCategoryResultDTO> selectListAllCategoryDict(@Param("customerId") String customerId, @Param("pid") String pid);
/**
* 根据 主键+customerId 修改议题项目分类字典
*
* @param entity
* @return int
* @Author zhangyong
* @Date 09:53 2021-03-30
**/
int updateIssueProjectCategoryDict(IssueProjectCategoryDictEntity entity);
}

6
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java

@ -355,10 +355,11 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
throw new RenException(EpmetErrorCode.CATEGORY_NAME.getCode(), EpmetErrorCode.CATEGORY_NAME.getMsg());
}
IssueProjectCategoryDictEntity entity = new IssueProjectCategoryDictEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setCategoryName(formDTO.getCategoryName());
entity.setSort(formDTO.getSort());
entity.setId(formDTO.getCategoryId());
baseDao.updateById(entity);
baseDao.updateIssueProjectCategoryDict(entity);
return new Result<>();
}
@ -419,10 +420,11 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
throw new RenException(EpmetErrorCode.CATEGORY_NAME.getCode(), EpmetErrorCode.CATEGORY_NAME.getMsg());
}
IssueProjectCategoryDictEntity entity = new IssueProjectCategoryDictEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setCategoryName(formDTO.getCategoryName());
entity.setSort(formDTO.getSort());
entity.setId(formDTO.getCategoryId());
baseDao.updateById(entity);
baseDao.updateIssueProjectCategoryDict(entity);
return new Result<>();
}

33
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -212,4 +212,37 @@
</if>
ORDER BY SORT, CATEGORY_CODE ASC
</select>
<update id="updateIssueProjectCategoryDict">
UPDATE issue_project_category_dict
SET
<if test='pid != "" and pid != null'>
PID = #{pid},
</if>
<if test='pids != "" and pids != null'>
PIDS = #{pids},
</if>
<if test='parentCategoryCode != "" and parentCategoryCode != null'>
PARENT_CATEGORY_CODE = #{parentCategoryCode},
</if>
<if test='categoryCode != "" and categoryCode != null'>
CATEGORY_CODE = #{categoryCode},
</if>
<if test='categoryName != "" and categoryName != null'>
CATEGORY_NAME = #{categoryName},
</if>
<if test='categoryType != "" and categoryType != null'>
CATEGORY_TYPE = #{categoryType},
</if>
<if test='sort != "" and sort != null'>
SORT = #{sort},
</if>
<if test='isDisable != "" and isDisable != null'>
IS_DISABLE = #{isDisable},
</if>
UPDATED_TIME = NOW()
WHERE
customer_id = #{customerId} AND id = #{id} AND DEL_FLAG = '0'
</update>
</mapper>

Loading…
Cancel
Save