Guo1B0 1 year ago
parent
commit
8d2d48af29

+ 2 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessOpportunityMapper.java

@@ -25,4 +25,6 @@ public interface BusinessOpportunityMapper extends BaseMapper<BusinessOpportunit
     int getTotal(BusinessOpportunity bo);
     int getTotal1(@Param("bo") BusinessOpportunity bo,@Param("userId") String userId);
     int getTotal2(@Param("bo") BusinessOpportunity bo,@Param("userId") String userId);
+
+    BusinessOpportunity selectByIdToInfo(Integer id);
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java

@@ -75,7 +75,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
 
     @Override
     public BusinessOpportunity getInfo(BusinessOpportunity bo, User user) {
-        BusinessOpportunity businessOpportunity = bOMapper.selectById(bo.getId());
+        BusinessOpportunity businessOpportunity = bOMapper.selectByIdToInfo(bo.getId());
         businessOpportunity.setActionLogList(actionLogMapper.selectList(new QueryWrapper<ActionLog>().eq("item_id", bo.getId()).eq("code", "business")));
         businessOpportunity.setUploadFilePList(uploadFileMapper.selectByInfoList("business",bo.getId()));
         businessOpportunity.setTaskList(taskMapper.selectList(new QueryWrapper<Task>().eq("business_opportunity_id",bo.getId())));

+ 11 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/resources/mapper/BusinessOpportunityMapper.xml

@@ -230,7 +230,17 @@
             and id in (select business_id from business_product where product_id = #{productId})
         </if>
     </select>
-
+    <select id="selectByIdToInfo" resultType="com.management.platform.entity.BusinessOpportunity">
+        SELECT *,
+               (select `name` from stage where id = stage_id)          stageValue,
+               (select custom_name from custom where id = customer_id) customerName,
+               (select `name` from contacts where id = contacts_id)    contactsName,
+               (select `name` from `user` where id = contacts_id)      inchargerName,
+               (select `name` from `user` where id = creator_id)       creatorName,
+               (SELECT sum(total) from business_product WHERE business_id = id)
+        from business_opportunity
+        where id = #{id}
+    </select>
 
 
 </mapper>