|
|
@@ -110,17 +110,23 @@ public class UserArchivesServiceImpl extends BaseMybatisDao< UserArchivesMapper>
|
|
|
*/
|
|
|
@Override
|
|
|
public UserArchives insert(UserArchives userArchives) {
|
|
|
- if (userArchives.getAppearancePatentCount()!=null||
|
|
|
- userArchives.getInventionPatentCount()!=null||
|
|
|
- userArchives.getUtilityModelCount() !=null||
|
|
|
- userArchives.getSoftwareWorksCount()!=null||
|
|
|
- userArchives.getOtherCount()!=null
|
|
|
- ){
|
|
|
- int count = getCount(userArchives);
|
|
|
- userArchives.setPatentCount(count);
|
|
|
+ UserArchives query = userArchivesMapper.queryByUid(userArchives.getUid());
|
|
|
+ if (query != null){
|
|
|
+ userArchives.setId(query.getId());
|
|
|
+ return update(userArchives);
|
|
|
+ }else {
|
|
|
+ if (userArchives.getAppearancePatentCount()!=null||
|
|
|
+ userArchives.getInventionPatentCount()!=null||
|
|
|
+ userArchives.getUtilityModelCount() !=null||
|
|
|
+ userArchives.getSoftwareWorksCount()!=null||
|
|
|
+ userArchives.getOtherCount()!=null
|
|
|
+ ){
|
|
|
+ int count = getCount(userArchives);
|
|
|
+ userArchives.setPatentCount(count);
|
|
|
+ }
|
|
|
+ if(userArchives.getPatentCount()==null)userArchives.setPatentCount(0);
|
|
|
+ this.userArchivesMapper.insert(userArchives);
|
|
|
}
|
|
|
- if(userArchives.getPatentCount()==null)userArchives.setPatentCount(0);
|
|
|
- this.userArchivesMapper.insert(userArchives);
|
|
|
return userArchives;
|
|
|
}
|
|
|
|