ContractMapper.java 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. package com.fjhx.contract.mapper;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.fjhx.contract.entity.Contract;
  4. import org.apache.ibatis.annotations.Param;
  5. import org.springblade.core.mp.mapper.BladeMapper;
  6. import org.springblade.core.tenant.annotation.TenantIgnore;
  7. import org.springframework.stereotype.Repository;
  8. import java.util.List;
  9. import java.util.Map;
  10. /**
  11. * 外销合同
  12. */
  13. @Repository
  14. public interface ContractMapper extends BladeMapper<Contract> {
  15. /**
  16. * 列表
  17. *
  18. * @param condition
  19. * @return
  20. */
  21. @TenantIgnore
  22. List<Contract> getList(Map<String, Object> condition);
  23. /**
  24. * 列表-总条数
  25. *
  26. * @param condition
  27. * @return
  28. */
  29. @TenantIgnore
  30. Integer getListCount(Map<String, Object> condition);
  31. /**
  32. * 修改合同状态(合同状态如果走到后面不允许回滚)
  33. *
  34. * @param ids
  35. * @param status
  36. * @param updateUser
  37. * @return
  38. */
  39. int updateStatusById(@Param("ids") List<String> ids,
  40. @Param("status") Integer status,
  41. @Param("updateUser") String updateUser);
  42. /**
  43. * 根据合同号获取下一个版本号
  44. *
  45. * @param code
  46. * @return
  47. */
  48. Integer getNextVersionByCode(@Param("code") String code);
  49. /**
  50. * 客户画像:销售分析列表
  51. *
  52. * @param condition 查询条件
  53. * @return
  54. */
  55. List<Contract> getSalesAnalysisList(Map<String, Object> condition);
  56. /**
  57. * 客户画像:销售分析列表总数
  58. *
  59. * @param condition 查询条件
  60. * @return
  61. */
  62. Integer getSalesAnalysisListCount(Map<String, Object> condition);
  63. /**
  64. * 客户画像:销售分析下拉合同列表
  65. *
  66. * @param tenantId customerId 查询条件
  67. * @return
  68. */
  69. List<Contract> getContractSelect(@Param("tenantId") String tenantId,
  70. @Param("customerId") String customerId);
  71. /**
  72. * 通过客户id查询列表
  73. *
  74. * @param condition
  75. * @return
  76. */
  77. @TenantIgnore
  78. List<Contract> getByCustomerId(Map<String, Object> condition);
  79. /**
  80. * 统计--柱状图
  81. *
  82. * @param tenantId 租户ID
  83. * @param customerId 客户ID
  84. * @param contractStartStr 开始时间
  85. * @param contractEndStr 结束时间
  86. * @return
  87. */
  88. @TenantIgnore
  89. List<Contract> getByCustomerIdAndDWM(@Param("tenantId") String tenantId,
  90. @Param("customerId") String customerId,
  91. @Param("contractStartStr") String contractStartStr,
  92. @Param("contractEndStr") String contractEndStr
  93. );
  94. /**
  95. * 统计--销售额和订单数
  96. *
  97. * @param tenantId 租户ID
  98. * @param customerId 客户ID
  99. * @param contractStartStr 开始时间
  100. * @param contractEndStr 结束时间
  101. * @return
  102. */
  103. @TenantIgnore
  104. List<Contract> getByCustomerIdSumDWM(@Param("tenantId") String tenantId,
  105. @Param("customerId") String customerId,
  106. @Param("contractStartStr") String contractStartStr,
  107. @Param("contractEndStr") String contractEndStr,
  108. @Param("type") Integer type
  109. );
  110. /**
  111. * 统计-单天订单总数和销售额
  112. *
  113. * @param tenantId 租户ID
  114. * @param customerId 客户ID
  115. * @param contractStartStr 开始时间
  116. * @param contractEndStr 结束时间
  117. * @return
  118. */
  119. @TenantIgnore
  120. List<Contract> getByCustomerIdSumDayDWM(@Param("tenantId") String tenantId,
  121. @Param("customerId") String customerId,
  122. @Param("contractStartStr") String contractStartStr,
  123. @Param("contractEndStr") String contractEndStr,
  124. @Param("type") Integer type
  125. );
  126. /**
  127. * 客户画像--样品单-外销合同列表查询
  128. *
  129. * @param condition
  130. * @return
  131. */
  132. @TenantIgnore
  133. List<Contract> getHuaXList(Map<String, Object> condition);
  134. /**
  135. * 客户画像--样品单-外销合同列表查询-总条数
  136. *
  137. * @param condition
  138. * @return
  139. */
  140. @TenantIgnore
  141. Integer getHuaXListCount(Map<String, Object> condition);
  142. /**
  143. * 领导看板--统计全球-获取经纬度坐标
  144. *
  145. * @param condition
  146. * @return
  147. */
  148. @TenantIgnore
  149. List<Contract> getContractGlobal(Map<String, Object> condition);
  150. /**
  151. * 领导看板--统计国家
  152. *
  153. * @param condition
  154. * @return
  155. */
  156. @TenantIgnore
  157. List<Contract> getContractCountry(Map<String, Object> condition);
  158. /**
  159. * 领导看板--统计客户
  160. *
  161. * @param condition
  162. * @return
  163. */
  164. @TenantIgnore
  165. List<Contract> getContractCustomer(Map<String, Object> condition);
  166. /**
  167. * 领导看板--统计业务员
  168. *
  169. * @param condition
  170. * @return
  171. */
  172. @TenantIgnore
  173. List<Contract> getContractUser(Map<String, Object> condition);
  174. /**
  175. * 领导看板--统计产品
  176. *
  177. * @param condition
  178. * @return
  179. */
  180. @TenantIgnore
  181. List<Contract> getContractProductPrice(Map<String, Object> condition);
  182. /**
  183. * 领导看板--统计产品数量
  184. *
  185. * @param condition
  186. * @return
  187. */
  188. @TenantIgnore
  189. List<Contract> getContractProductOrder(Map<String, Object> condition);
  190. /**
  191. * 领导看板--订单分析-订单增长
  192. *
  193. * @param tenantId 租户ID
  194. * @param contractStartStr 开始时间
  195. * @param contractEndStr 结束时间
  196. * @return
  197. */
  198. @TenantIgnore
  199. List<Contract> getSumBoardDayYMD(@Param("tenantId") String tenantId,
  200. @Param("customerId") String customerId,
  201. @Param("contractStartStr") String contractStartStr,
  202. @Param("contractEndStr") String contractEndStr,
  203. @Param("type") Integer type
  204. );
  205. /**
  206. * 领导看板--订单分析-统计总订单量-销售额
  207. *
  208. * @param tenantId 租户ID
  209. * @param contractStartStr 开始时间
  210. * @param contractEndStr 结束时间
  211. * @return
  212. */
  213. @TenantIgnore
  214. List<Contract> getSumBoardOrder(@Param("tenantId") String tenantId,
  215. @Param("contractStartStr") String contractStartStr,
  216. @Param("contractEndStr") String contractEndStr,
  217. @Param("type") Integer type
  218. );
  219. /**
  220. * 领导看板--订单分析-订单增长
  221. *
  222. * @param tenantId 租户ID
  223. * @param contractStartStr 开始时间
  224. * @param contractEndStr 结束时间
  225. * @return
  226. */
  227. @TenantIgnore
  228. List<Contract> getSumBoardStatusDayYMD(@Param("tenantId") String tenantId,
  229. @Param("contractStartStr") String contractStartStr,
  230. @Param("contractEndStr") String contractEndStr,
  231. @Param("type") Integer type
  232. );
  233. /**
  234. * 移交
  235. *
  236. * @param tenantId 租户id
  237. * @param customerId 客户id,要移交的客户
  238. * @param userId 业务员id,移交给新的业务员id
  239. */
  240. void transfer(@Param("tenantId") String tenantId,
  241. @Param("customerId") String customerId,
  242. @Param("userId") String userId);
  243. /**
  244. * 查询总条数
  245. */
  246. @TenantIgnore
  247. List<Contract> getSumContractByYMD(Map<String, Object> condition);
  248. /**
  249. * 查询金额
  250. */
  251. @TenantIgnore
  252. Double getSumContractPriceByYMD(Map<String, Object> condition);
  253. /**
  254. * 统计总销售额
  255. */
  256. @TenantIgnore
  257. String getContractSumPrice(Map<String, Object> condition);
  258. /**
  259. * 统计下单客户数
  260. */
  261. @TenantIgnore
  262. Integer getContractSumCustomer(Map<String, Object> condition);
  263. /**
  264. * 统计订单数
  265. */
  266. @TenantIgnore
  267. String getContractSumOrder(Map<String, Object> condition);
  268. /**
  269. * 查询总条数
  270. */
  271. @TenantIgnore
  272. List<Contract> getDailyContract(@Param("tenantId") String tenantId,
  273. @Param("dataType") Integer dataType,
  274. @Param("createUser") String createUser);
  275. /**
  276. * 查询总条数
  277. */
  278. @TenantIgnore
  279. Integer getDailyContractCount(@Param("tenantId") String tenantId,
  280. @Param("dataType") Integer dataType,
  281. @Param("createUser") String createUser);
  282. /**
  283. * 查询总条数
  284. */
  285. @TenantIgnore
  286. Integer getUserDailyContractCount(Map<String, Object> condition);
  287. /**
  288. * 总览-订单跟踪-统计总额
  289. */
  290. @TenantIgnore
  291. List<Contract> getOrderTailAfterSum(@Param("tenantId") String tenantId,
  292. @Param("userId") String userId);
  293. /**
  294. * 总览-订单跟踪-统计总额
  295. */
  296. @TenantIgnore
  297. List<Contract> getOrderTailAfterSumStaus(@Param("tenantId") String tenantId,
  298. @Param("userId") String userId);
  299. /**
  300. * 根据用户ID查询
  301. *
  302. * @param userIds 业务员ID集合
  303. * @param year 年度
  304. * @param dataType 数据类型
  305. * @return
  306. */
  307. @TenantIgnore
  308. List<Contract> getByUserIds(@Param("userIds") List<String> userIds, @Param("year") String year, @Param("dataType") int dataType);
  309. /**
  310. * 根据用户ID查询
  311. *
  312. * @param userIds 业务员ID集合
  313. * @param year 年度
  314. * @param dataType 数据类型
  315. * @return
  316. */
  317. @TenantIgnore
  318. List<Contract> getByUserIdsJoin(@Param("userIds") List<String> userIds, @Param("year") String year, @Param("dataType") int dataType);
  319. /**
  320. * 根据子编号前缀代码统计
  321. *
  322. * @param prefixCode 子编号前缀代码
  323. * @param countryId 国家ID
  324. * @param customerId 客户ID
  325. * @param productId 产品ID
  326. * @param tenantId 租户ID
  327. * @param userId 用户ID
  328. * @param dataType 数据类型:0、外销合同;1、样品单
  329. * @return
  330. */
  331. @TenantIgnore
  332. Integer getCount(
  333. @Param("prefixCode") int prefixCode,
  334. @Param("countryId") String countryId,
  335. @Param("customerId") String customerId,
  336. @Param("productId") String productId,
  337. @Param("tenantId") String tenantId,
  338. @Param("userId") String userId,
  339. @Param("dataType") int dataType
  340. );
  341. /**
  342. * 查询销售信息
  343. *
  344. * @param condition 查询条件
  345. * @return
  346. */
  347. @TenantIgnore
  348. List<JSONObject> getOrderSale(Map<String, Object> condition);
  349. /**
  350. * 查询销售合同ID
  351. *
  352. * @param condition 查询条件
  353. * @return
  354. */
  355. @TenantIgnore
  356. List<Contract> getContractIds(Map<String, Object> condition);
  357. }