InsOrdersMapper.xml 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ydtech.modules.order.dao.InsOrdersMapper">
  6. <resultMap id="BaseResultMap" type="com.ydtech.modules.order.entity.InsOrders">
  7. <id property="orderno" column="orderno" jdbcType="VARCHAR"/>
  8. <result property="quoteno" column="quoteno" jdbcType="VARCHAR"/>
  9. <result property="orderstatus" column="orderstatus" jdbcType="VARCHAR"/>
  10. <result property="companyId" column="company_id" jdbcType="VARCHAR"/>
  11. <result property="insCompany" column="ins_company" jdbcType="VARCHAR"/>
  12. <result property="carinfo" column="carinfo" javaType="com.alibaba.fastjson.JSONObject"
  13. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  14. <result property="userid" column="userid" jdbcType="VARCHAR"/>
  15. <result property="username" column="username" jdbcType="VARCHAR"/>
  16. <result property="deptid" column="deptid" jdbcType="VARCHAR"/>
  17. <result property="deptname" column="deptname" jdbcType="VARCHAR"/>
  18. <result property="ownerinfo" column="ownerinfo" javaType="com.alibaba.fastjson.JSONObject"
  19. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  20. <result property="applyinfo" column="applyinfo" javaType="com.alibaba.fastjson.JSONObject"
  21. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  22. <result property="insureinfo" column="insureinfo" javaType="com.alibaba.fastjson.JSONObject"
  23. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"
  24. jdbcType="VARCHAR"/>
  25. <result property="agreeid" column="agreeid" jdbcType="VARCHAR"/>
  26. <result property="productid" column="productid" jdbcType="VARCHAR"/>
  27. <result property="product" column="product" jdbcType="VARCHAR"/>
  28. <result property="createtime" column="createtime" jdbcType="TIMESTAMP"/>
  29. <result property="frameno" column="frameno" jdbcType="VARCHAR"/>
  30. <result property="licenseno" column="licenseno" jdbcType="VARCHAR"/>
  31. <result property="insuredname" column="insuredname" jdbcType="VARCHAR"/>
  32. <result property="jqstartdate" column="jqstartdate" jdbcType="VARCHAR"/>
  33. <result property="jqenddate" column="jqenddate" jdbcType="VARCHAR"/>
  34. <result property="systartdate" column="systartdate" jdbcType="VARCHAR"/>
  35. <result property="syenddate" column="syenddate" jdbcType="VARCHAR"/>
  36. <result property="jqpremium" column="jqpremium" jdbcType="VARCHAR"/>
  37. <result property="sypremium" column="sypremium" jdbcType="VARCHAR"/>
  38. <result property="jypremium" column="jypremium" jdbcType="VARCHAR"/>
  39. <result property="taxamount" column="taxamount" jdbcType="VARCHAR"/>
  40. <result property="risk" column="risk" javaType="com.alibaba.fastjson.JSONArray"
  41. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  42. <result property="king" column="king" javaType="com.alibaba.fastjson.JSONArray"
  43. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  44. <result property="vehicleAndVesselTax" column="vehicle_and_vessel_tax"
  45. javaType="com.alibaba.fastjson.JSONObject"
  46. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  47. <result property="subOrderId" column="subOrderId" jdbcType="VARCHAR"/>
  48. <result property="agreementCode" column="agreementCode" jdbcType="VARCHAR"/>
  49. <result property="agreementName" column="agreementName" jdbcType="VARCHAR"/>
  50. <result property="partnerCompaniesName" column="partnerCompaniesName" jdbcType="VARCHAR"/>
  51. <result property="managementSource" column="managementSource" jdbcType="VARCHAR"/>
  52. <result property="leaderName" column="leader_name" jdbcType="VARCHAR"/>
  53. <result property="leaderId" column="leader_id" jdbcType="VARCHAR"/>
  54. <result property="underwritingStatus" column="underwritingStatus" jdbcType="INTEGER"/>
  55. </resultMap>
  56. <resultMap id="OrderResultMap" type="com.ydtech.modules.order.entity.vo.OrderVo">
  57. <id property="orderno" column="orderno" jdbcType="VARCHAR"/>
  58. <result property="quoteno" column="quoteno" jdbcType="VARCHAR"/>
  59. <result property="apiType" column="api_type" jdbcType="VARCHAR"/>
  60. <result property="orderstatus" column="orderstatus" jdbcType="VARCHAR"/>
  61. <result property="carinfo" column="carinfo" javaType="com.alibaba.fastjson.JSONObject"
  62. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  63. <result property="userid" column="userid" jdbcType="VARCHAR"/>
  64. <result property="username" column="username" jdbcType="VARCHAR"/>
  65. <result property="deptid" column="deptid" jdbcType="VARCHAR"/>
  66. <result property="deptname" column="deptname" jdbcType="VARCHAR"/>
  67. <result property="ownerinfo" column="ownerinfo" javaType="com.alibaba.fastjson.JSONObject"
  68. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  69. <result property="applyinfo" column="applyinfo" javaType="com.alibaba.fastjson.JSONObject"
  70. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  71. <result property="insureinfo" column="insureinfo" javaType="com.alibaba.fastjson.JSONObject"
  72. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler"
  73. jdbcType="VARCHAR"/>
  74. <result property="agreeid" column="agreeid" jdbcType="VARCHAR"/>
  75. <result property="productid" column="productid" jdbcType="VARCHAR"/>
  76. <result property="product" column="product" jdbcType="VARCHAR"/>
  77. <result property="frameno" column="frameno" jdbcType="VARCHAR"/>
  78. <result property="licenseno" column="licenseno" jdbcType="VARCHAR"/>
  79. <result property="insuredname" column="insuredname" jdbcType="VARCHAR"/>
  80. <result property="jqstartdate" column="jqstartdate" jdbcType="VARCHAR"/>
  81. <result property="jqenddate" column="jqenddate" jdbcType="VARCHAR"/>
  82. <result property="systartdate" column="systartdate" jdbcType="VARCHAR"/>
  83. <result property="syenddate" column="syenddate" jdbcType="VARCHAR"/>
  84. <result property="id" column="id" jdbcType="BIGINT"/>
  85. <result property="companyId" column="company_id" jdbcType="BIGINT"/>
  86. <result property="reptxt" column="reptxt" javaType="com.alibaba.fastjson.JSONObject"
  87. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  88. <result property="vehicleAndVesselTax" column="vehicle_and_vessel_tax"
  89. javaType="com.alibaba.fastjson.JSONObject"
  90. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  91. <result property="inscompany" column="inscompany" jdbcType="VARCHAR"/>
  92. <result property="jqapplyno" column="jqapplyno" jdbcType="VARCHAR"/>
  93. <result property="jqpolicyno" column="jqpolicyno" jdbcType="VARCHAR"/>
  94. <result property="syapplyno" column="syapplyno" jdbcType="VARCHAR"/>
  95. <result property="sypolicyno" column="sypolicyno" jdbcType="VARCHAR"/>
  96. <result property="riskinfo" column="riskinfo" javaType="com.alibaba.fastjson.JSONArray"
  97. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  98. <result property="kindinfo" column="kindinfo" javaType="com.alibaba.fastjson.JSONArray"
  99. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  100. <result property="jqpremium" column="jqpremium" jdbcType="DECIMAL"/>
  101. <result property="sypremium" column="sypremium" jdbcType="DECIMAL"/>
  102. <result property="jypremium" column="jypremium" jdbcType="DECIMAL"/>
  103. <result property="taxamount" column="taxamount" jdbcType="DECIMAL"/>
  104. <result property="sumpremium" column="sumpremium" jdbcType="DECIMAL"/>
  105. <result property="jqdiscountrate" column="jqdiscountrate" jdbcType="DOUBLE"/>
  106. <result property="sydiscountrate" column="sydiscountrate" jdbcType="DOUBLE"/>
  107. <result property="feerate" column="feerate" jdbcType="DOUBLE"/>
  108. <result property="disrate" column="disrate" jdbcType="DOUBLE"/>
  109. <result property="auditid" column="auditid" jdbcType="VARCHAR"/>
  110. <result property="auditname" column="auditname" jdbcType="VARCHAR"/>
  111. <result property="audittime" column="audittime" jdbcType="TIMESTAMP"/>
  112. <result property="auditopinion" column="auditopinion" jdbcType="VARCHAR"/>
  113. <result property="jqappoint" column="jqappoint" jdbcType="VARCHAR"/>
  114. <result property="syappoint" column="syappoint" jdbcType="VARCHAR"/>
  115. <result property="createtime" column="createtime" jdbcType="TIMESTAMP"/>
  116. <result property="paymentLink" column="payment_link" jdbcType="VARCHAR"/>
  117. <result property="accidentInfo" column="accident_info" javaType="com.alibaba.fastjson.JSONArray"
  118. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  119. <result property="taxArrears" column="tax_arrears" javaType="com.alibaba.fastjson.JSONArray"
  120. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  121. <result property="crossInsurance" column="cross_insurance" javaType="com.alibaba.fastjson.JSONArray"
  122. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  123. <result property="ubiPredictedInfoScore" column="ubi_predicted_info_score" jdbcType="VARCHAR"/>
  124. <result property="signingTime" column="signingTime" jdbcType="TIMESTAMP"/>
  125. <result property="payDate" column="payDate" jdbcType="TIMESTAMP"/>
  126. <result property="partnerCompaniesName" column="partnerCompaniesName" jdbcType="VARCHAR"/>
  127. </resultMap>
  128. <resultMap id="OrderExcelResultMap" type="com.ydtech.modules.ins.model.InsOrdersExcel">
  129. <id property="orderNo" column="orderno" jdbcType="VARCHAR"/>
  130. <result property="licenseNo" column="licenseno" jdbcType="VARCHAR"/>
  131. <result property="fraMeno" column="frameno" jdbcType="VARCHAR"/>
  132. <result property="carInfo" column="carinfo" javaType="com.alibaba.fastjson.JSONObject" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  133. <result property="score" column="score" jdbcType="VARCHAR"/>
  134. <result property="ownerInfo" column="ownerinfo" javaType="com.alibaba.fastjson.JSONObject" typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  135. <result property="jqpRemIum" column="jqpremium" jdbcType="VARCHAR"/>
  136. <result property="apiType" column="api_type" jdbcType="VARCHAR"/>
  137. <result property="jqPolicyno" column="jqpolicyno" jdbcType="VARCHAR"/>
  138. <result property="sypRemIum" column="sypremium" jdbcType="VARCHAR"/>
  139. <result property="syPolicyno" column="sypolicyno" jdbcType="VARCHAR"/>
  140. <result property="jypRemIum" column="jypremium" jdbcType="VARCHAR"/>
  141. <result property="taxaMount" column="taxamount" jdbcType="VARCHAR"/>
  142. <result property="jqStartDate" column="jq_start_date" jdbcType="VARCHAR"/>
  143. <result property="jqEndDate" column="jq_end_date" jdbcType="VARCHAR"/>
  144. <result property="syStartDate" column="sy_start_date" jdbcType="VARCHAR"/>
  145. <result property="syEndDate" column="sy_end_date" jdbcType="VARCHAR"/>
  146. <result property="jqScore" column="jq_score" jdbcType="VARCHAR"/>
  147. <result property="syScore" column="sy_score" jdbcType="VARCHAR"/>
  148. <result property="lossRation" column="loss_ration" jdbcType="VARCHAR"/>
  149. <result property="jqLossRation" column="jq_loss_ration" jdbcType="VARCHAR"/>
  150. <result property="syLossRation" column="sy_loss_ration" jdbcType="VARCHAR"/>
  151. <result property="insCompany" column="inscompany" jdbcType="VARCHAR"/>
  152. <result property="agreementId" column="agreement_id" jdbcType="VARCHAR"/>
  153. <result property="userId" column="userid" jdbcType="VARCHAR"/>
  154. <result property="userName" column="username" jdbcType="VARCHAR"/>
  155. <result property="applyInfo" column="applyinfo" javaType="com.alibaba.fastjson.JSONObject"
  156. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  157. <result property="insureInfo" column="insureinfo" javaType="com.alibaba.fastjson.JSONObject"
  158. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  159. <result property="kindInfo" column="kindinfo" javaType="com.alibaba.fastjson.JSONArray"
  160. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  161. <result property="payDate" column="pay_date" jdbcType="VARCHAR"/>
  162. <result property="signingTime" column="signing_time" jdbcType="VARCHAR"/>
  163. <result property="crossInsurance" column="cross_insurance" javaType="com.alibaba.fastjson.JSONArray"
  164. typeHandler="com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler" jdbcType="VARCHAR"/>
  165. </resultMap>
  166. <sql id="Base_Column_List">
  167. orderno,quoteno,orderstatus,
  168. carinfo,userid,username,
  169. deptid,deptname,ownerinfo,
  170. applyinfo,insureinfo,agreeid,
  171. productid,product,createtime,
  172. frameno,licenseno,insuredname,
  173. jqstartdate,jqenddate,systartdate,
  174. syenddate
  175. </sql>
  176. <select id="getOrderAndAreaCompany" parameterType="java.lang.String" resultMap="OrderResultMap">
  177. select o.orderno,
  178. o.quoteno,
  179. o.carinfo,
  180. o.userid,
  181. o.username,
  182. o.deptid,
  183. o.deptname,
  184. o.ownerinfo,
  185. o.applyinfo,
  186. o.insureinfo,
  187. o.agreeid,
  188. o.productid,
  189. o.product,
  190. o.frameno,
  191. o.licenseno,
  192. o.insuredname,
  193. o.vehicle_and_vessel_tax,
  194. o.is_external,
  195. iac.jq_start_date as jqstartdate,
  196. iac.jq_end_date as jqenddate,
  197. iac.sy_start_date as systartdate,
  198. iac.sy_end_date as syenddate,
  199. iac.id,
  200. iac.api_type,
  201. iac.company_id,
  202. iac.reptxt,
  203. iac.orderstatus,
  204. iac.inscompany,
  205. iac.jqapplyno,
  206. iac.jqpolicyno,
  207. iac.syapplyno,
  208. iac.sypolicyno,
  209. iac.riskinfo,
  210. iac.kindinfo,
  211. iac.jqpremium,
  212. iac.sypremium,
  213. iac.jypremium,
  214. iac.taxamount,
  215. iac.sumpremium,
  216. iac.jqdiscountrate,
  217. iac.sydiscountrate,
  218. iac.feerate,
  219. iac.disrate,
  220. iac.auditid,
  221. iac.auditname,
  222. iac.audittime,
  223. iac.auditopinion,
  224. iac.jqappoint,
  225. iac.syappoint,
  226. iac.createtime,
  227. iac.payment_link,
  228. iac.accident_info,
  229. iac.tax_arrears,
  230. iac.cross_insurance,
  231. iac.ubi_predicted_info_score,
  232. iac.signing_time as signingTime,
  233. iac.pay_date as payDate,
  234. eic.namesimple as partnerCompaniesName
  235. from ins_orders as o
  236. join ins_area_company iac on o.orderno = iac.orderno
  237. LEFT JOIN ptl_agreement pa ON pa.id = iac.agreement_id
  238. LEFT JOIN esm_ins_company eic on eic.id = pa.partner_companies_id
  239. where iac.id = #{companyId}
  240. </select>
  241. <select id="getByUseridAndLicenseNo" resultType="com.ydtech.modules.order.entity.InsOrders"
  242. parameterType="com.ydtech.modules.order.entity.vo.VerifyOrdersVo">
  243. select orderno,
  244. quoteno,
  245. orderstatus,
  246. carinfo,
  247. userid,
  248. username,
  249. deptid,
  250. deptname,
  251. ownerinfo,
  252. applyinfo,
  253. insureinfo,
  254. agreeid,
  255. productid,
  256. product,
  257. createtime,
  258. frameno,
  259. licenseno,
  260. insuredname,
  261. jqstartdate,
  262. jqenddate,
  263. systartdate,
  264. syenddate,
  265. risk,
  266. king,
  267. vehicle_and_vessel_tax
  268. from ins_orders
  269. where userid = #{userId, jdbcType=VARCHAR}
  270. and licenseno = #{licenseNo, jdbcType=VARCHAR}
  271. and createtime > DATE_SUB(CURDATE(), INTERVAL 6 MONTH)
  272. </select>
  273. <select id="queryPageOrderCount" resultType="Long">
  274. select
  275. count(1)
  276. from (
  277. select
  278. io.orderno
  279. from
  280. ins_orders io
  281. <!--如果存在 公司查询则进行连表 -->
  282. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  283. left JOIN
  284. ins_area_company iac on iac.orderno = io.orderno
  285. </if>
  286. <where>
  287. <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
  288. and io.orderno = #{orderQueryVo.orderNo}
  289. </if>
  290. <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != ''">
  291. and io.deptid like "${orderQueryVo.deptId}%"
  292. </if>
  293. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
  294. and io.orderstatus = #{orderQueryVo.orderStatus}
  295. </if>
  296. <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
  297. and io.frameno = #{orderQueryVo.frameNo}
  298. </if>
  299. <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
  300. and io.licenseno = #{orderQueryVo.licenseNo}
  301. </if>
  302. <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
  303. and io.insuredname = #{orderQueryVo.insuredName}
  304. </if>
  305. <if test="orderQueryVo.startDate != null and orderQueryVo.endDate != null">
  306. and DATE_FORMAT(io.createtime, '%Y-%m-%d') between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
  307. </if>
  308. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  309. and iac.company_id = #{orderQueryVo.companyId}
  310. </if>
  311. <!--
  312. <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and isCdy">
  313. and io.operatorid = #{orderQueryVo.userId}
  314. </if>
  315. -->
  316. <choose>
  317. <when test="isCdy">
  318. <if test="deptId != null and deptId != '' ">
  319. and io.deptid like "${deptId}%"
  320. </if>
  321. </when>
  322. <otherwise>
  323. <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and !isTeamLeader">
  324. and io.userid = #{orderQueryVo.userId}
  325. </if>
  326. </otherwise>
  327. </choose>
  328. </where>
  329. group by io.orderno
  330. ) as s
  331. </select>
  332. <select id="queryPageOrder" resultMap="BaseResultMap">
  333. select
  334. io.*
  335. from
  336. ins_orders io
  337. <!--如果存在 公司查询则进行连表 -->
  338. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  339. left JOIN
  340. ins_area_company iac on iac.orderno = io.orderno
  341. </if>
  342. <where>
  343. <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
  344. and io.orderno = #{orderQueryVo.orderNo}
  345. </if>
  346. <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != ''">
  347. and io.deptid like "${orderQueryVo.deptId}%"
  348. </if>
  349. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
  350. and io.orderstatus = #{orderQueryVo.orderStatus}
  351. </if>
  352. <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
  353. and io.frameno = #{orderQueryVo.frameNo}
  354. </if>
  355. <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
  356. and io.licenseno = #{orderQueryVo.licenseNo}
  357. </if>
  358. <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
  359. and io.insuredname = #{orderQueryVo.insuredName}
  360. </if>
  361. <if test="orderQueryVo.startDate != null and orderQueryVo.endDate != null">
  362. and DATE_FORMAT(io.createtime, '%Y-%m-%d') between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
  363. </if>
  364. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  365. and iac.company_id = #{orderQueryVo.companyId}
  366. </if>
  367. <if test="orderQueryVo.product != null and orderQueryVo.product != ''">
  368. and io.product = #{orderQueryVo.product}
  369. </if>
  370. <if test="orderQueryVo.productid != null and orderQueryVo.productid != ''">
  371. and io.productid = #{orderQueryVo.productid}
  372. </if>
  373. <!--
  374. <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and isCdy">
  375. and io.operatorid = #{orderQueryVo.userId}
  376. </if>
  377. -->
  378. <choose>
  379. <when test="isCdy">
  380. <if test="deptId != null and deptId != '' ">
  381. and io.deptid like "${deptId}%"
  382. </if>
  383. </when>
  384. <otherwise>
  385. <if test="orderQueryVo.userId != null and orderQueryVo.userId != '' and !isTeamLeader">
  386. and io.userid = #{orderQueryVo.userId}
  387. </if>
  388. </otherwise>
  389. </choose>
  390. </where>
  391. group by
  392. orderno
  393. order by io.createtime desc
  394. </select>
  395. <select id="queryOrderList" parameterType="com.ydtech.modules.ins.model.InsOrdersExcelVo" resultMap="OrderExcelResultMap">
  396. select
  397. a.orderno,
  398. a.licenseno,
  399. a.frameno,
  400. a.carinfo,
  401. b.api_type,
  402. b.score,
  403. a.ownerinfo,
  404. b.jqpremium,
  405. b.jqpolicyno,
  406. b.sypremium,
  407. b.sypolicyno,
  408. b.jypremium,
  409. b.taxamount,
  410. b.jq_start_date,
  411. b.jq_end_date,
  412. b.sy_start_date,
  413. b.sy_end_date,
  414. b.score,
  415. b.jq_score,
  416. b.sy_score,
  417. b.loss_ration,
  418. b.jq_loss_ration,
  419. b.sy_loss_ration,
  420. b.score,
  421. b.inscompany,
  422. b.agreement_id,
  423. a.userid,
  424. a.username,
  425. a.applyinfo,
  426. a.insureinfo,
  427. b.kindinfo,
  428. b.pay_date,
  429. b.signing_time,
  430. b.cross_insurance
  431. FROM ins_orders a LEFT JOIN ins_area_company b on a.orderno = b.orderno
  432. WHERE
  433. 1 = 1
  434. <if test="orderstatus != null and orderstatus != '' ">
  435. and b.orderstatus = #{orderstatus}
  436. </if>
  437. <if test="startDate != null ">
  438. and b.signing_time &gt;= #{startDate}
  439. </if>
  440. <if test="endDate != null ">
  441. and b.signing_time &lt;= #{endDate}
  442. </if>
  443. </select>
  444. <resultMap id="PolicyInsuranceReportMap" type="com.ydtech.modules.order.entity.vo.PolicyInsuranceReportResVo">
  445. <result property="insCompany" column="insCompany" jdbcType="VARCHAR"/>
  446. <result property="agreementName" column="agreementName" jdbcType="VARCHAR"/>
  447. <result property="policyNo" column="policyNo" jdbcType="VARCHAR"/>
  448. <result property="quoteDate" column="quoteDate" jdbcType="VARCHAR"/>
  449. <result property="policyStartDate" column="policyStartDate" jdbcType="VARCHAR"/>
  450. <result property="riskName" column="riskName" jdbcType="VARCHAR"/>
  451. <result property="sumPremium" column="sumPremium" jdbcType="DECIMAL"/>
  452. <result property="taxPremium" column="taxPremium" jdbcType="DECIMAL"/>
  453. <result property="taxLaterPremium" column="taxLaterPremium" jdbcType="DECIMAL"/>
  454. <result property="insuranceSubAmount" column="insuranceSubAmount" jdbcType="VARCHAR"/>
  455. <result property="licenseNo" column="licenseNo" jdbcType="VARCHAR"/>
  456. <result property="vehicleUse" column="vehicleUse" jdbcType="VARCHAR"/>
  457. <result property="powerType" column="powerType" jdbcType="VARCHAR"/>
  458. <result property="ciModelClass" column="ciModelClass" jdbcType="VARCHAR"/>
  459. <result property="limitLoad" column="limitLoad" jdbcType="VARCHAR"/>
  460. <result property="appliName" column="appliName" jdbcType="VARCHAR"/>
  461. <result property="insureName" column="insureName" jdbcType="VARCHAR"/>
  462. <result property="deptName" column="deptName" jdbcType="VARCHAR"/>
  463. <result property="userName" column="username" jdbcType="VARCHAR"/>
  464. </resultMap>
  465. <select id="getPolicyInsuranceReport" resultMap="PolicyInsuranceReportMap">
  466. /*交强数据*/
  467. SELECT a.`inscompany` AS insCompany,
  468. (SELECT agreement_name FROM ptl_agreement t WHERE t.`id`= a.`agreement_id`) AS agreementName,
  469. a.`jqpolicyno` AS policyNo,
  470. <if test="policyReqVo.queryFlag=='queryPayDate'.toString()">
  471. a.pay_date AS quoteDate,
  472. </if>
  473. <if test="policyReqVo.queryFlag=='queryPayTime'.toString()">
  474. a.inside_pay_time AS quoteDate,
  475. </if>
  476. a.`jq_start_date` AS policyStartDate,
  477. '交强险' AS riskName,
  478. a.`jqpremium` AS sumPremium,
  479. a.`taxamount` AS taxPremium,
  480. getCarShipLateFee(a.`id`) AS taxLaterPremium,
  481. '交强险 : 200000.00,' AS insuranceSubAmount,
  482. b.`licenseno` AS licenseNo,
  483. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.vehicleUse'),'"',''),'3') AS vehicleUse,
  484. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.powertype'),'"',''),'2') AS powerType,
  485. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.cimodelclass'),'"',''),'4') AS ciModelClass,
  486. REPLACE(JSON_EXTRACT(b.carinfo, '$.limitLoad'),'"','') AS limitLoad,
  487. REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') AS appliName,
  488. REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') AS insureName,
  489. b.`deptname` AS deptName,
  490. b.`username` AS userName
  491. FROM ins_area_company a,ins_orders b WHERE a.`jqpolicyno` IS NOT NULL AND a.`jqpolicyno`!='' AND a.`agreement_id` IS NOT NULL
  492. AND a.`orderno`=b.`orderno`
  493. <if test="policyReqVo.deptId != null and policyReqVo.deptId != ''">
  494. and b.deptid = #{policyReqVo.deptId}
  495. </if>
  496. <if test="policyReqVo.userId != null and policyReqVo.userId != ''">
  497. and b.userid = #{policyReqVo.userId}
  498. </if>
  499. <if test="policyReqVo.userName != null and policyReqVo.userName != ''">
  500. and b.username = #{policyReqVo.userName}
  501. </if>
  502. <if test="policyReqVo.appliName != null and policyReqVo.appliName != ''">
  503. and REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') = #{policyReqVo.appliName}
  504. </if>
  505. <if test="policyReqVo.insureName != null and policyReqVo.insureName != ''">
  506. and REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') = #{policyReqVo.insureName}
  507. </if>
  508. <if test="policyReqVo.productId != null and policyReqVo.productId != ''">
  509. and b.productid = #{policyReqVo.productId}
  510. </if>
  511. <if test="policyReqVo.insCompany != null and policyReqVo.insCompany != ''">
  512. and a.company_id = #{policyReqVo.insCompany}
  513. </if>
  514. <if test="policyReqVo.operatorId != null and policyReqVo.operatorId != ''">
  515. and a.operatorid = #{policyReqVo.operatorId}
  516. </if>
  517. <if test="policyReqVo.quoteStartDate != null and policyReqVo.quoteEndDate != null">
  518. <if test="policyReqVo.queryFlag=='queryPayDate'.toString()">
  519. and a.pay_date between #{policyReqVo.quoteStartDate} AND #{policyReqVo.quoteEndDate}
  520. </if>
  521. <if test="policyReqVo.queryFlag=='queryPayTime'.toString()">
  522. and a.inside_pay_time between #{policyReqVo.quoteStartDate} AND #{policyReqVo.quoteEndDate}
  523. </if>
  524. </if>
  525. <if test="policyReqVo.policyStartDate != null and policyReqVo.policyEndDate != null">
  526. and a.jq_start_date between #{policyReqVo.policyStartDate} AND #{policyReqVo.policyEndDate}
  527. </if>
  528. UNION ALL
  529. /*##商业数据*/
  530. SELECT a.`inscompany` AS insCompany,
  531. (SELECT agreement_name FROM ptl_agreement t WHERE t.`id`= a.`agreement_id`) AS agreementName,
  532. a.`sypolicyno` AS policyNo,
  533. <if test="policyReqVo.queryFlag=='queryPayDate'.toString()">
  534. a.pay_date AS quoteDate,
  535. </if>
  536. <if test="policyReqVo.queryFlag=='queryPayTime'.toString()">
  537. a.inside_pay_time AS quoteDate,
  538. </if>
  539. a.`sy_start_date` AS policyStartDate,
  540. '商业险' AS riskName,
  541. a.`sypremium` AS sumPremium,
  542. '' AS taxPremium,
  543. '' AS taxLaterPremium,
  544. getSyAmount(a.`orderno`) AS insuranceSubAmount,
  545. b.`licenseno` AS licenseNo,
  546. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.vehicleUse'),'"',''),'3') AS vehicleUse,
  547. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.powertype'),'"',''),'2') AS powerType,
  548. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.cimodelclass'),'"',''),'4') AS ciModelClass,
  549. REPLACE(JSON_EXTRACT(b.carinfo, '$.limitLoad'),'"','') AS limitLoad,
  550. REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') AS appliName,
  551. REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') AS insureName,
  552. b.`deptname` AS deptName,
  553. b.`username` AS userName
  554. FROM ins_area_company a,ins_orders b WHERE a.`sypolicyno` IS NOT NULL AND a.`syapplyno`!='' AND a.`agreement_id` IS NOT NULL
  555. AND a.`orderno`=b.`orderno`
  556. <if test="policyReqVo.deptId != null and policyReqVo.deptId != ''">
  557. and b.deptid = #{policyReqVo.deptId}
  558. </if>
  559. <if test="policyReqVo.userId != null and policyReqVo.userId != ''">
  560. and b.userid = #{policyReqVo.userId}
  561. </if>
  562. <if test="policyReqVo.userName != null and policyReqVo.userName != ''">
  563. and b.username = #{policyReqVo.userName}
  564. </if>
  565. <if test="policyReqVo.appliName != null and policyReqVo.appliName != ''">
  566. and REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') = #{policyReqVo.appliName}
  567. </if>
  568. <if test="policyReqVo.insureName != null and policyReqVo.insureName != ''">
  569. and REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') = #{policyReqVo.insureName}
  570. </if>
  571. <if test="policyReqVo.productId != null and policyReqVo.productId != ''">
  572. and b.productid = #{policyReqVo.productId}
  573. </if>
  574. <if test="policyReqVo.insCompany != null and policyReqVo.insCompany != ''">
  575. and a.company_id = #{policyReqVo.insCompany}
  576. </if>
  577. <if test="policyReqVo.operatorId != null and policyReqVo.operatorId != ''">
  578. and a.operatorid = #{policyReqVo.operatorId}
  579. </if>
  580. <if test="policyReqVo.quoteStartDate != null and policyReqVo.quoteEndDate != null">
  581. <if test="policyReqVo.queryFlag=='queryPayDate'.toString()">
  582. and a.pay_date between #{policyReqVo.quoteStartDate} AND #{policyReqVo.quoteEndDate}
  583. </if>
  584. <if test="policyReqVo.queryFlag=='queryPayTime'.toString()">
  585. and a.inside_pay_time between #{policyReqVo.quoteStartDate} AND #{policyReqVo.quoteEndDate}
  586. </if>
  587. </if>
  588. <if test="policyReqVo.policyStartDate != null and policyReqVo.policyEndDate != null">
  589. and a.sy_start_date between #{policyReqVo.policyStartDate} AND #{policyReqVo.policyEndDate}
  590. </if>
  591. </select>
  592. <select id="getPolicyInsuranceReportCount" resultType="Long">
  593. select
  594. count(1)
  595. from (
  596. /*交强数据*/
  597. SELECT a.`inscompany` AS insCompany,
  598. (SELECT agreement_name FROM ptl_agreement t WHERE t.`id`= a.`agreement_id`) AS agreementName,
  599. a.`jqpolicyno` AS policyNo,
  600. <if test="policyReqVo.queryFlag=='queryPayDate'.toString()">
  601. a.pay_date AS quoteDate,
  602. </if>
  603. <if test="policyReqVo.queryFlag=='queryPayTime'.toString()">
  604. a.inside_pay_time AS quoteDate,
  605. </if>
  606. a.`jq_start_date` AS policyStartDate,
  607. '交强险' AS riskName,
  608. a.`jqpremium` AS sumPremium,
  609. a.`taxamount` AS taxPremium,
  610. getCarShipLateFee(a.`id`) AS taxLaterPremium,
  611. '交强险 : 200000.00,' AS insuranceSubAmount,
  612. b.`licenseno` AS licenseNo,
  613. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.vehicleUse'),'"',''),'3') AS vehicleUse,
  614. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.powertype'),'"',''),'2') AS powerType,
  615. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.cimodelclass'),'"',''),'4') AS ciModelClass,
  616. REPLACE(JSON_EXTRACT(b.carinfo, '$.limitLoad'),'"','') AS limitLoad,
  617. REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') AS appliName,
  618. REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') AS insureName,
  619. b.`deptname` AS deptName,
  620. b.`username` AS userName
  621. FROM ins_area_company a,ins_orders b WHERE a.`jqpolicyno` IS NOT NULL AND a.`jqpolicyno`!='' AND a.`agreement_id` IS NOT NULL
  622. AND a.`orderno`=b.`orderno`
  623. <if test="policyReqVo.deptId != null and policyReqVo.deptId != ''">
  624. and b.deptid = #{policyReqVo.deptId}
  625. </if>
  626. <if test="policyReqVo.userId != null and policyReqVo.userId != ''">
  627. and b.userid = #{policyReqVo.userId}
  628. </if>
  629. <if test="policyReqVo.userName != null and policyReqVo.userName != ''">
  630. and b.username = #{policyReqVo.userName}
  631. </if>
  632. <if test="policyReqVo.appliName != null and policyReqVo.appliName != ''">
  633. and REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') = #{policyReqVo.appliName}
  634. </if>
  635. <if test="policyReqVo.insureName != null and policyReqVo.insureName != ''">
  636. and REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') = #{policyReqVo.insureName}
  637. </if>
  638. <if test="policyReqVo.productId != null and policyReqVo.productId != ''">
  639. and b.productid = #{policyReqVo.productId}
  640. </if>
  641. <if test="policyReqVo.insCompany != null and policyReqVo.insCompany != ''">
  642. and a.company_id = #{policyReqVo.insCompany}
  643. </if>
  644. <if test="policyReqVo.operatorId != null and policyReqVo.operatorId != ''">
  645. and a.operatorid = #{policyReqVo.operatorId}
  646. </if>
  647. <if test="policyReqVo.quoteStartDate != null and policyReqVo.quoteEndDate != null">
  648. <if test="policyReqVo.queryFlag=='queryPayDate'.toString()">
  649. and a.pay_date between #{policyReqVo.quoteStartDate} AND #{policyReqVo.quoteEndDate}
  650. </if>
  651. <if test="policyReqVo.queryFlag=='queryPayTime'.toString()">
  652. and a.inside_pay_time between #{policyReqVo.quoteStartDate} AND #{policyReqVo.quoteEndDate}
  653. </if>
  654. </if>
  655. <if test="policyReqVo.policyStartDate != null and policyReqVo.policyEndDate != null">
  656. and a.jq_start_date between #{policyReqVo.policyStartDate} AND #{policyReqVo.policyEndDate}
  657. </if>
  658. UNION ALL
  659. /*##商业数据*/
  660. SELECT a.`inscompany` AS insCompany,
  661. (SELECT agreement_name FROM ptl_agreement t WHERE t.`id`= a.`agreement_id`) AS agreementName,
  662. a.`sypolicyno` AS policyNo,
  663. <if test="policyReqVo.queryFlag=='queryPayDate'.toString()">
  664. a.pay_date AS quoteDate,
  665. </if>
  666. <if test="policyReqVo.queryFlag=='queryPayTime'.toString()">
  667. a.inside_pay_time AS quoteDate,
  668. </if>
  669. a.`sy_start_date` AS policyStartDate,
  670. '商业险' AS riskName,
  671. a.`sypremium` AS sumPremium,
  672. '' AS taxPremium,
  673. '' AS taxLaterPremium,
  674. getSyAmount(a.`orderno`) AS insuranceSubAmount,
  675. b.`licenseno` AS licenseNo,
  676. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.vehicleUse'),'"',''),'3') AS vehicleUse,
  677. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.powertype'),'"',''),'2') AS powerType,
  678. getCodeName(REPLACE(JSON_EXTRACT(b.carinfo, '$.cimodelclass'),'"',''),'4') AS ciModelClass,
  679. REPLACE(JSON_EXTRACT(b.carinfo, '$.limitLoad'),'"','') AS limitLoad,
  680. REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') AS appliName,
  681. REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') AS insureName,
  682. b.`deptname` AS deptName,
  683. b.`username` AS userName
  684. FROM ins_area_company a,ins_orders b WHERE a.`sypolicyno` IS NOT NULL AND a.`syapplyno`!='' AND a.`agreement_id` IS NOT NULL
  685. AND a.`orderno`=b.`orderno`
  686. <if test="policyReqVo.deptId != null and policyReqVo.deptId != ''">
  687. and b.deptid = #{policyReqVo.deptId}
  688. </if>
  689. <if test="policyReqVo.userId != null and policyReqVo.userId != ''">
  690. and b.userid = #{policyReqVo.userId}
  691. </if>
  692. <if test="policyReqVo.userName != null and policyReqVo.userName != ''">
  693. and b.username = #{policyReqVo.userName}
  694. </if>
  695. <if test="policyReqVo.appliName != null and policyReqVo.appliName != ''">
  696. and REPLACE(JSON_EXTRACT(applyinfo, '$.name'),'"','') = #{policyReqVo.appliName}
  697. </if>
  698. <if test="policyReqVo.insureName != null and policyReqVo.insureName != ''">
  699. and REPLACE(JSON_EXTRACT(insureinfo, '$.name'),'"','') = #{policyReqVo.insureName}
  700. </if>
  701. <if test="policyReqVo.productId != null and policyReqVo.productId != ''">
  702. and b.productid = #{policyReqVo.productId}
  703. </if>
  704. <if test="policyReqVo.insCompany != null and policyReqVo.insCompany != ''">
  705. and a.company_id = #{policyReqVo.insCompany}
  706. </if>
  707. <if test="policyReqVo.operatorId != null and policyReqVo.operatorId != ''">
  708. and a.operatorid = #{policyReqVo.operatorId}
  709. </if>
  710. <if test="policyReqVo.quoteStartDate != null and policyReqVo.quoteEndDate != null">
  711. <if test="policyReqVo.queryFlag=='queryPayDate'.toString()">
  712. and a.pay_date between #{policyReqVo.quoteStartDate} AND #{policyReqVo.quoteEndDate}
  713. </if>
  714. <if test="policyReqVo.queryFlag=='queryPayTime'.toString()">
  715. and a.inside_pay_time between #{policyReqVo.quoteStartDate} AND #{policyReqVo.quoteEndDate}
  716. </if>
  717. </if>
  718. <if test="policyReqVo.policyStartDate != null and policyReqVo.policyEndDate != null">
  719. and a.sy_start_date between #{policyReqVo.policyStartDate} AND #{policyReqVo.policyEndDate}
  720. </if>
  721. ) as s
  722. </select>
  723. <update id="updateStatus">
  724. update ins_orders set orderstatus = #{status} where orderno = #{orderno}
  725. </update>
  726. <select id="queryPageHospitalityOrder" resultMap="BaseResultMap">
  727. select
  728. io.*,
  729. iac.orderno
  730. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
  731. ,eic.namesimple as partnerCompaniesName
  732. </if>
  733. from
  734. ins_orders io
  735. left JOIN
  736. ins_area_company iac on iac.orderno = io.orderno
  737. LEFT JOIN
  738. ptl_agreement pa on pa.id = iac.agreement_id
  739. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
  740. LEFT JOIN
  741. esm_ins_company eic on eic.id = pa.partner_companies_id
  742. </if>
  743. <where>
  744. <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
  745. and io.orderno = #{orderQueryVo.orderNo}
  746. </if>
  747. <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != '' ">
  748. and io.deptid like "${orderQueryVo.deptId}%"
  749. </if>
  750. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
  751. and io.orderstatus = #{orderQueryVo.orderStatus}
  752. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
  753. and iac.orderstatus = #{orderQueryVo.orderStatus}
  754. </if>
  755. </if>
  756. <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
  757. and io.frameno = #{orderQueryVo.frameNo}
  758. </if>
  759. <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
  760. and io.licenseno = #{orderQueryVo.licenseNo}
  761. </if>
  762. <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
  763. and io.insuredname = #{orderQueryVo.insuredName}
  764. </if>
  765. <if test="orderQueryVo.startDate != null and orderQueryVo.endDate != null">
  766. and io.createtime between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
  767. </if>
  768. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  769. and iac.company_id = #{orderQueryVo.companyId}
  770. </if>
  771. <if test="orderQueryVo.userId != null and orderQueryVo.userId != ''">
  772. and io.userid = #{orderQueryVo.userId}
  773. </if>
  774. </where>
  775. group by io.orderno
  776. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
  777. ,eic.namesimple
  778. </if>
  779. order by io.createtime desc
  780. </select>
  781. <select id="queryPageHospitalityOrderCount" resultType="Long">
  782. select
  783. count(1)
  784. from (
  785. select
  786. io.orderno
  787. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
  788. ,eic.namesimple as partnerCompaniesName
  789. </if>
  790. from
  791. ins_orders io
  792. left JOIN
  793. ins_area_company iac on iac.orderno = io.orderno
  794. LEFT JOIN
  795. ptl_agreement pa on pa.id = iac.agreement_id
  796. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
  797. LEFT JOIN
  798. esm_ins_company eic on eic.id = pa.partner_companies_id
  799. </if>
  800. <where>
  801. <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
  802. and io.orderno = #{orderQueryVo.orderNo}
  803. </if>
  804. <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != '' ">
  805. and io.deptid like "${orderQueryVo.deptId}%"
  806. </if>
  807. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
  808. and io.orderstatus = #{orderQueryVo.orderStatus}
  809. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
  810. and iac.orderstatus = #{orderQueryVo.orderStatus}
  811. </if>
  812. </if>
  813. <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
  814. and io.frameno = #{orderQueryVo.frameNo}
  815. </if>
  816. <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
  817. and io.licenseno = #{orderQueryVo.licenseNo}
  818. </if>
  819. <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
  820. and io.insuredname = #{orderQueryVo.insuredName}
  821. </if>
  822. <if test="orderQueryVo.startDate != null and orderQueryVo.endDate != null">
  823. and io.createtime between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
  824. </if>
  825. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  826. and iac.company_id = #{orderQueryVo.companyId}
  827. </if>
  828. <if test="orderQueryVo.userId != null and orderQueryVo.userId != ''">
  829. and io.userid = #{orderQueryVo.userId}
  830. </if>
  831. </where>
  832. group by io.orderno
  833. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus == 3">
  834. ,eic.namesimple
  835. </if>
  836. order by io.createtime desc
  837. ) as s
  838. </select>
  839. <select id="queryPageOrderByLinkType" resultMap="BaseResultMap">
  840. select
  841. io.orderno as orderno,
  842. io.quoteno as quoteno,
  843. iac.orderstatus as orderstatus,
  844. io.carinfo as carinfo,
  845. io.userid as userid,
  846. io.username as username,
  847. io.deptid as deptid,
  848. io.deptname as deptname,
  849. io.ownerinfo as ownerinfo,
  850. io.applyinfo as applyinfo,
  851. io.insureinfo as insureinfo,
  852. io.agreeid as agreeid,
  853. iac.productid as productid,
  854. iac.product as product,
  855. iac.createtime as createtime,
  856. io.frameno as frameno,
  857. io.licenseno as licenseno,
  858. io.insuredname as insuredname,
  859. iac.jq_start_date as jqstartdate,
  860. iac.jq_end_date as jqenddate,
  861. iac.sy_start_date as systartdate,
  862. iac.sy_end_date as syenddate,
  863. iac.jqpremium as jqpremium,
  864. iac.sypremium as sypremium,
  865. iac.jypremium as jypremium,
  866. iac.taxamount as taxamount,
  867. io.risk as risk,
  868. io.king as king,
  869. io.vehicle_and_vessel_tax as vehicleAndVesselTax,
  870. iac.id as subOrderId,
  871. iac.underwriting_status as underwritingStatus,
  872. iac.company_id as company_id,
  873. iac.inscompany as ins_company,
  874. agree.agreement_code as agreementCode,
  875. agree.agreement_name as agreementName,
  876. company.namesimple as partnerCompaniesName,
  877. iac.api_type,
  878. io.is_external,
  879. u.leader_name,
  880. u.leader_id,
  881. CASE dept.management_source
  882. WHEN '1' THEN '渠道'
  883. WHEN '2' THEN '个代'
  884. WHEN '3' THEN '电销'
  885. ELSE '' END
  886. AS managementSource
  887. from
  888. ins_area_company iac
  889. left JOIN
  890. ins_orders io on iac.orderno = io.orderno
  891. left join
  892. ptl_agreement agree on iac.agreement_id= agree.id
  893. left join
  894. esm_ins_company company on agree.partner_companies_id= company.id
  895. LEFT JOIN
  896. sys_dept dept ON dept.id = io.deptid
  897. LEFT JOIN
  898. sys_user u on io.userid = u.id
  899. <where>
  900. <if test="agentUserIds != null and agentUserIds.size>0" >
  901. AND (
  902. (io.userid in
  903. <foreach collection="agentUserIds" item="item" open="(" separator="," close=")">
  904. #{item}
  905. </foreach>
  906. AND ( iac.new_operator_id IS NULL OR iac.new_operator_id = #{orderQueryVo.userId} )
  907. <if test="deptIds != null and deptIds.size>0" >
  908. AND (
  909. <foreach collection="deptIds" item="item" open="(" separator="OR" close=")">
  910. io.deptid like CONCAT('', #{item}, '%')
  911. </foreach>
  912. )
  913. </if>
  914. )
  915. <if test="flag" >
  916. OR iac.operator_id = #{orderQueryVo.userId}
  917. </if>
  918. )
  919. </if>
  920. <if test="agreeIds != null and agreeIds.size>0">
  921. AND (
  922. (iac.agreement_id in
  923. <foreach collection="agreeIds" item="item" open="(" separator="," close=")">
  924. #{item}
  925. </foreach>
  926. AND ( iac.new_operator_id IS NULL OR iac.new_operator_id = #{orderQueryVo.userId} ) )
  927. <if test="flag" >
  928. OR iac.operator_id = #{orderQueryVo.userId}
  929. </if>
  930. )
  931. </if>
  932. <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
  933. and iac.id = #{orderQueryVo.orderNo}
  934. </if>
  935. <if test="orderQueryVo.managementSource != null and orderQueryVo.managementSource != ''">
  936. and dept.management_source = #{orderQueryVo.managementSource}
  937. </if>
  938. <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != ''">
  939. and io.deptid like "${orderQueryVo.deptId}%"
  940. </if>
  941. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
  942. and iac.orderstatus= #{orderQueryVo.orderStatus}
  943. </if>
  944. <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
  945. and io.frameno = #{orderQueryVo.frameNo}
  946. </if>
  947. <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
  948. and io.licenseno = #{orderQueryVo.licenseNo}
  949. </if>
  950. <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
  951. and io.insuredname = #{orderQueryVo.insuredName}
  952. </if>
  953. <if test="orderQueryVo.quoteStartDateStr != null and orderQueryVo.quoteEndDateStr != null">
  954. and DATE_FORMAT(iac.createtime, '%Y-%m-%d') between #{orderQueryVo.quoteStartDateStr} AND #{orderQueryVo.quoteEndDateStr}
  955. </if>
  956. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  957. and iac.company_id = #{orderQueryVo.companyId}
  958. </if>
  959. <if test="orderQueryVo.operatorId != null and orderQueryVo.operatorId != ''">
  960. and io.userid = #{orderQueryVo.operatorId}
  961. </if>
  962. <if test="orderQueryVo.operatorName != null and orderQueryVo.operatorName != ''">
  963. and io.username = #{orderQueryVo.operatorName}
  964. </if>
  965. <if test="orderQueryVo.engineNo != null and orderQueryVo.engineNo != ''">
  966. and JSON_EXTRACT( io.carinfo, '$.engineNo' ) = #{orderQueryVo.engineNo}
  967. </if>
  968. <if test="orderQueryVo.provinceId != null and orderQueryVo.provinceId != ''">
  969. and io.deptid like "${orderQueryVo.provinceId}%"
  970. </if>
  971. <if test="orderQueryVo.cityId != null and orderQueryVo.cityId != ''">
  972. and io.deptid like "${orderQueryVo.cityId}%"
  973. </if>
  974. <if test="orderQueryVo.countyId != null and orderQueryVo.countyId != ''">
  975. and io.deptid like "${orderQueryVo.countyId}%"
  976. </if>
  977. <if test="orderQueryVo.houseId != null and orderQueryVo.houseId != ''">
  978. and io.deptid like "${orderQueryVo.houseId}%"
  979. </if>
  980. <if test="orderQueryVo.agreeId != null and orderQueryVo.agreeId != ''">
  981. and iac.agreement_id = #{orderQueryVo.agreeId}
  982. </if>
  983. <if test="orderQueryVo.taskNo != null and orderQueryVo.taskNo != ''">
  984. and io.orderno = #{orderQueryVo.taskNo}
  985. </if>
  986. <if test="orderQueryVo.riskCode != null and orderQueryVo.riskCode != ''">
  987. and iac.product = #{orderQueryVo.riskCode}
  988. </if>
  989. <if test="orderQueryVo.auditId != null and orderQueryVo.auditId != ''">
  990. and IFNULL( iac.new_operator_id, '' ) = #{orderQueryVo.auditId}
  991. </if>
  992. <if test="orderQueryVo.leaderId != null and orderQueryVo.leaderId != ''">
  993. and u.leader_id = #{orderQueryVo.leaderId}
  994. </if>
  995. <if test="orderQueryVo.leaderName != null and orderQueryVo.leaderName != ''">
  996. and u.leader_name = #{orderQueryVo.leaderName}
  997. </if>
  998. <if test="orderQueryVo.attachStartDateStr != null and orderQueryVo.attachEndDateStr != ''">
  999. and ((
  1000. DATE_FORMAT(iac.jq_start_date, '%Y-%m-%d') BETWEEN #{orderQueryVo.attachStartDateStr}
  1001. AND #{orderQueryVo.attachEndDateStr}
  1002. )
  1003. OR ( DATE_FORMAT(iac.sy_start_date, '%Y-%m-%d') BETWEEN #{orderQueryVo.attachStartDateStr} AND #{orderQueryVo.attachEndDateStr} )
  1004. )
  1005. </if>
  1006. <choose>
  1007. <when test="type==1">
  1008. and dept.management_source=1
  1009. </when>
  1010. <when test="type==2">
  1011. and dept.management_source=2
  1012. </when>
  1013. </choose>
  1014. <if test="orderQueryVo.signStartDateStr != null and orderQueryVo.signEndDateStr != null">
  1015. and DATE_FORMAT(iac.signing_time, '%Y-%m-%d') between #{orderQueryVo.signStartDateStr} AND #{orderQueryVo.signEndDateStr}
  1016. </if>
  1017. </where>
  1018. order by io.createtime desc
  1019. </select>
  1020. <select id="queryPageOrderByLinkTypeCount" resultType="Long">
  1021. select
  1022. count(1)
  1023. from (
  1024. select
  1025. (0)
  1026. from
  1027. ins_area_company iac
  1028. left JOIN
  1029. ins_orders io on iac.orderno = io.orderno
  1030. LEFT JOIN
  1031. sys_dept dept ON dept.id = io.deptid
  1032. LEFT JOIN
  1033. sys_user u on io.userid = u.id
  1034. <where>
  1035. <if test="agentUserIds != null and agentUserIds.size>0" >
  1036. AND (
  1037. (io.userid in
  1038. <foreach collection="agentUserIds" item="item" open="(" separator="," close=")">
  1039. #{item}
  1040. </foreach>
  1041. AND ( iac.new_operator_id IS NULL OR iac.new_operator_id = #{orderQueryVo.userId} )
  1042. <if test="deptIds != null and deptIds.size>0" >
  1043. AND (
  1044. <foreach collection="deptIds" item="item" open="(" separator="OR" close=")">
  1045. io.deptid like CONCAT('', #{item}, '%')
  1046. </foreach>
  1047. )
  1048. </if>
  1049. )
  1050. <if test="flag" >
  1051. OR iac.operator_id = #{orderQueryVo.userId}
  1052. </if>
  1053. )
  1054. </if>
  1055. <if test="agreeIds != null and agreeIds.size>0">
  1056. AND (
  1057. (iac.agreement_id in
  1058. <foreach collection="agreeIds" item="item" open="(" separator="," close=")">
  1059. #{item}
  1060. </foreach>
  1061. AND ( iac.new_operator_id IS NULL OR iac.new_operator_id = #{orderQueryVo.userId} ) )
  1062. <if test="flag" >
  1063. OR iac.operator_id = #{orderQueryVo.userId}
  1064. </if>
  1065. )
  1066. </if>
  1067. <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
  1068. and iac.id = #{orderQueryVo.orderNo}
  1069. </if>
  1070. <if test="orderQueryVo.managementSource != null and orderQueryVo.managementSource != ''">
  1071. and dept.management_source = #{orderQueryVo.managementSource}
  1072. </if>
  1073. <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != ''">
  1074. and io.deptid like "${orderQueryVo.deptId}%"
  1075. </if>
  1076. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
  1077. and iac.orderstatus= #{orderQueryVo.orderStatus}
  1078. </if>
  1079. <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
  1080. and io.frameno = #{orderQueryVo.frameNo}
  1081. </if>
  1082. <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
  1083. and io.licenseno = #{orderQueryVo.licenseNo}
  1084. </if>
  1085. <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
  1086. and io.insuredname = #{orderQueryVo.insuredName}
  1087. </if>
  1088. <if test="orderQueryVo.quoteStartDateStr != null and orderQueryVo.quoteEndDateStr != null">
  1089. and DATE_FORMAT(iac.createtime, '%Y-%m-%d') between #{orderQueryVo.quoteStartDateStr} AND #{orderQueryVo.quoteEndDateStr}
  1090. </if>
  1091. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  1092. and iac.company_id = #{orderQueryVo.companyId}
  1093. </if>
  1094. <if test="orderQueryVo.operatorId != null and orderQueryVo.operatorId != ''">
  1095. and io.userid = #{orderQueryVo.operatorId}
  1096. </if>
  1097. <if test="orderQueryVo.operatorName != null and orderQueryVo.operatorName != ''">
  1098. and io.username = #{orderQueryVo.operatorName}
  1099. </if>
  1100. <if test="orderQueryVo.engineNo != null and orderQueryVo.engineNo != ''">
  1101. and JSON_EXTRACT( io.carinfo, '$.engineNo' ) = #{orderQueryVo.engineNo}
  1102. </if>
  1103. <if test="orderQueryVo.provinceId != null and orderQueryVo.provinceId != ''">
  1104. and io.deptid like "${orderQueryVo.provinceId}%"
  1105. </if>
  1106. <if test="orderQueryVo.cityId != null and orderQueryVo.cityId != ''">
  1107. and io.deptid like "${orderQueryVo.cityId}%"
  1108. </if>
  1109. <if test="orderQueryVo.countyId != null and orderQueryVo.countyId != ''">
  1110. and io.deptid like "${orderQueryVo.countyId}%"
  1111. </if>
  1112. <if test="orderQueryVo.houseId != null and orderQueryVo.houseId != ''">
  1113. and io.deptid like "${orderQueryVo.houseId}%"
  1114. </if>
  1115. <if test="orderQueryVo.agreeId != null and orderQueryVo.agreeId != ''">
  1116. and iac.agreement_id = #{orderQueryVo.agreeId}
  1117. </if>
  1118. <if test="orderQueryVo.taskNo != null and orderQueryVo.taskNo != ''">
  1119. and io.orderno = #{orderQueryVo.taskNo}
  1120. </if>
  1121. <if test="orderQueryVo.riskCode != null and orderQueryVo.riskCode != ''">
  1122. and iac.product = #{orderQueryVo.riskCode}
  1123. </if>
  1124. <if test="orderQueryVo.auditId != null and orderQueryVo.auditId != ''">
  1125. and IFNULL( iac.new_operator_id, '' ) = #{orderQueryVo.auditId}
  1126. </if>
  1127. <if test="orderQueryVo.leaderId != null and orderQueryVo.leaderId != ''">
  1128. and u.leader_id = #{orderQueryVo.leaderId}
  1129. </if>
  1130. <if test="orderQueryVo.leaderName != null and orderQueryVo.leaderName != ''">
  1131. and u.leader_name = #{orderQueryVo.leaderName}
  1132. </if>
  1133. <if test="orderQueryVo.attachStartDateStr != null and orderQueryVo.attachEndDateStr != ''">
  1134. and ((
  1135. DATE_FORMAT(iac.jq_start_date, '%Y-%m-%d') BETWEEN #{orderQueryVo.attachStartDateStr}
  1136. AND #{orderQueryVo.attachEndDateStr}
  1137. )
  1138. OR ( DATE_FORMAT(iac.sy_start_date, '%Y-%m-%d') BETWEEN #{orderQueryVo.attachStartDateStr} AND #{orderQueryVo.attachEndDateStr} )
  1139. )
  1140. </if>
  1141. <choose>
  1142. <when test="type==1">
  1143. and dept.management_source=1
  1144. </when>
  1145. <when test="type==2">
  1146. and dept.management_source=2
  1147. </when>
  1148. </choose>
  1149. <if test="orderQueryVo.signStartDateStr != null and orderQueryVo.signEndDateStr != null">
  1150. and DATE_FORMAT(iac.signing_time, '%Y-%m-%d') between #{orderQueryVo.signStartDateStr} AND #{orderQueryVo.signEndDateStr}
  1151. </if>
  1152. </where>
  1153. ) as s
  1154. </select>
  1155. <select id="queryPageSubOrders" resultMap="BaseResultMap">
  1156. select
  1157. io.*,
  1158. iac.id as subOrderId
  1159. from
  1160. ins_area_company iac
  1161. left JOIN
  1162. ins_orders io on iac.orderno = io.orderno
  1163. <where>
  1164. <if test="orderQueryVo.userId != null and orderQueryVo.userId != ''">
  1165. and io.userid = #{orderQueryVo.userid}
  1166. </if>
  1167. <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
  1168. and io.orderno = #{orderQueryVo.orderNo}
  1169. </if>
  1170. <if test="orderQueryVo.quoteNo != null and orderQueryVo.quoteNo != ''">
  1171. and io.quoteno = #{orderQueryVo.quoteNo}
  1172. </if>
  1173. <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != ''">
  1174. and io.deptid like "${orderQueryVo.deptId}%"
  1175. </if>
  1176. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
  1177. and iac.orderstatus = #{orderQueryVo.orderStatus}
  1178. </if>
  1179. <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
  1180. and io.frameno = #{orderQueryVo.frameNo}
  1181. </if>
  1182. <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
  1183. and io.licenseno = #{orderQueryVo.licenseNo}
  1184. </if>
  1185. <if test="orderQueryVo.engineNo != null and orderQueryVo.engineNo != ''">
  1186. and JSON_EXTRACT( io.carinfo, '$.engineNo' ) = #{orderQueryVo.engineNo}
  1187. </if>
  1188. <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
  1189. and io.insuredname = #{orderQueryVo.insuredName}
  1190. </if>
  1191. <if test="orderQueryVo.startDate != null and orderQueryVo.endDate != null">
  1192. and io.createtime between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
  1193. </if>
  1194. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  1195. and iac.company_id = #{orderQueryVo.companyId}
  1196. </if>
  1197. <if test="orderQueryVo.riskCode != null and orderQueryVo.riskCode != ''">
  1198. and iac.product = #{orderQueryVo.riskCode}
  1199. </if>
  1200. <if test="orderQueryVo.auditId != null and orderQueryVo.auditId != ''">
  1201. and IFNULL( io.agreeid, '' ) = #{orderQueryVo.auditId}
  1202. </if>
  1203. <if test="orderQueryVo.policyStartDate != null and orderQueryVo.policyEndDate != ''">
  1204. and ((
  1205. io.jqstartdate BETWEEN #{orderQueryVo.policyStartDate}
  1206. AND #{orderQueryVo.policyEndDate}
  1207. )
  1208. OR ( io.systartdate BETWEEN #{orderQueryVo.policyStartDate} AND #{orderQueryVo.policyEndDate} )
  1209. )
  1210. </if>
  1211. </where>
  1212. group by iac.id
  1213. order by io.createtime desc
  1214. </select>
  1215. <select id="queryPageSubOrdersCount" resultType="Long">
  1216. select
  1217. count(1)
  1218. from (
  1219. select
  1220. io.*
  1221. from
  1222. ins_area_company iac
  1223. left JOIN
  1224. ins_orders io on iac.orderno = io.orderno
  1225. <where>
  1226. <if test="orderQueryVo.userId != null and orderQueryVo.userId != ''">
  1227. and io.userid = #{orderQueryVo.userid}
  1228. </if>
  1229. <if test="orderQueryVo.orderNo != null and orderQueryVo.orderNo != ''">
  1230. and io.orderno = #{orderQueryVo.orderNo}
  1231. </if>
  1232. <if test="orderQueryVo.quoteNo != null and orderQueryVo.quoteNo != ''">
  1233. and io.quoteno = #{orderQueryVo.quoteNo}
  1234. </if>
  1235. <if test="orderQueryVo.deptId != null and orderQueryVo.deptId != ''">
  1236. and io.deptid like "${orderQueryVo.deptId}%"
  1237. </if>
  1238. <if test="orderQueryVo.orderStatus != null and orderQueryVo.orderStatus != ''">
  1239. and iac.orderstatus = #{orderQueryVo.orderStatus}
  1240. </if>
  1241. <if test="orderQueryVo.frameNo != null and orderQueryVo.frameNo != ''">
  1242. and io.frameno = #{orderQueryVo.frameNo}
  1243. </if>
  1244. <if test="orderQueryVo.licenseNo != null and orderQueryVo.licenseNo != ''">
  1245. and io.licenseno = #{orderQueryVo.licenseNo}
  1246. </if>
  1247. <if test="orderQueryVo.engineNo != null and orderQueryVo.engineNo != ''">
  1248. and JSON_EXTRACT( io.carinfo, '$.engineNo' ) = #{orderQueryVo.engineNo}
  1249. </if>
  1250. <if test="orderQueryVo.insuredName != null and orderQueryVo.insuredName != ''">
  1251. and io.insuredname = #{orderQueryVo.insuredName}
  1252. </if>
  1253. <if test="orderQueryVo.startDate != null and orderQueryVo.endDate != null">
  1254. and io.createtime between #{orderQueryVo.startDate} AND #{orderQueryVo.endDate}
  1255. </if>
  1256. <if test="orderQueryVo.companyId != null and orderQueryVo.companyId != ''">
  1257. and iac.company_id = #{orderQueryVo.companyId}
  1258. </if>
  1259. <if test="orderQueryVo.riskCode != null and orderQueryVo.riskCode != ''">
  1260. and iac.product = #{orderQueryVo.riskCode}
  1261. </if>
  1262. <if test="orderQueryVo.auditId != null and orderQueryVo.auditId != ''">
  1263. and IFNULL( io.agreeid, '' ) = #{orderQueryVo.auditId}
  1264. </if>
  1265. <if test="orderQueryVo.policyStartDate != null and orderQueryVo.policyEndDate != ''">
  1266. and ((
  1267. io.jqstartdate BETWEEN #{orderQueryVo.policyStartDate}
  1268. AND #{orderQueryVo.policyEndDate}
  1269. )
  1270. OR ( io.systartdate BETWEEN #{orderQueryVo.policyStartDate} AND #{orderQueryVo.policyEndDate} )
  1271. )
  1272. </if>
  1273. </where>
  1274. group by iac.id
  1275. ) as s
  1276. </select>
  1277. <select id="selectEntityByinsOrderNo" resultMap="OrderResultMap">
  1278. select o.orderno,
  1279. o.quoteno,
  1280. o.frameno,
  1281. o.licenseno,
  1282. iac.jq_start_date as jqstartdate,
  1283. iac.jq_end_date as jqenddate,
  1284. iac.sy_start_date as systartdate,
  1285. iac.sy_end_date as syenddate,
  1286. iac.id,
  1287. iac.company_id,
  1288. iac.reptxt,
  1289. iac.orderstatus,
  1290. iac.inscompany,
  1291. iac.jqapplyno,
  1292. iac.jqpolicyno,
  1293. iac.syapplyno,
  1294. iac.sypolicyno,
  1295. iac.riskinfo,
  1296. iac.kindinfo,
  1297. iac.jqpremium,
  1298. iac.sypremium,
  1299. iac.jypremium,
  1300. iac.taxamount,
  1301. iac.sumpremium,
  1302. iac.jqdiscountrate,
  1303. iac.sydiscountrate,
  1304. iac.feerate,
  1305. iac.disrate,
  1306. iac.auditid,
  1307. iac.auditname,
  1308. iac.audittime,
  1309. iac.auditopinion,
  1310. iac.jqappoint,
  1311. iac.syappoint,
  1312. iac.createtime,
  1313. iac.payment_link,
  1314. iac.accident_info,
  1315. iac.tax_arrears,
  1316. iac.cross_insurance,
  1317. iac.ubi_predicted_info_score
  1318. from ins_area_company iac
  1319. join ins_orders as o on o.orderno = iac.orderno
  1320. where
  1321. iac.id = #{insOrderNo}
  1322. <if test="timeFiltering != null and timeFiltering != ''">
  1323. and DATE_FORMAT(iac.signing_time, '%Y-%m') = #{timeFiltering}
  1324. </if>
  1325. </select>
  1326. <select id="getExpirationInsureCount" resultType="Integer">
  1327. SELECT
  1328. count( b.orderno ) AS count
  1329. FROM
  1330. ins_orders a
  1331. left join
  1332. ins_area_company b
  1333. on a.orderno = b.orderno
  1334. WHERE
  1335. <if test="isJq == 1">
  1336. jqenddate BETWEEN #{startDate} AND #{endDate}
  1337. </if>
  1338. <if test="isJq == 2">
  1339. syenddate BETWEEN #{startDate} AND #{endDate}
  1340. </if>
  1341. AND a.orderstatus = 3
  1342. AND b.orderstatus = 3
  1343. <if test="param != null and param != ''">
  1344. AND (a.licenseno = #{param} or a.ins_company = #{param})
  1345. </if>
  1346. <if test="userId != null and userId != ''">
  1347. AND a.userid = #{userId}
  1348. </if>
  1349. </select>
  1350. <select id="getExpirationInsure" resultType="com.ydtech.modules.order.entity.vo.OrderExpirationVo">
  1351. SELECT
  1352. a.ins_company,
  1353. b.id as orderno,
  1354. b.jq_end_date,
  1355. b.sy_end_date,
  1356. b.productid,
  1357. b.product,
  1358. a.licenseno,
  1359. case when b.jq_end_date is not null then DATEDIFF( b.jq_end_date,NOW() ) else null end AS jqDiff,
  1360. case when b.sy_end_date is not null then DATEDIFF( b.sy_end_date,NOW() ) else null end AS syDiff
  1361. FROM ins_orders a,ins_area_company b
  1362. WHERE a.orderno = b.orderno
  1363. AND (b.jq_end_date BETWEEN #{order.jqStartDate} AND #{order.jqEndDate} or b.sy_end_date BETWEEN #{order.syStartDate} AND #{order.syEndDate})
  1364. AND b.orderstatus = 3
  1365. <if test="order.param != null and order.param != ''">
  1366. AND (a.licenseno = #{order.param} or a.ins_company = #{order.param})
  1367. </if>
  1368. <if test="order.userid != null and order.userid != ''">
  1369. AND a.userid = #{order.userid}
  1370. </if>
  1371. ORDER BY least(IFNULL(jqDiff, 9999999) , IFNULL(syDiff, 9999999)) asc
  1372. </select>
  1373. <select id="getCarBusinessDetailList" resultType="com.ydtech.modules.order.entity.vo.CarBusinessDetailVo">
  1374. SELECT
  1375. io.username,
  1376. iac.signing_time as sign_date,
  1377. io.licenseno,
  1378. JSON_UNQUOTE(json_extract(io.applyinfo, '$.name')) as applyname,
  1379. io.product,
  1380. io.ins_company as inscompany,
  1381. iac.jqpremium,
  1382. iac.sypremium,
  1383. iac.jypremium,
  1384. iac.taxamount,
  1385. ifo.jq_costs_export_proportion+ifo.jq_export_other_costs_proportion as jq_export_proportion,
  1386. ifo.sy_costs_export_proportion+ifo.sy_export_other_costs_proportion as sy_export_proportion,
  1387. ifo.no_costs_export_proportion+ifo.no_export_other_costs_proportion as no_export_proportion,
  1388. ifo.jq_export_supervise_costs_premiums + ifo.sy_export_supervise_costs_premiums + ifo.no_export_supervise_costs_premiums + ifo.jq_export_other_costs_premiums + ifo.sy_export_other_costs_premiums + ifo.no_export_other_costs_premiums as settlement,
  1389. CASE ifa.auditstatus
  1390. WHEN 1 THEN
  1391. '已审核'
  1392. ELSE
  1393. '未审核'
  1394. END as audittype,
  1395. ifa.audittime as audit_date
  1396. FROM
  1397. ins_orders io
  1398. LEFT JOIN ins_area_company iac ON io.orderno = iac.orderno
  1399. LEFT JOIN ins_fee_order_new ifo ON iac.id = ifo.ins_order_no
  1400. left join ins_fee_audit ifa on ifo.ins_order_no = ifa.ins_order_no
  1401. WHERE
  1402. io.userid = #{userId}
  1403. AND io.orderstatus = 3
  1404. AND iac.orderstatus = 3
  1405. AND iac.signing_time BETWEEN #{param.signStartDate} and #{param.signEndDate}
  1406. </select>
  1407. <select id="getRevenueExpenditureDetailList" resultType="com.ydtech.modules.order.entity.vo.RevenueExpenditureDetailVo">
  1408. SELECT
  1409. sua.create_time,
  1410. io.licenseno,
  1411. sua.amount,
  1412. sua.business_eegments_type,
  1413. sua.documentary,
  1414. sua.property
  1415. FROM
  1416. sys_user_account_history sua
  1417. left join ins_area_company iac on sua.suborder = iac.id
  1418. left join ins_orders io on iac.orderno = io.orderno
  1419. WHERE
  1420. (sua.property != 1 and sua.property != 2)
  1421. AND
  1422. user_id = #{userId}
  1423. AND
  1424. sua.create_time BETWEEN #{param.signStartDate} and #{param.signEndDate}
  1425. </select>
  1426. <select id="getAuditExportList" resultType="com.ydtech.modules.order.entity.vo.AuditExportVo">
  1427. SELECT
  1428. iac.company_id,
  1429. iac.api_type,
  1430. iac.cross_insurance,
  1431. io.username,
  1432. iac.signing_time,
  1433. io.licenseno,
  1434. JSON_UNQUOTE(json_extract(io.applyinfo, '$.name')) as applyname,
  1435. io.ins_company,
  1436. io.product,
  1437. eic.namesimple,
  1438. iac.jqapplyno,
  1439. iac.syapplyno,
  1440. iac.cross_insurance,
  1441. iac.jqpremium,
  1442. iac.sypremium,
  1443. iac.jypremium,
  1444. iac.taxamount,
  1445. ifo.jq_costs_export_proportion + ifo.jq_export_other_costs_proportion AS jq_export_proportion,
  1446. ifo.sy_costs_export_proportion+ifo.sy_export_other_costs_proportion as sy_export_proportion,
  1447. ifo.no_costs_export_proportion+ifo.no_export_other_costs_proportion as no_export_proportion,
  1448. ifo.jq_export_supervise_costs_premiums + ifo.sy_export_supervise_costs_premiums + ifo.no_export_supervise_costs_premiums + ifo.jq_export_other_costs_premiums + ifo.sy_export_other_costs_premiums + ifo.no_export_other_costs_premiums as settlement,
  1449. ifo.jq_supervise_costs_proportion + ifo.jq_other_costs_proportion as jq_entrance_proportion,
  1450. ifo.sy_supervise_costs_proportion + ifo.sy_other_costs_proportion as sy_entrance_proportion,
  1451. ifo.no_supervise_costs_proportion + ifo.no_other_costs_proportion as no_entrance_proportion,
  1452. ifo.jq_supervise_costs_premiums + ifo.jq_other_costs_premiums + ifo.sy_supervise_costs_premiums + ifo.sy_other_costs_premiums + ifo.no_supervise_costs_premiums + ifo.no_other_costs_premiums as receivable,
  1453. ifo.jq_dept_premiums_level_1 + ifo.sy_dept_premiums_level_1 + ifo.no_dept_premiums_level_1 as dept_premiums_level_1,
  1454. ifo.jq_dept_premiums_level_2 + ifo.sy_dept_premiums_level_2 + ifo.no_dept_premiums_level_2 as dept_premiums_level_2,
  1455. ifo.jq_dept_premiums_level_3 + ifo.sy_dept_premiums_level_3 + ifo.no_dept_premiums_level_3 as dept_premiums_level_3,
  1456. ifo.jq_dept_premiums_level_4 + ifo.sy_dept_premiums_level_4 + ifo.no_dept_premiums_level_4 as dept_premiums_level_4,
  1457. ifo.jq_dept_premiums_level_5 + ifo.sy_dept_premiums_level_5 + ifo.no_dept_premiums_level_5 as dept_premiums_level_5,
  1458. ifo.first_detail_premiums,
  1459. ifo.second_detail_premiums,
  1460. ifo.third_detail_premiums,
  1461. ifo.jq_profit_margin_premiums,
  1462. ifo.sy_profit_margin_premiums,
  1463. ifo.no_profit_margin_premiums,
  1464. io.is_external
  1465. FROM
  1466. ins_fee_order_new ifo
  1467. LEFT JOIN ins_fee_audit ifa ON ifo.ins_order_no = ifa.ins_order_no
  1468. left join ins_area_company iac on ifa.ins_order_no = iac.id
  1469. left join ins_orders io on iac.orderno = io.orderno
  1470. left join ptl_agreement pa on iac.agreement_id = pa.id
  1471. left join esm_ins_company eic on pa.partner_companies_id = eic.id
  1472. WHERE
  1473. iac.signing_time between #{param.signStartDate} and #{param.signEndDate}
  1474. <if test="param.audit != null and param.audit != ''">
  1475. AND
  1476. ifa.auditstatus = #{param.audit}
  1477. AND
  1478. io.orderstatus = 3
  1479. AND
  1480. iac.orderstatus = 3
  1481. GROUP BY
  1482. io.orderno,
  1483. iac.api_type,
  1484. iac.cross_insurance,
  1485. iac.signing_time,
  1486. eic.namesimple,
  1487. iac.jqapplyno,
  1488. iac.syapplyno,
  1489. iac.jqpremium,
  1490. iac.company_id,
  1491. iac.sypremium,
  1492. iac.jypremium,
  1493. iac.taxamount,
  1494. ifo.jq_costs_export_proportion,
  1495. ifo.jq_export_other_costs_proportion,
  1496. ifo.sy_costs_export_proportion,
  1497. ifo.sy_export_other_costs_proportion,
  1498. ifo.no_costs_export_proportion,
  1499. ifo.no_export_other_costs_proportion,
  1500. ifo.jq_export_supervise_costs_premiums,
  1501. ifo.sy_export_supervise_costs_premiums,
  1502. ifo.no_export_supervise_costs_premiums,
  1503. ifo.jq_export_other_costs_premiums,
  1504. ifo.sy_export_other_costs_premiums,
  1505. ifo.no_export_other_costs_premiums,
  1506. ifo.jq_supervise_costs_proportion,
  1507. ifo.jq_other_costs_proportion,
  1508. ifo.sy_supervise_costs_proportion,
  1509. ifo.sy_other_costs_proportion,
  1510. ifo.no_supervise_costs_proportion,
  1511. ifo.no_other_costs_proportion,
  1512. ifo.jq_supervise_costs_premiums,
  1513. ifo.jq_other_costs_premiums,
  1514. ifo.sy_supervise_costs_premiums,
  1515. ifo.sy_other_costs_premiums,
  1516. ifo.no_supervise_costs_premiums,
  1517. ifo.no_other_costs_premiums,
  1518. ifo.jq_dept_premiums_level_1,
  1519. ifo.jq_dept_premiums_level_2,
  1520. ifo.jq_dept_premiums_level_3,
  1521. ifo.jq_dept_premiums_level_4,
  1522. ifo.jq_dept_premiums_level_5,
  1523. ifo.sy_dept_premiums_level_1,
  1524. ifo.sy_dept_premiums_level_2,
  1525. ifo.sy_dept_premiums_level_3,
  1526. ifo.sy_dept_premiums_level_4,
  1527. ifo.sy_dept_premiums_level_5,
  1528. ifo.no_dept_premiums_level_1,
  1529. ifo.no_dept_premiums_level_2,
  1530. ifo.no_dept_premiums_level_3,
  1531. ifo.no_dept_premiums_level_4,
  1532. ifo.no_dept_premiums_level_5,
  1533. ifo.first_detail_premiums,
  1534. ifo.second_detail_premiums,
  1535. ifo.third_detail_premiums,
  1536. ifo.jq_profit_margin_premiums,
  1537. ifo.sy_profit_margin_premiums,
  1538. ifo.no_profit_margin_premiums
  1539. </if>
  1540. </select>
  1541. <resultMap id="hxOrderCountMap" type="com.ydtech.modules.order.entity.vo.QueryHxOrdersCountVo">
  1542. <result property="operatorId" column="operatorid" jdbcType="VARCHAR"/>
  1543. <result property="name" column="name" jdbcType="VARCHAR"/>
  1544. <result property="orderStatus0" column="orderstatus0" jdbcType="VARCHAR"/>
  1545. <result property="orderStatus1" column="orderstatus1" jdbcType="VARCHAR"/>
  1546. <result property="orderStatus2" column="orderstatus2" jdbcType="VARCHAR"/>
  1547. <result property="orderStatus3" column="orderstatus3" jdbcType="VARCHAR"/>
  1548. <result property="orderStatus4" column="orderstatus4" jdbcType="VARCHAR"/>
  1549. <result property="createTime" column="createtime" jdbcType="TIMESTAMP"/>
  1550. <result property="createTimeStart" column="createTimeStart" jdbcType="VARCHAR"/>
  1551. <result property="createTimeEnd" column="createTimeEnd" jdbcType="VARCHAR"/>
  1552. <result property="count" column="count1" jdbcType="VARCHAR"/>
  1553. </resultMap>
  1554. <resultMap id="TelemarketingAuditOrderMap" type="com.ydtech.modules.order.entity.dto.TelemarketingAuditOrderDTO">
  1555. <result property="id" column="id" jdbcType="VARCHAR"/>
  1556. <result property="orderNo" column="orderno" jdbcType="VARCHAR"/>
  1557. <result property="userid" column="userid" jdbcType="VARCHAR"/>
  1558. <result property="username" column="username" jdbcType="VARCHAR"/>
  1559. <result property="product" column="product" jdbcType="VARCHAR"/>
  1560. <result property="licenseNo" column="licenseno" jdbcType="VARCHAR"/>
  1561. <result property="orderStatus" column="orderstatus" jdbcType="VARCHAR"/>
  1562. <result property="insuredName" column="insuredname" jdbcType="VARCHAR"/>
  1563. <result property="createTime" column="createtime" jdbcType="VARCHAR"/>
  1564. <result property="auditStatus" column="auditstatus" jdbcType="VARCHAR"/>
  1565. <result property="insCompany" column="insCompany" jdbcType="VARCHAR"/>
  1566. </resultMap>
  1567. <select id="queryHxOrdersCount" resultMap="hxOrderCountMap">
  1568. select
  1569. operatorid,
  1570. su.name,
  1571. count(*) as count1,
  1572. SUM(CASE WHEN orderstatus = '1' THEN 1 ELSE 0 END) AS orderstatus1,
  1573. SUM(CASE WHEN orderstatus = '2' THEN 1 ELSE 0 END) AS orderstatus2,
  1574. SUM(CASE WHEN orderstatus = '3' THEN 1 ELSE 0 END) AS orderstatus3,
  1575. SUM(CASE WHEN orderstatus = '4' THEN 1 ELSE 0 END) AS orderstatus4,
  1576. SUM(CASE WHEN orderstatus = '0' THEN 1 ELSE 0 END) AS orderstatus0
  1577. from
  1578. ins_orders
  1579. LEFT JOIN
  1580. sys_user su ON operatorid = su.id
  1581. WHERE operatorid IS NOT NULL
  1582. AND operatorid NOT LIKE '%M%'
  1583. <if test="queryHxOrdersCountVo.ids != null and !queryHxOrdersCountVo.ids.isEmpty()">
  1584. and operatorid IN
  1585. <foreach item="item" index="index" collection="queryHxOrdersCountVo.ids" open="(" separator="," close=")">
  1586. #{item}
  1587. </foreach>
  1588. </if>
  1589. <if test="queryHxOrdersCountVo.operatorId !=null and queryHxOrdersCountVo.operatorId !=''">
  1590. and operatorid =#{queryHxOrdersCountVo.operatorId}
  1591. </if>
  1592. <if test="queryHxOrdersCountVo.name !=null and queryHxOrdersCountVo.name !=''">
  1593. and su.name =#{queryHxOrdersCountVo.name}
  1594. </if>
  1595. <if test="queryHxOrdersCountVo.createTimeStart != null and queryHxOrdersCountVo.createTimeStart != ''">
  1596. and createtime &gt;= #{queryHxOrdersCountVo.createTimeStart}
  1597. </if>
  1598. <if test="queryHxOrdersCountVo.createTimeEnd != null and queryHxOrdersCountVo.createTimeEnd != ''">
  1599. and createtime &lt;= #{queryHxOrdersCountVo.createTimeEnd}
  1600. </if>
  1601. group by
  1602. operatorid,su.name
  1603. order by
  1604. count1 desc
  1605. </select>
  1606. <select id="getTelemarketingAudit" resultMap="TelemarketingAuditOrderMap">
  1607. SELECT
  1608. iac.id as id,
  1609. iac.orderno as orderno,
  1610. io.userid as userid,
  1611. io.username as username,
  1612. iac.product as product,
  1613. io.licenseno as licenseno,
  1614. io.ins_company as insCompany,
  1615. io.orderstatus as orderstatus,
  1616. io.insuredname as insuredname,
  1617. iac.createtime as createtime,
  1618. ifa.auditstatus as auditstatus
  1619. FROM
  1620. ins_area_company iac
  1621. LEFT JOIN ins_orders io ON iac.orderno = io.orderno
  1622. LEFT JOIN ins_fee_audit ifa ON ifa.ins_order_no = iac.id
  1623. WHERE
  1624. iac.orderstatus = '3'
  1625. AND ifa.auditstatus IN ('4', '5')
  1626. AND io.userid = #{userId}
  1627. <if test="telemarketingAuditOrderQueryVo.orderNo != null and telemarketingAuditOrderQueryVo.orderNo != '' ">
  1628. AND iac.orderno = #{telemarketingAuditOrderQueryVo.orderNo}
  1629. </if>
  1630. <if test="telemarketingAuditOrderQueryVo.auditStatus != null and telemarketingAuditOrderQueryVo.auditStatus != '' ">
  1631. AND ifa.auditstatus = #{telemarketingAuditOrderQueryVo.auditStatus}
  1632. </if>
  1633. <if test="telemarketingAuditOrderQueryVo.companyId != null and telemarketingAuditOrderQueryVo.companyId != '' ">
  1634. AND iac.company_id = #{telemarketingAuditOrderQueryVo.companyId}
  1635. </if>
  1636. <if test="telemarketingAuditOrderQueryVo.licenseNo != null and telemarketingAuditOrderQueryVo.licenseNo != '' ">
  1637. AND io.licenseno = #{telemarketingAuditOrderQueryVo.licenseNo}
  1638. </if>
  1639. <if test="telemarketingAuditOrderQueryVo.frameNo != null and telemarketingAuditOrderQueryVo.frameNo != '' ">
  1640. AND io.frameno = #{telemarketingAuditOrderQueryVo.frameNo}
  1641. </if>
  1642. <if test="telemarketingAuditOrderQueryVo.productId != null and telemarketingAuditOrderQueryVo.productId != '' ">
  1643. AND io.product = #{telemarketingAuditOrderQueryVo.productId}
  1644. </if>
  1645. <if test="telemarketingAuditOrderQueryVo.startDate != null and telemarketingAuditOrderQueryVo.startDate != '' and telemarketingAuditOrderQueryVo.endDate != null and telemarketingAuditOrderQueryVo.endDate != ''">
  1646. AND iac.createtime BETWEEN #{telemarketingAuditOrderQueryVo.startDate} AND
  1647. #{telemarketingAuditOrderQueryVo.endDate}
  1648. </if>
  1649. </select>
  1650. </mapper>