@ -40,7 +40,7 @@ public interface TagCustomerDao extends BaseDao<TagCustomerEntity> {
* @param formDTO
* @author zxc
*/
void checkTagInfo(UpdateTagFormDTO formDTO);
void upsertTagCount(UpdateTagFormDTO formDTO);
/**
* @Description 初始化默认标签
@ -112,7 +112,7 @@ public class TagCustomerServiceImpl extends BaseServiceImpl<TagCustomerDao, TagC
formDTO.setCustomerId(customerId);
formDTO.setUpdatedBy(userId);
formDTO.setTagName(tagName);
baseDao.checkTagInfo(formDTO);
baseDao.upsertTagCount(formDTO);
UpdateTagUseCountsResultDTO resultDTO = new UpdateTagUseCountsResultDTO();
resultDTO.setTagId(formDTO.getId());
resultDTO.setTagName(tagName);
@ -3,9 +3,9 @@
<mapper namespace="com.epmet.dao.TagCustomerDao">
<insert id="checkTagInfo" parameterType="com.epmet.dto.form.UpdateTagFormDTO">
<insert id="upsertTagCount" parameterType="com.epmet.dto.form.UpdateTagFormDTO">
<selectKey keyProperty="id" order="AFTER" resultType="String">
select id from tag_customer where tag_name = #{tagName}
select id from tag_customer where tag_name = #{tagName} AND CUSTOMER_ID = #{customerId}
</selectKey>
INSERT INTO tag_customer ( ID, CUSTOMER_ID, TAG_NAME, USE_COUNT, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
VALUES