Forráskód Böngészése

Merge remote-tracking branch 'origin/test'

limin 7 éve%!(EXTRA string=óta)
szülő
commit
c5209ef0ca

+ 2 - 0
src/main/java/com/goafanti/common/dao/JtCollectSearchMapper.java

@@ -95,4 +95,6 @@ public interface JtCollectSearchMapper {
     int updateByPrimaryKey(JtCollectSearch record);
 
 	int deleteByrowId(String id);
+
+	int updateByRowIdSelective(JtCollectSearch j);
 }

+ 20 - 0
src/main/java/com/goafanti/common/mapper/JtCollectSearchMapper.xml

@@ -345,4 +345,24 @@
     </if>
     ) a
   </select>
+  <update id="updateByRowIdSelective" parameterType="com.goafanti.common.model.JtCollectSearch">
+    
+    update jt_collect_search
+    <set>
+      <if test="fromTable != null">
+        from_table = #{fromTable,jdbcType=VARCHAR},
+      </if>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="keyword != null">
+        keyword = #{keyword,jdbcType=VARCHAR},
+      </if>
+      <if test="summary != null">
+        summary = #{summary,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where row_id = #{rowId,jdbcType=VARCHAR}
+  </update>
+  
 </mapper>

+ 11 - 0
src/main/java/com/goafanti/user/service/impl/UserServiceImpl.java

@@ -6,15 +6,18 @@ import java.util.Map;
 
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import com.goafanti.app.bo.UserBasicInfo;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.dao.JtCollectSearchMapper;
 import com.goafanti.common.dao.OrganizationIdentityMapper;
 import com.goafanti.common.dao.UserIdentityMapper;
 import com.goafanti.common.dao.UserMapper;
+import com.goafanti.common.model.JtCollectSearch;
 import com.goafanti.common.model.User;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -35,6 +38,10 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 	private OrganizationIdentityMapper		organizationIdentityMapper;
 	@Autowired
 	private UserIdentityMapper				userIdentityMapper;
+	@Autowired
+	private JtCollectSearchMapper 		jtCollectSearchMapper;
+	@Value(value="${collect_flag}")
+	private boolean collectFlag;
 	@Override
 	@Transactional
 	public User insertRegister(User user, String unitName, String userName) {
@@ -82,6 +89,10 @@ public class UserServiceImpl extends BaseMybatisDao<UserMapper> implements UserS
 
 	@Override
 	public int updateByPrimaryKeySelective(User u) {
+		JtCollectSearch j=new JtCollectSearch();
+		j.setRowId(u.getId());
+		j.setTitle(u.getNickname());
+		if(collectFlag)jtCollectSearchMapper.updateByRowIdSelective(j);
 		return userMapper.updateByPrimaryKeySelective(u);
 	}