2initddl.sql 289 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861
  1. create table ent_data
  2. (
  3. 商业公司名称 varchar(255) null,
  4. 商业公司地址 varchar(255) null,
  5. 商业公司规模 varchar(255) null,
  6. 三合一社会信用代码 varchar(255) null,
  7. GSP证书编号 varchar(255) null,
  8. 公司注册地 varchar(255) null,
  9. 注册资本 varchar(255) null,
  10. 法人代表 varchar(255) null,
  11. 服务药企 varchar(255) null,
  12. 公司简介 varchar(255) null,
  13. 经营优势 varchar(255) null,
  14. 备注 varchar(255) null,
  15. f13 varchar(255) null,
  16. f14 varchar(255) null
  17. )
  18. row_format = DYNAMIC;
  19. create table ent_his
  20. (
  21. 医院名称 varchar(255) null,
  22. 医院地址 varchar(255) null,
  23. 医院规模 varchar(255) null,
  24. 医院性质 varchar(255) null,
  25. 联系总机 varchar(255) null,
  26. 公共邮箱 varchar(255) null,
  27. 医院简介 varchar(255) null,
  28. 备注 varchar(255) null
  29. )
  30. row_format = DYNAMIC;
  31. create table hnqz_sequence
  32. (
  33. id bigint auto_increment
  34. primary key,
  35. value bigint not null,
  36. name varchar(32) not null,
  37. gmt_create datetime not null,
  38. gmt_modified datetime not null,
  39. constraint uk_name
  40. unique (name)
  41. );
  42. create table huiqiyun_input_record
  43. (
  44. id int auto_increment comment '主键id'
  45. primary key,
  46. req_msg_id varchar(64) null comment '报文流水号',
  47. req_body text null comment '请求body',
  48. decrypt_body text null comment '解密后的body',
  49. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  50. )
  51. comment '汇企云回调异步通知记录';
  52. create table lingcaiai_input_record
  53. (
  54. id int auto_increment comment '主键id'
  55. primary key,
  56. verify varchar(128) not null comment '签名',
  57. channel varchar(32) not null comment '通知类型',
  58. req_body text not null comment '请求body内容',
  59. batch_no varchar(32) null comment '项目单号',
  60. account_no varchar(32) null comment '账号单号',
  61. order_status int null comment '订单状态',
  62. create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
  63. )
  64. comment '浪潮(灵才接好活)结算回调请求记录';
  65. create table medical_equipment
  66. (
  67. id int auto_increment comment '医疗器械'
  68. primary key,
  69. name varchar(64) null comment '器械名称',
  70. manufacturer varchar(64) null comment '生产厂家',
  71. drug_ent_id int null comment '所属企业id',
  72. drug_ent_name varchar(64) null comment '所属企业名称',
  73. specification varchar(64) null comment '规格',
  74. measure_unit varchar(64) null comment '计量单位组名称',
  75. level varchar(20) null comment '等级',
  76. remark varchar(64) null comment '备注',
  77. del_flag char default '0' null comment '删除标记,1:已删除,0:正常',
  78. create_time datetime null comment '创建时间',
  79. create_user int null comment '创建人',
  80. update_time datetime null comment '更新时间',
  81. update_user int null comment '更新人'
  82. )
  83. comment '医疗器械';
  84. create table monitoring_indicator
  85. (
  86. id int(20) auto_increment
  87. primary key,
  88. alarm_amount decimal(18) default 0 not null comment '报警金额',
  89. limit_amount decimal(18) default 0 not null comment '限制金额',
  90. yaoyi_limit_amount decimal(18) not null comment '平台限额',
  91. subject_location varchar(64) null comment '税源地'
  92. )
  93. comment '风险监控' row_format = DYNAMIC;
  94. create table olading_input_record
  95. (
  96. id int auto_increment comment '主键id'
  97. primary key,
  98. request_id varchar(32) null comment '请求流水号',
  99. interface_name varchar(32) not null comment '请求接口名称',
  100. req_body text not null comment '请求body内容',
  101. public_key varchar(2048) null comment '请求公钥',
  102. private_key varchar(2048) null comment '请求时私钥',
  103. create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
  104. )
  105. comment '自由职家请求记录';
  106. create table party_a_encrypted_input_record
  107. (
  108. id int(20) auto_increment
  109. primary key,
  110. dept_id int(20) not null comment '主体id',
  111. ser_public_key varchar(2048) not null comment '请求时服务器公钥',
  112. ser_private_key varchar(2048) not null comment '请求时服务器私钥',
  113. cli_public_key varchar(2048) not null comment '请求时客户端公钥',
  114. cli_private_key varchar(2048) not null comment '请求时客户端私钥',
  115. signature varchar(32) not null comment '请求时签名字符串',
  116. original_text longtext not null comment '加密后的信息',
  117. password varchar(2048) not null comment '密码',
  118. create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
  119. )
  120. comment '甲方请求加密信息记录' row_format = DYNAMIC;
  121. create table party_b_encrypted_output_record
  122. (
  123. id int(20) auto_increment
  124. primary key,
  125. dept_id int(20) not null comment '主体id',
  126. ser_public_key varchar(2048) not null comment '请求时服务器公钥',
  127. ser_private_key varchar(2048) not null comment '请求时服务器私钥',
  128. cli_public_key varchar(2048) not null comment '请求时客户端公钥',
  129. cli_private_key varchar(2048) not null comment '请求时客户端私钥',
  130. signature varchar(32) not null comment '请求时签名字符串',
  131. original_text longtext not null comment '加密后的信息',
  132. password varchar(2048) not null comment '密码',
  133. input_id int(20) not null comment '请求id',
  134. create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间'
  135. )
  136. comment '乙方响应加密信息记录' row_format = DYNAMIC;
  137. create table qifu_input_record
  138. (
  139. id int auto_increment comment '主键id'
  140. primary key,
  141. req_type varchar(20) not null comment '请求业务类型',
  142. req_id varchar(64) null comment '请求序号',
  143. req_body text null comment '请求body',
  144. decrypt_body text null comment '解密后的body',
  145. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  146. )
  147. comment '福建企赋回调异步通知记录';
  148. create table qrtz_calendars
  149. (
  150. sched_name varchar(120) charset utf8 not null,
  151. calendar_name varchar(200) charset utf8 not null,
  152. calendar blob not null,
  153. primary key (sched_name, calendar_name)
  154. )
  155. row_format = DYNAMIC;
  156. create table qrtz_fired_triggers
  157. (
  158. sched_name varchar(120) charset utf8 not null,
  159. entry_id varchar(95) charset utf8 not null,
  160. trigger_name varchar(200) charset utf8 not null,
  161. trigger_group varchar(200) charset utf8 not null,
  162. instance_name varchar(200) charset utf8 not null,
  163. fired_time bigint(13) not null,
  164. sched_time bigint(13) not null,
  165. priority int not null,
  166. state varchar(16) charset utf8 not null,
  167. job_name varchar(200) charset utf8 null,
  168. job_group varchar(200) charset utf8 null,
  169. is_nonconcurrent varchar(1) charset utf8 null,
  170. requests_recovery varchar(1) charset utf8 null,
  171. primary key (sched_name, entry_id)
  172. )
  173. row_format = DYNAMIC;
  174. create table qrtz_job_details
  175. (
  176. sched_name varchar(120) charset utf8 not null,
  177. job_name varchar(200) charset utf8 not null,
  178. job_group varchar(200) charset utf8 not null,
  179. description varchar(250) charset utf8 null,
  180. job_class_name varchar(250) charset utf8 not null,
  181. is_durable varchar(1) charset utf8 not null,
  182. is_nonconcurrent varchar(1) charset utf8 not null,
  183. is_update_data varchar(1) charset utf8 not null,
  184. requests_recovery varchar(1) charset utf8 not null,
  185. job_data blob null,
  186. primary key (sched_name, job_name, job_group)
  187. )
  188. row_format = DYNAMIC;
  189. create table qrtz_locks
  190. (
  191. sched_name varchar(120) charset utf8 not null,
  192. lock_name varchar(40) charset utf8 not null,
  193. primary key (sched_name, lock_name)
  194. )
  195. row_format = DYNAMIC;
  196. create table qrtz_paused_trigger_grps
  197. (
  198. sched_name varchar(120) charset utf8 not null,
  199. trigger_group varchar(200) charset utf8 not null,
  200. primary key (sched_name, trigger_group)
  201. )
  202. row_format = DYNAMIC;
  203. create table qrtz_scheduler_state
  204. (
  205. sched_name varchar(120) charset utf8 not null,
  206. instance_name varchar(200) charset utf8 not null,
  207. last_checkin_time bigint(13) not null,
  208. checkin_interval bigint(13) not null,
  209. primary key (sched_name, instance_name)
  210. )
  211. row_format = DYNAMIC;
  212. create table qrtz_triggers
  213. (
  214. sched_name varchar(120) charset utf8 not null,
  215. trigger_name varchar(200) charset utf8 not null,
  216. trigger_group varchar(200) charset utf8 not null,
  217. job_name varchar(200) charset utf8 not null,
  218. job_group varchar(200) charset utf8 not null,
  219. description varchar(250) charset utf8 null,
  220. next_fire_time bigint(13) null,
  221. prev_fire_time bigint(13) null,
  222. priority int null,
  223. trigger_state varchar(16) charset utf8 not null,
  224. trigger_type varchar(8) charset utf8 not null,
  225. start_time bigint(13) not null,
  226. end_time bigint(13) null,
  227. calendar_name varchar(200) charset utf8 null,
  228. misfire_instr smallint(2) null,
  229. job_data blob null,
  230. primary key (sched_name, trigger_name, trigger_group),
  231. constraint qrtz_triggers_ibfk_1
  232. foreign key (sched_name, job_name, job_group) references qrtz_job_details (sched_name, job_name, job_group)
  233. )
  234. row_format = DYNAMIC;
  235. create table qrtz_blob_triggers
  236. (
  237. sched_name varchar(120) charset utf8 not null,
  238. trigger_name varchar(200) charset utf8 not null,
  239. trigger_group varchar(200) charset utf8 not null,
  240. blob_data blob null,
  241. primary key (sched_name, trigger_name, trigger_group),
  242. constraint qrtz_blob_triggers_ibfk_1
  243. foreign key (sched_name, trigger_name, trigger_group) references qrtz_triggers (sched_name, trigger_name, trigger_group)
  244. )
  245. row_format = DYNAMIC;
  246. create table qrtz_cron_triggers
  247. (
  248. sched_name varchar(120) charset utf8 not null,
  249. trigger_name varchar(200) charset utf8 not null,
  250. trigger_group varchar(200) charset utf8 not null,
  251. cron_expression varchar(200) charset utf8 not null,
  252. time_zone_id varchar(80) charset utf8 null,
  253. primary key (sched_name, trigger_name, trigger_group),
  254. constraint qrtz_cron_triggers_ibfk_1
  255. foreign key (sched_name, trigger_name, trigger_group) references qrtz_triggers (sched_name, trigger_name, trigger_group)
  256. )
  257. row_format = DYNAMIC;
  258. create table qrtz_simple_triggers
  259. (
  260. sched_name varchar(120) charset utf8 not null,
  261. trigger_name varchar(200) charset utf8 not null,
  262. trigger_group varchar(200) charset utf8 not null,
  263. repeat_count bigint(7) not null,
  264. repeat_interval bigint(12) not null,
  265. times_triggered bigint(10) not null,
  266. primary key (sched_name, trigger_name, trigger_group),
  267. constraint qrtz_simple_triggers_ibfk_1
  268. foreign key (sched_name, trigger_name, trigger_group) references qrtz_triggers (sched_name, trigger_name, trigger_group)
  269. )
  270. row_format = DYNAMIC;
  271. create table qrtz_simprop_triggers
  272. (
  273. sched_name varchar(120) charset utf8 not null,
  274. trigger_name varchar(200) charset utf8 not null,
  275. trigger_group varchar(200) charset utf8 not null,
  276. str_prop_1 varchar(512) charset utf8 null,
  277. str_prop_2 varchar(512) charset utf8 null,
  278. str_prop_3 varchar(512) charset utf8 null,
  279. int_prop_1 int null,
  280. int_prop_2 int null,
  281. long_prop_1 bigint null,
  282. long_prop_2 bigint null,
  283. dec_prop_1 decimal(13, 4) null,
  284. dec_prop_2 decimal(13, 4) null,
  285. bool_prop_1 varchar(1) charset utf8 null,
  286. bool_prop_2 varchar(1) charset utf8 null,
  287. primary key (sched_name, trigger_name, trigger_group),
  288. constraint qrtz_simprop_triggers_ibfk_1
  289. foreign key (sched_name, trigger_name, trigger_group) references qrtz_triggers (sched_name, trigger_name, trigger_group)
  290. )
  291. row_format = DYNAMIC;
  292. create index sched_name
  293. on qrtz_triggers (sched_name, job_name, job_group);
  294. create table re_album_drug
  295. (
  296. album_id int not null comment '产品相册ID',
  297. drug_id int not null comment '药品ID',
  298. constraint re_album_drug_index
  299. unique (album_id, drug_id)
  300. )
  301. row_format = DYNAMIC;
  302. create table re_dept_drug
  303. (
  304. drug_id int null,
  305. dept_id int null
  306. )
  307. charset = utf8
  308. row_format = DYNAMIC;
  309. create table report_handler_dept_relation
  310. (
  311. id int auto_increment comment '主键id'
  312. primary key,
  313. report_type varchar(20) null comment '报告类型',
  314. detp_id int null comment '企业id',
  315. handler_class varchar(64) null comment '处理类',
  316. create_time datetime null comment '创建时间',
  317. create_user int null comment '创建人',
  318. update_time datetime null comment '更新时间',
  319. update_user int null comment '更新人',
  320. template varchar(1024) null comment '模板文件名称'
  321. )
  322. comment '导出报告处理类和企业关系表';
  323. create table single_ent_settle_same_amount_for_members_in_current_month
  324. (
  325. record_id int unsigned auto_increment comment 'id'
  326. primary key,
  327. note_id int unsigned null comment '积分包计算记录id',
  328. realname varchar(32) null comment '用户名称',
  329. username varchar(11) null comment '用户名',
  330. id_number varchar(18) null comment '身份证',
  331. dept_id int null comment '结算企业id',
  332. dept_name varchar(64) null comment '结算企业名称',
  333. settle_amount decimal(20, 2) null comment '结算金额',
  334. sub_to_gig_time datetime null comment '结算时间',
  335. settle_state varchar(16) null comment '结算企业名称',
  336. sub_type_name varchar(16) null comment '结算渠道名称',
  337. package_name varchar(64) null comment '积分包名称',
  338. settle_note_create_time datetime null comment '结算记录创建时间',
  339. period int unsigned null comment '统计周期',
  340. member_count int unsigned null comment '风控人数',
  341. uuid varchar(64) not null comment 'uuid',
  342. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  343. )
  344. comment '单人连续多月结算相同金额';
  345. create index idx_uuid
  346. on single_ent_settle_same_amount_for_members_in_current_month (uuid);
  347. create table single_member_settle_amount_overrun_in_several_months
  348. (
  349. record_id int unsigned auto_increment comment 'id'
  350. primary key,
  351. note_id int unsigned null comment '积分包计算记录id',
  352. realname varchar(32) null comment '用户名称',
  353. username varchar(11) null comment '用户名',
  354. dept_id int null comment '结算企业id',
  355. dept_name varchar(64) null comment '结算企业名称',
  356. settle_amount decimal(20, 2) null comment '结算金额',
  357. sub_to_gig_time datetime null comment '结算时间',
  358. settle_state varchar(16) null comment '结算企业名称',
  359. sub_type_name varchar(16) null comment '结算渠道名称',
  360. package_name varchar(64) null comment '积分包名称',
  361. settle_note_create_time datetime null comment '结算记录创建时间',
  362. period int unsigned null comment '统计周期',
  363. platform_limit decimal null comment '结算限制',
  364. uuid varchar(64) not null comment 'uuid',
  365. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  366. )
  367. comment '单人连续多月结算额超标';
  368. create index idx_uuid
  369. on single_member_settle_amount_overrun_in_several_months (uuid);
  370. create table single_member_settle_same_amount_in_several_months
  371. (
  372. record_id int unsigned auto_increment comment 'id'
  373. primary key,
  374. note_id int unsigned null comment '积分包计算记录id',
  375. realname varchar(32) null comment '用户名称',
  376. username varchar(11) null comment '用户名',
  377. id_number varchar(18) null comment '身份证',
  378. dept_id int null comment '结算企业id',
  379. dept_name varchar(64) null comment '结算企业名称',
  380. settle_amount decimal(20, 2) null comment '结算金额',
  381. sub_to_gig_time datetime null comment '结算时间',
  382. settle_state varchar(16) null comment '结算企业名称',
  383. sub_type_name varchar(16) null comment '结算渠道名称',
  384. package_name varchar(64) null comment '积分包名称',
  385. settle_note_create_time datetime null comment '结算记录创建时间',
  386. period int unsigned null comment '统计周期',
  387. uuid varchar(64) not null comment 'uuid',
  388. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  389. )
  390. comment '单人连续多月结算相同金额';
  391. create index idx_uuid
  392. on single_member_settle_same_amount_in_several_months (uuid);
  393. create table single_member_without_such_task_types_in_several_months
  394. (
  395. record_id int unsigned auto_increment comment 'id'
  396. primary key,
  397. user_id int unsigned null comment '用户id',
  398. package_id int unsigned null comment '积分包id',
  399. package_name varchar(32) null comment '积分包名称',
  400. status varchar(11) null comment '积分包状态',
  401. realname varchar(32) null comment '用户名称',
  402. username varchar(11) null comment '用户名',
  403. dept_id int null comment '结算企业id',
  404. dept_name varchar(64) null comment '结算企业名称',
  405. period int unsigned null comment '统计周期',
  406. type_list varchar(255) null comment '风控任务类型',
  407. package_create_time datetime null comment '积分包创建时间',
  408. package_pick_up_time datetime null comment '积分包领取时间',
  409. first_task_time datetime null comment '首个任务时间',
  410. uuid varchar(64) not null comment 'uuid',
  411. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  412. )
  413. comment '单人连续多月结算相同金额';
  414. create index idx_uuid
  415. on single_member_without_such_task_types_in_several_months (uuid);
  416. create table sys_cert_result_record
  417. (
  418. id int(20) auto_increment
  419. primary key,
  420. user_id int(20) not null comment '用户id',
  421. dept_id int(20) not null comment '归属体id',
  422. subject_type int(1) not null comment '归属类型:0-> 人力家,1-> 税邦云',
  423. method varchar(25) not null comment '请求方法',
  424. code varchar(5) null comment '状态码',
  425. status varchar(5) null comment '结果码',
  426. message varchar(256) not null comment '结果信息',
  427. create_time timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '创建时间'
  428. )
  429. comment '认证结果记录表' row_format = DYNAMIC;
  430. create table sys_csm_user_relation
  431. (
  432. user_id int not null comment 'csm用户id',
  433. parent_id int not null comment '父级用户id',
  434. primary key (user_id, parent_id)
  435. )
  436. comment 'csm用户关系表';
  437. create table sys_dept
  438. (
  439. dept_id int(20) auto_increment
  440. primary key,
  441. name varchar(50) not null,
  442. sort int default 0 not null comment '排序',
  443. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  444. update_time datetime null on update CURRENT_TIMESTAMP comment '修改时间',
  445. del_flag char default '0' null,
  446. parent_id int null,
  447. tenant_id int null,
  448. dept_code varchar(50) null,
  449. level int(2) null comment '级别',
  450. level1_name varchar(50) null comment '药企名称',
  451. level1_id int null comment '药企ID',
  452. level2_name varchar(50) null comment '一级代理商名称',
  453. level2_id int null comment '一级代理商ID',
  454. level3_name varchar(50) null comment '二级代理商名称',
  455. level3_id int null comment '二级代理商ID',
  456. app_id varchar(32) null,
  457. app_secret varchar(255) null,
  458. rsa_public_key varchar(256) null,
  459. query_url varchar(255) null,
  460. subject_name varchar(128) null comment '结算主体',
  461. subject_type varchar(1024) null,
  462. tax_code varchar(50) null comment '税号',
  463. dept_permissions varchar(255) null comment '部门专用权限限制(字符串逗号分隔:0.导出)',
  464. gmv1_rate int null comment 'gmv1收益率(万分之)',
  465. gmv2_rate int null comment 'gmv2收益率(万分之)',
  466. renlijia_service_charge_rate int null comment '人力家服务费(万分之)',
  467. issue_date date null comment '服务起始时间',
  468. expiry_date date null comment '服务截止时间',
  469. financial_review_type char(10) null comment '财务复核方式',
  470. emails varchar(1024) null comment '邮箱(多个逗号分隔)',
  471. constraint sys_dept_dept_code_uindex
  472. unique (dept_code)
  473. )
  474. comment '部门管理' row_format = DYNAMIC;
  475. create table sys_dept_0517
  476. (
  477. dept_id int(20) auto_increment
  478. primary key,
  479. name varchar(50) not null,
  480. sort int default 0 not null comment '排序',
  481. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  482. update_time datetime null on update CURRENT_TIMESTAMP comment '修改时间',
  483. del_flag char default '0' null,
  484. parent_id int null,
  485. tenant_id int null,
  486. dept_code varchar(50) null,
  487. level int(2) null comment '级别',
  488. level1_name varchar(50) null comment '药企名称',
  489. level1_id int null comment '药企ID',
  490. level2_name varchar(50) null comment '一级代理商名称',
  491. level2_id int null comment '一级代理商ID',
  492. level3_name varchar(50) null comment '二级代理商名称',
  493. level3_id int null comment '二级代理商ID',
  494. app_id varchar(32) null,
  495. app_secret varchar(255) null,
  496. rsa_public_key varchar(256) null,
  497. query_url varchar(255) null,
  498. subject_name varchar(128) null comment '结算主体',
  499. subject_type varchar(2) null comment '认证方式0-人力家 1-税邦云'
  500. )
  501. comment '部门管理' row_format = DYNAMIC;
  502. create table sys_dept_csm
  503. (
  504. rec_id int(20) auto_increment comment 'id'
  505. primary key,
  506. dept_id int(20) not null comment '企业id',
  507. wl_qrcode_id varchar(32) not null comment '绑定的智能码 id',
  508. corp_id varchar(32) not null comment '企业id',
  509. csm_name varchar(32) not null comment '客户成功姓名',
  510. user_id int null comment '用户id',
  511. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  512. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间'
  513. )
  514. comment '企业csm表';
  515. create index idx_dept_id
  516. on sys_dept_csm (dept_id);
  517. create table sys_dept_encryptor
  518. (
  519. id int(20) auto_increment
  520. primary key,
  521. dept_id int(20) not null comment '主体id',
  522. ser_public_key varchar(2048) not null comment '服务器公钥',
  523. ser_private_key varchar(2048) not null comment '服务器私钥',
  524. cli_public_key varchar(2048) null comment '客户端公钥',
  525. cli_private_key varchar(2048) null comment '客户端私钥',
  526. signature varchar(32) not null comment '签名字符串',
  527. create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
  528. update_time timestamp default CURRENT_TIMESTAMP not null comment '更新时间'
  529. )
  530. comment '主体加密器' row_format = DYNAMIC;
  531. create table sys_dept_invoice
  532. (
  533. id int auto_increment comment '主键id'
  534. primary key,
  535. dept_id int null comment '组织机构ID',
  536. invoice_amount decimal(10, 2) default 0.00 not null comment '开票金额(元)',
  537. relation_package_score int default 0 not null comment '关联积分值',
  538. relation_package_number int default 0 not null comment '关联积分包个数',
  539. approval_status varchar(10) default 'PENDING' not null comment '审核状态',
  540. approval_time datetime null comment '审核时间',
  541. invoice_type char(10) not null comment '发票类型',
  542. address varchar(64) null comment '邮寄地址',
  543. addressee_name varchar(32) null comment '收件人姓名',
  544. addressee_phone varchar(20) null comment '收件人手机号',
  545. del_flag varchar(10) default '0' not null comment '是否删除',
  546. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  547. create_user int null comment '创建人',
  548. update_time datetime null comment '更新时间',
  549. update_user int null comment '更新人'
  550. )
  551. comment '企业开票表';
  552. create index sys_dept_invoice_dept_id_index
  553. on sys_dept_invoice (dept_id);
  554. create table sys_dept_invoice_relation
  555. (
  556. id int auto_increment comment '主键id'
  557. primary key,
  558. invoice_id int null comment '企业开票表ID',
  559. dept_id int not null comment '发包企业id',
  560. package_id int not null comment '积分包id',
  561. invoice_status varchar(10) default 'PENDING' not null comment '开票状态',
  562. invoice_time datetime null comment '开票时间',
  563. del_flag varchar(10) default '0' not null comment '是否删除',
  564. create_time datetime default CURRENT_TIMESTAMP null comment '创建/申请时间',
  565. create_user int null comment '创建人',
  566. update_time datetime null comment '更新时间',
  567. update_user int null comment '更新人',
  568. constraint sys_dept_invoice_relation_invoice_id_package_id_uindex
  569. unique (invoice_id, package_id)
  570. )
  571. comment '企业开票关联表';
  572. create table sys_dept_recharge
  573. (
  574. id int auto_increment comment '主键id'
  575. primary key,
  576. dept_id int null comment '组织机构ID',
  577. score int default 0 not null comment '积分余额',
  578. balance decimal(10, 2) default 0.00 not null comment '余额(元)(已废弃)',
  579. permissions varchar(64) null comment '权限,多个逗号分隔',
  580. service_charge decimal(5, 2) default 0.00 not null comment '服务费率',
  581. overdraw_amount decimal(10, 2) default 0.00 not null comment '可透支金额(已废弃)',
  582. overdraw_score int default 0 not null comment '可透支积分',
  583. del_flag varchar(10) default '0' not null comment '是否删除',
  584. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  585. create_user int null comment '创建人',
  586. update_time datetime null comment '更新时间',
  587. update_user int null comment '更新人',
  588. version int default 0 null,
  589. constraint sys_dept_recharge_dept_id_uindex
  590. unique (dept_id)
  591. )
  592. comment '积分充值表';
  593. create table sys_dept_recharge_record
  594. (
  595. id int auto_increment comment '主键id'
  596. primary key,
  597. recharge_id int null comment '积分充值表ID',
  598. dept_id int null comment '组织机构ID',
  599. relation_dept_id int null comment '关联组织机构ID(关联操作对象)',
  600. change_score int not null comment '充值积分',
  601. change_amount decimal(10, 2) default 0.00 not null comment '充值金额(元)(已废弃)',
  602. type char(25) not null comment '操作类型',
  603. current_score int not null comment '充值后积分余额',
  604. current_balance decimal(10, 2) default 0.00 not null comment '充值后积分余额(元)(已废弃)',
  605. package_id int null comment '积分包id',
  606. package_type varchar(32) null comment '积分包类型',
  607. del_flag varchar(10) default '0' not null comment '是否删除',
  608. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  609. create_user int null comment '创建人'
  610. )
  611. comment '积分充值/使用记录表';
  612. create index sys_dept_recharge_record_dept_id_index
  613. on sys_dept_recharge_record (dept_id);
  614. create table sys_dept_relation
  615. (
  616. ancestor int not null comment '祖先节点',
  617. descendant int not null comment '后代节点'
  618. )
  619. comment '部门关系表' row_format = DYNAMIC;
  620. create index idx1
  621. on sys_dept_relation (ancestor);
  622. create index idx2
  623. on sys_dept_relation (descendant);
  624. create table sys_dept_sub
  625. (
  626. sub_id int auto_increment
  627. primary key,
  628. dept_id int(20) not null,
  629. subject_type varchar(2) default '0' not null comment '认证方式0-人力家 1-税邦云',
  630. subject_channel int default 0 not null comment '结算通道',
  631. subject_location varchar(64) null comment '税源地',
  632. app_id varchar(255) default '0' null,
  633. app_secret varchar(2048) null,
  634. rsa_public_key varchar(2048) null,
  635. query_url varchar(255) null,
  636. subject_name varchar(128) null comment '结算主体',
  637. limit_amount decimal(18, 2) null,
  638. enable_flag varchar(2) default '0' null,
  639. subject_user_type varchar(2) null comment '税邦云用户类型id',
  640. subject_invoice_category varchar(25) null comment '税邦云用户类型对应的发票类目',
  641. path_no varchar(128) null comment '汇企云批次付款渠道编号',
  642. update_time datetime null comment '更新时间',
  643. service_charge decimal(4, 2) default 0.00 not null,
  644. cert_enable tinyint default 1 null comment '认证是否启用:1:启用,0:停用',
  645. settle_enable tinyint default 1 null comment '结算是否启用:1:启用,0:停用',
  646. eid_enable tinyint default 1 null comment 'E证通认证是否启用:1-启用,0-停用'
  647. )
  648. comment '部门结算主体管理' row_format = DYNAMIC;
  649. create table sys_dict
  650. (
  651. id int(64) auto_increment comment '编号'
  652. primary key,
  653. type varchar(100) null,
  654. description varchar(100) null,
  655. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  656. update_time datetime default CURRENT_TIMESTAMP not null comment '更新时间',
  657. remarks varchar(255) null,
  658. `system` char default '0' null,
  659. del_flag char default '0' null,
  660. tenant_id int default 0 not null comment '所属租户'
  661. )
  662. comment '字典表' row_format = DYNAMIC;
  663. create index sys_dict_del_flag
  664. on sys_dict (del_flag);
  665. create table sys_dict_item
  666. (
  667. id int(64) auto_increment comment '编号'
  668. primary key,
  669. dict_id int not null,
  670. value varchar(100) null,
  671. label varchar(100) null,
  672. type varchar(100) null,
  673. description varchar(512) null,
  674. sort int(10) default 0 not null comment '排序(升序)',
  675. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  676. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  677. remarks varchar(255) null,
  678. del_flag char default '0' null,
  679. tenant_id int default 0 not null comment '所属租户'
  680. )
  681. comment '字典项' row_format = DYNAMIC;
  682. create index sys_dict_del_flag
  683. on sys_dict_item (del_flag);
  684. create index sys_dict_label
  685. on sys_dict_item (label);
  686. create index sys_dict_value
  687. on sys_dict_item (value);
  688. create table sys_dict_item_copy
  689. (
  690. id int(64) auto_increment comment '编号'
  691. primary key,
  692. dict_id int not null,
  693. value varchar(100) null,
  694. label varchar(100) null,
  695. type varchar(100) null,
  696. description varchar(100) null,
  697. sort int(10) default 0 not null comment '排序(升序)',
  698. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  699. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  700. remarks varchar(255) null,
  701. del_flag char default '0' null,
  702. tenant_id int default 0 not null comment '所属租户'
  703. )
  704. comment '字典项' row_format = DYNAMIC;
  705. create index sys_dict_del_flag
  706. on sys_dict_item_copy (del_flag);
  707. create index sys_dict_label
  708. on sys_dict_item_copy (label);
  709. create index sys_dict_value
  710. on sys_dict_item_copy (value);
  711. create table sys_ent_rel
  712. (
  713. rel_id int(20) auto_increment comment 'id'
  714. primary key,
  715. ent_id int(20) not null comment '企业id',
  716. e_type varchar(8) not null comment '租户类型',
  717. pro_line varchar(8) not null comment '产品线',
  718. e_level varchar(8) not null comment '租户层级',
  719. parent_id int(20) not null comment '父级id',
  720. root_id int(20) not null comment '顶层id',
  721. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  722. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间'
  723. )
  724. comment '企业层级关系表';
  725. create index idx_level
  726. on sys_ent_rel (e_level);
  727. create index idx_pid
  728. on sys_ent_rel (parent_id);
  729. create index idx_pro_line
  730. on sys_ent_rel (pro_line);
  731. create index idx_rid
  732. on sys_ent_rel (root_id);
  733. create index idx_type
  734. on sys_ent_rel (e_type);
  735. create table sys_file
  736. (
  737. id bigint(32) auto_increment comment '编号'
  738. primary key,
  739. file_name varchar(1500) null,
  740. bucket_name varchar(200) null,
  741. original varchar(1500) null,
  742. type varchar(50) null,
  743. file_size bigint(50) null comment '文件大小',
  744. create_user varchar(32) null,
  745. create_time datetime default CURRENT_TIMESTAMP null comment '上传时间',
  746. update_user varchar(32) null,
  747. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
  748. del_flag char default '0' null,
  749. tenant_id int null comment '所属租户'
  750. )
  751. comment '文件管理表' row_format = DYNAMIC;
  752. create table sys_job
  753. (
  754. job_id int auto_increment comment '任务id',
  755. job_name varchar(64) not null comment '任务名称',
  756. job_group varchar(64) not null comment '任务组名',
  757. job_order char default '1' null comment '组内执行顺利,值越大执行优先级越高,最大值9,最小值1',
  758. job_type char default '1' not null comment '1、java类;2、spring bean名称;3、rest调用;4、jar调用;9其他',
  759. execute_path varchar(500) null comment 'job_type=3时,rest调用地址,仅支持rest get协议,需要增加String返回值,0成功,1失败;job_type=4时,jar路径;其它值为空',
  760. class_name varchar(500) null comment 'job_type=1时,类完整路径;job_type=2时,spring bean名称;其它值为空',
  761. method_name varchar(500) null comment '任务方法',
  762. method_params_value varchar(2000) null comment '参数值',
  763. cron_expression varchar(255) null comment 'cron执行表达式',
  764. misfire_policy varchar(20) default '3' null comment '错失执行策略(1错失周期立即执行 2错失周期执行一次 3下周期执行)',
  765. job_tenant_type char default '1' null comment '1、多租户任务;2、非多租户任务',
  766. job_status char default '0' null comment '状态(1、未发布;2、运行中;3、暂停;4、删除;)',
  767. job_execute_status char default '0' null comment '状态(0正常 1异常)',
  768. create_by varchar(64) null comment '创建者',
  769. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  770. update_by varchar(64) default '' null comment '更新者',
  771. update_time datetime default CURRENT_TIMESTAMP not null comment '更新时间',
  772. start_time timestamp null comment '初次执行时间',
  773. previous_time timestamp null comment '上次执行时间',
  774. next_time timestamp null comment '下次执行时间',
  775. tenant_id int default 1 null comment '租户',
  776. remark varchar(500) default '' null comment '备注信息',
  777. primary key (job_id, job_name, job_group)
  778. )
  779. comment '定时任务调度表' row_format = DYNAMIC;
  780. create table sys_job_log
  781. (
  782. job_log_id int auto_increment comment '任务日志ID'
  783. primary key,
  784. job_id int not null comment '任务id',
  785. job_name varchar(64) charset utf8 null comment '任务名称',
  786. job_group varchar(64) charset utf8 null comment '任务组名',
  787. job_order char charset utf8 null comment '组内执行顺利,值越大执行优先级越高,最大值9,最小值1',
  788. job_type char charset utf8 default '1' not null comment '1、java类;2、spring bean名称;3、rest调用;4、jar调用;9其他',
  789. execute_path varchar(500) charset utf8 null comment 'job_type=3时,rest调用地址,仅支持post协议;job_type=4时,jar路径;其它值为空',
  790. class_name varchar(500) charset utf8 null comment 'job_type=1时,类完整路径;job_type=2时,spring bean名称;其它值为空',
  791. method_name varchar(500) charset utf8 null comment '任务方法',
  792. method_params_value varchar(2000) charset utf8 null comment '参数值',
  793. cron_expression varchar(255) charset utf8 null comment 'cron执行表达式',
  794. job_message varchar(500) charset utf8 null comment '日志信息',
  795. job_log_status char charset utf8 default '0' null comment '执行状态(0正常 1失败)',
  796. execute_time varchar(30) charset utf8 null comment '执行时间',
  797. exception_info varchar(2000) charset utf8 default '' null comment '异常信息',
  798. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  799. tenant_id int default 1 not null comment '租户id',
  800. uuid varchar(64) null comment 'uuid'
  801. )
  802. comment '定时任务执行日志表' row_format = DYNAMIC;
  803. create table sys_log
  804. (
  805. id bigint(64) auto_increment comment '编号'
  806. primary key,
  807. type char default '0' null,
  808. title varchar(255) null,
  809. service_id varchar(32) null,
  810. create_by varchar(255) null,
  811. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  812. update_time datetime null on update CURRENT_TIMESTAMP comment '更新时间',
  813. remote_addr varchar(255) null,
  814. user_agent varchar(1000) null,
  815. request_uri varchar(255) null,
  816. method varchar(10) null,
  817. params text null,
  818. resp text null comment '响应信息',
  819. time mediumtext charset utf8 null comment '执行时间',
  820. del_flag char default '0' null,
  821. exception text null,
  822. tenant_id int default 0 null comment '所属租户'
  823. )
  824. comment '日志表' row_format = DYNAMIC;
  825. create index sys_log_create_by
  826. on sys_log (create_by(191));
  827. create index sys_log_create_date
  828. on sys_log (create_time);
  829. create index sys_log_request_uri
  830. on sys_log (request_uri(191));
  831. create index sys_log_type
  832. on sys_log (type);
  833. create table sys_menu
  834. (
  835. menu_id int auto_increment comment '菜单ID'
  836. primary key,
  837. name varchar(32) null,
  838. permission varchar(32) null,
  839. path varchar(128) null,
  840. parent_id int null comment '父菜单ID',
  841. icon varchar(32) null,
  842. sort int default 1 null comment '排序值',
  843. keep_alive char default '0' null,
  844. type char default '0' null,
  845. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  846. update_time datetime null comment '更新时间',
  847. del_flag char default '0' null,
  848. tenant_id int(11) unsigned null comment '租户ID'
  849. )
  850. comment '菜单权限表' row_format = DYNAMIC;
  851. create table sys_oauth_client_details
  852. (
  853. id int auto_increment comment 'ID'
  854. primary key,
  855. client_id varchar(32) not null,
  856. resource_ids varchar(256) null,
  857. client_secret varchar(256) null,
  858. scope varchar(256) null,
  859. authorized_grant_types varchar(256) null,
  860. web_server_redirect_uri varchar(256) null,
  861. authorities varchar(256) null,
  862. access_token_validity int null,
  863. refresh_token_validity int null,
  864. additional_information varchar(4096) null,
  865. autoapprove varchar(256) null,
  866. del_flag char default '0' null,
  867. tenant_id int default 0 not null comment '所属租户'
  868. )
  869. comment '终端信息表' row_format = DYNAMIC;
  870. create table sys_plat
  871. (
  872. id int not null
  873. primary key,
  874. phone varchar(255) null comment '手机号',
  875. idcard varchar(255) null comment '身份证号',
  876. temp1 varchar(255) null comment '备用字段1',
  877. temp2 varchar(255) null comment '备用字段2',
  878. temp3 varchar(255) null comment '备用字段3',
  879. temp4 varchar(255) null comment '备用字段4',
  880. 备用字段5 varchar(255) null comment '备用字段5'
  881. )
  882. comment '平台用户信息' row_format = DYNAMIC;
  883. create table sys_portal_conf
  884. (
  885. conf_id bigint auto_increment comment '主键'
  886. primary key,
  887. spec_path varchar(32) not null comment '专属路径',
  888. portal_logo varchar(255) not null comment 'logo',
  889. portal_icon varchar(255) not null comment 'icon',
  890. portal_title varchar(32) not null comment 'title',
  891. portal_name varchar(16) not null comment '名称',
  892. bg_img varchar(255) null comment '背景图',
  893. theme_color json null comment '主题色',
  894. icp_no varchar(128) not null comment 'icp备案',
  895. pc_no varchar(128) not null comment 'pc备案号',
  896. created_by varchar(64) not null comment '创建人',
  897. modified_by varchar(64) not null comment '修改人',
  898. created_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  899. modified_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间'
  900. )
  901. comment '门户配置信息' collate = utf8_bin;
  902. create index sys_portal_conf_spec_path_index
  903. on sys_portal_conf (spec_path);
  904. create table sys_public_param
  905. (
  906. public_id bigint auto_increment comment '编号'
  907. primary key,
  908. public_name varchar(128) null comment '名称',
  909. public_key varchar(128) null comment '键',
  910. public_value varchar(128) null comment '值',
  911. status char default '0' null comment '状态(0:正常,9:冻结)',
  912. validate_code varchar(64) null,
  913. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  914. update_time datetime null on update CURRENT_TIMESTAMP comment '修改时间',
  915. public_type char default '0' null,
  916. `system` char default '0' null,
  917. del_flag char default '0' null,
  918. tenant_id int null comment '租户ID'
  919. )
  920. comment '公共参数配置表' row_format = DYNAMIC;
  921. create table sys_role
  922. (
  923. role_id int auto_increment
  924. primary key,
  925. role_name varchar(64) null,
  926. role_code varchar(64) null,
  927. role_desc varchar(255) null,
  928. ds_type char default '2' null,
  929. ds_scope varchar(255) null,
  930. create_time datetime default CURRENT_TIMESTAMP not null,
  931. update_time datetime null,
  932. del_flag char default '0' null,
  933. tenant_id int null
  934. )
  935. comment '系统角色表' row_format = DYNAMIC;
  936. create index role_idx1_role_code
  937. on sys_role (role_code);
  938. create table sys_role_menu
  939. (
  940. role_id int not null comment '角色ID',
  941. menu_id int not null comment '菜单ID',
  942. primary key (role_id, menu_id)
  943. )
  944. comment '角色菜单表' row_format = DYNAMIC;
  945. create table sys_route_conf
  946. (
  947. id int auto_increment comment '主键'
  948. primary key,
  949. route_name varchar(30) null,
  950. route_id varchar(30) null,
  951. predicates json null comment '断言',
  952. filters json null comment '过滤器',
  953. uri varchar(50) null,
  954. `order` int(2) default 0 null comment '排序',
  955. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  956. update_time datetime null on update CURRENT_TIMESTAMP comment '修改时间',
  957. del_flag char default '0' null
  958. )
  959. comment '路由配置表' row_format = DYNAMIC;
  960. create table sys_social_details
  961. (
  962. id int auto_increment comment '主鍵'
  963. primary key,
  964. type varchar(16) null,
  965. remark varchar(64) null,
  966. app_id varchar(64) null,
  967. app_secret varchar(64) null,
  968. random_key varchar(16) null comment '随机key(16位)',
  969. redirect_url varchar(128) null,
  970. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  971. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
  972. del_flag char default '0' null,
  973. tenant_id int default 0 not null comment '所属租户'
  974. )
  975. comment '系统社交登录账号表' row_format = DYNAMIC;
  976. create table sys_social_details_copy
  977. (
  978. id int auto_increment comment '主鍵'
  979. primary key,
  980. type varchar(16) null,
  981. remark varchar(64) null,
  982. app_id varchar(64) null,
  983. app_secret varchar(64) null,
  984. redirect_url varchar(128) null,
  985. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  986. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
  987. del_flag char default '0' null,
  988. tenant_id int default 0 not null comment '所属租户'
  989. )
  990. comment '系统社交登录账号表' row_format = DYNAMIC;
  991. create table sys_social_details_copy1
  992. (
  993. id int auto_increment comment '主鍵'
  994. primary key,
  995. type varchar(16) null,
  996. remark varchar(64) null,
  997. app_id varchar(64) null,
  998. app_secret varchar(64) null,
  999. random_key varchar(16) null comment '随机key(16位)',
  1000. redirect_url varchar(128) null,
  1001. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  1002. update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '更新时间',
  1003. del_flag char default '0' null,
  1004. tenant_id int default 0 not null comment '所属租户'
  1005. )
  1006. comment '系统社交登录账号表' row_format = DYNAMIC;
  1007. create table sys_tenant
  1008. (
  1009. id int auto_increment comment '租户id'
  1010. primary key,
  1011. name varchar(255) null,
  1012. code varchar(64) null,
  1013. start_time datetime null comment '开始时间',
  1014. end_time datetime null comment '结束时间',
  1015. status char default '0' null,
  1016. del_flag char default '0' null,
  1017. create_time datetime default CURRENT_TIMESTAMP not null comment '创建',
  1018. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间'
  1019. )
  1020. comment '租户表' row_format = DYNAMIC;
  1021. create table sys_user
  1022. (
  1023. user_id int auto_increment comment '主键ID'
  1024. primary key,
  1025. username varchar(64) null,
  1026. password varchar(255) null,
  1027. salt varchar(255) null,
  1028. phone varchar(20) null,
  1029. avatar varchar(1024) null,
  1030. dept_id int null comment '部门ID',
  1031. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  1032. update_time datetime null on update CURRENT_TIMESTAMP comment '修改时间',
  1033. lock_flag char default '0' null,
  1034. del_flag char default '0' null,
  1035. wx_openid varchar(32) null comment '微信登录openId',
  1036. mini_openid varchar(32) null comment '小程序openId',
  1037. qq_openid varchar(32) null comment 'QQ openId',
  1038. gitee_login varchar(100) null comment '码云 标识',
  1039. osc_id varchar(100) null comment '开源中国 标识',
  1040. tenant_id int default 0 not null comment '所属租户',
  1041. realname varchar(30) null comment '用户姓名',
  1042. province varchar(20) null comment '省',
  1043. city varchar(20) null comment '市',
  1044. area varchar(20) null comment '区',
  1045. address varchar(255) null comment '地址',
  1046. temp1 varchar(255) null comment '备用字段1',
  1047. temp2 varchar(2000) null comment '备用字段2',
  1048. temp3 varchar(255) null comment '备用字段3',
  1049. temp4 varchar(255) null comment '备用字段4',
  1050. temp5 varchar(255) null comment '备用字段5',
  1051. plat_id varchar(50) null comment '平台ID',
  1052. drug_ent_id varchar(11) null comment '药企ID',
  1053. w1 varchar(255) null,
  1054. id_card_number varchar(32) null comment '身份证',
  1055. user_sign varchar(255) null comment '签名',
  1056. cert_status int(2) null comment '认证状态',
  1057. cert_remark varchar(255) null comment '认证结果描述',
  1058. province_code varchar(11) null comment '省份编码',
  1059. city_code varchar(11) null comment '城市编码',
  1060. user_type varchar(2) default '0' null comment '认证方式0-人力家 1-税邦云',
  1061. bank_card_number varchar(19) null comment '银行卡号',
  1062. rlj_cert_status int(2) null comment '人力家认证状态',
  1063. tax_helper_agreement_signature int(1) default 0 null comment '税邦云协议签署记录 0 未签署 1 已签署',
  1064. bank_phone varchar(11) null comment '银行预留手机号',
  1065. bank_name varchar(32) null comment '开户行',
  1066. sign_agreement varchar(1024) null comment '小程序签署协议信息',
  1067. age_reminder tinyint default 1 null comment '年龄超60周岁提醒',
  1068. re_signed_agreement int default 1 null comment '是否已补签协议',
  1069. gender char(5) null comment '性别,1男,2女',
  1070. degree char(2) null comment '学历',
  1071. qualification_record_number varchar(64) null comment '医药代表资质备案号',
  1072. qualifications_url varchar(256) null comment '资质证书url'
  1073. )
  1074. comment '用户表' row_format = DYNAMIC;
  1075. create index user_idx1_username
  1076. on sys_user (username);
  1077. create index user_qq_openid
  1078. on sys_user (qq_openid);
  1079. create index user_wx_openid
  1080. on sys_user (wx_openid);
  1081. create table sys_user_0226
  1082. (
  1083. user_id int auto_increment comment '主键ID'
  1084. primary key,
  1085. username varchar(64) null,
  1086. password varchar(255) null,
  1087. salt varchar(255) null,
  1088. phone varchar(20) null,
  1089. avatar varchar(255) null,
  1090. dept_id int null comment '部门ID',
  1091. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  1092. update_time datetime null on update CURRENT_TIMESTAMP comment '修改时间',
  1093. lock_flag char default '0' null,
  1094. del_flag char default '0' null,
  1095. wx_openid varchar(32) null comment '微信登录openId',
  1096. mini_openid varchar(32) null comment '小程序openId',
  1097. qq_openid varchar(32) null comment 'QQ openId',
  1098. gitee_login varchar(100) null comment '码云 标识',
  1099. osc_id varchar(100) null comment '开源中国 标识',
  1100. tenant_id int default 0 not null comment '所属租户',
  1101. realname varchar(30) null comment '用户姓名',
  1102. province varchar(20) null comment '省',
  1103. city varchar(20) null comment '市',
  1104. area varchar(20) null comment '区',
  1105. address varchar(255) null comment '地址',
  1106. temp1 varchar(255) null comment '备用字段1',
  1107. temp2 varchar(2000) null comment '备用字段2',
  1108. temp3 varchar(255) null comment '备用字段3',
  1109. temp4 varchar(255) null comment '备用字段4',
  1110. temp5 varchar(255) null comment '备用字段5',
  1111. plat_id varchar(50) null comment '平台ID',
  1112. drug_ent_id varchar(11) null comment '药企ID',
  1113. w1 varchar(255) null,
  1114. id_card_number varchar(32) null comment '身份证',
  1115. user_sign varchar(255) null comment '签名',
  1116. cert_status int(2) null comment '认证状态',
  1117. cert_remark varchar(255) null comment '认证结果描述',
  1118. province_code varchar(11) null comment '省份编码',
  1119. city_code varchar(11) null comment '城市编码'
  1120. )
  1121. comment '用户表' row_format = DYNAMIC;
  1122. create index user_idx1_username
  1123. on sys_user_0226 (username);
  1124. create index user_qq_openid
  1125. on sys_user_0226 (qq_openid);
  1126. create index user_wx_openid
  1127. on sys_user_0226 (wx_openid);
  1128. create table sys_user_0517
  1129. (
  1130. user_id int auto_increment comment '主键ID'
  1131. primary key,
  1132. username varchar(64) null,
  1133. password varchar(255) null,
  1134. salt varchar(255) null,
  1135. phone varchar(20) null,
  1136. avatar varchar(255) null,
  1137. dept_id int null comment '部门ID',
  1138. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  1139. update_time datetime null on update CURRENT_TIMESTAMP comment '修改时间',
  1140. lock_flag char default '0' null,
  1141. del_flag char default '0' null,
  1142. wx_openid varchar(32) null comment '微信登录openId',
  1143. mini_openid varchar(32) null comment '小程序openId',
  1144. qq_openid varchar(32) null comment 'QQ openId',
  1145. gitee_login varchar(100) null comment '码云 标识',
  1146. osc_id varchar(100) null comment '开源中国 标识',
  1147. tenant_id int default 0 not null comment '所属租户',
  1148. realname varchar(30) null comment '用户姓名',
  1149. province varchar(20) null comment '省',
  1150. city varchar(20) null comment '市',
  1151. area varchar(20) null comment '区',
  1152. address varchar(255) null comment '地址',
  1153. temp1 varchar(255) null comment '备用字段1',
  1154. temp2 varchar(2000) null comment '备用字段2',
  1155. temp3 varchar(255) null comment '备用字段3',
  1156. temp4 varchar(255) null comment '备用字段4',
  1157. temp5 varchar(255) null comment '备用字段5',
  1158. plat_id varchar(50) null comment '平台ID',
  1159. drug_ent_id varchar(11) null comment '药企ID',
  1160. w1 varchar(255) null,
  1161. id_card_number varchar(32) null comment '身份证',
  1162. user_sign varchar(255) null comment '签名',
  1163. cert_status int(2) null comment '认证状态',
  1164. cert_remark varchar(255) null comment '认证结果描述',
  1165. province_code varchar(11) null comment '省份编码',
  1166. city_code varchar(11) null comment '城市编码',
  1167. user_type varchar(2) default '0' null comment '认证方式0-人力家 1-税邦云',
  1168. bank_card_number varchar(19) null comment '银行卡号'
  1169. )
  1170. comment '用户表' row_format = DYNAMIC;
  1171. create index user_idx1_username
  1172. on sys_user_0517 (username);
  1173. create index user_qq_openid
  1174. on sys_user_0517 (qq_openid);
  1175. create index user_wx_openid
  1176. on sys_user_0517 (wx_openid);
  1177. create table sys_user_ext_record
  1178. (
  1179. id int auto_increment comment '主键id'
  1180. primary key,
  1181. user_id int not null comment '用户id',
  1182. dept_id int not null comment '部门id',
  1183. real_name varchar(30) null comment '用户姓名',
  1184. phone varchar(20) null comment '手机号',
  1185. id_card_number varchar(32) null comment '身份证号',
  1186. bank_card_number varchar(19) null comment '银行卡号',
  1187. bank_phone varchar(11) null comment '银行预留手机号',
  1188. id_card_front_url varchar(255) null comment '身份证照片-正面',
  1189. id_card_back_url varchar(255) null comment '身份证照片-反面',
  1190. id_card_front_base64 longtext null comment '身份证照片-正面base64',
  1191. id_card_back_base64 longtext null comment '身份证照片-反面base64',
  1192. best_frame_url varchar(255) null comment '最佳帧照片url',
  1193. best_frame_base64 longtext null comment '最佳帧照片base64',
  1194. etoken varchar(40) null comment 'etoken',
  1195. remark varchar(255) null comment '备注',
  1196. del_flag char default '0' null comment '删除标记',
  1197. create_time datetime null comment '创建时间',
  1198. create_user int null comment '创建人',
  1199. update_time datetime null comment '更新时间',
  1200. update_user int null comment '更新人'
  1201. )
  1202. comment '用户认证相关的扩展信息';
  1203. create index sys_user_ext_record_user_id_index
  1204. on sys_user_ext_record (user_id);
  1205. create table sys_user_record
  1206. (
  1207. id int auto_increment comment '主键id'
  1208. primary key,
  1209. user_id varchar(64) null comment '用户id',
  1210. type varchar(64) null comment '记录类型',
  1211. msg varchar(1024) null comment '记录信息',
  1212. del_flag char(64) default '0' not null comment '删除标记位',
  1213. create_user varchar(64) null comment '创建人',
  1214. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  1215. update_user varchar(64) null comment '更新人',
  1216. update_time datetime null on update CURRENT_TIMESTAMP comment '更新时间时间'
  1217. )
  1218. comment '用户回访记录表';
  1219. create table sys_user_role
  1220. (
  1221. user_id int not null comment '用户ID',
  1222. role_id int not null comment '角色ID',
  1223. primary key (user_id, role_id)
  1224. )
  1225. comment '用户角色表' row_format = DYNAMIC;
  1226. create table sys_user_sub
  1227. (
  1228. id int auto_increment comment '主键ID'
  1229. primary key,
  1230. user_id int not null comment '用户ID',
  1231. dept_id int null comment '部门id',
  1232. gig_type int(2) not null comment '零工平台类型(订单支付方式类型:0-人力家 1-税邦云 2-自由职家 3-易联数科)',
  1233. gig_channel int default 0 null comment '渠道',
  1234. subject_location varchar(64) null comment '税源地',
  1235. callback_status int(1) default 0 null comment '回调状态',
  1236. cert_status int default 0 not null comment '认证状态',
  1237. cert_remark longtext null comment '认证结果描述',
  1238. fail_reason varchar(255) null comment '认证失败原因',
  1239. user_type varchar(2) null comment '人员类型',
  1240. bank_card_number varchar(19) null comment '银行卡号',
  1241. bank_phone varchar(11) null comment '银行预留手机号',
  1242. bank_name varchar(64) null comment '开户行',
  1243. id_card_front_url varchar(255) null comment '身份证照片-正面',
  1244. id_card_back_url varchar(255) null comment '身份证照片-反面',
  1245. cert_video1_url varchar(255) null comment '认证视频1',
  1246. cert_video2_url varchar(255) null comment '认证视频1',
  1247. agreement_url varchar(255) null comment '协议',
  1248. request_id varchar(255) null comment '请求流水号',
  1249. create_time datetime null comment '创建时间',
  1250. create_user int null comment '创建人',
  1251. update_time datetime null comment '更新时间',
  1252. update_user int null comment '更新人',
  1253. callback_time datetime null comment '回调时间'
  1254. )
  1255. comment '用户签约认证主体信息表';
  1256. create table sys_wx_reply_message
  1257. (
  1258. id int auto_increment comment '主鍵'
  1259. primary key,
  1260. keyword varchar(255) not null comment '关键字',
  1261. type tinyint(1) not null comment '消息类型(0:文字,1:图片,2:视频,3:图文消息)',
  1262. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  1263. update_time datetime not null comment '更新时间',
  1264. enable_flag tinyint(1) default 0 not null comment '是否生效(0:未生效,1:生效)'
  1265. )
  1266. comment '微信自动回复消息表' row_format = DYNAMIC;
  1267. create table sys_wx_reply_message_media
  1268. (
  1269. id int auto_increment comment '主键'
  1270. primary key,
  1271. media_type tinyint(1) not null comment '素材类型(1:文字,2:图片,3:视频)',
  1272. title varchar(255) null comment '视频的标题',
  1273. introduction varchar(255) null comment '视频的描述',
  1274. content varchar(1024) null comment '内容',
  1275. name varchar(255) null comment '文件名称',
  1276. url varchar(512) null comment 'url地址',
  1277. wx_media_id varchar(128) null comment '微信素材id',
  1278. sort int(2) not null comment '排序',
  1279. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  1280. update_time datetime not null comment '更新时间'
  1281. )
  1282. comment '微信自动回复消息素材表' row_format = DYNAMIC;
  1283. create table sys_wx_reply_message_relation
  1284. (
  1285. id int auto_increment
  1286. primary key,
  1287. message_id int not null comment '微信消息id',
  1288. message_media_id int not null comment '微信消息素材id'
  1289. )
  1290. comment '微信消息和素材关联表' row_format = DYNAMIC;
  1291. create table upms_sequence
  1292. (
  1293. id bigint auto_increment
  1294. primary key,
  1295. value bigint not null,
  1296. name varchar(32) not null,
  1297. gmt_create datetime not null,
  1298. gmt_modified datetime not null,
  1299. constraint uk_name
  1300. unique (name)
  1301. );
  1302. create table user_agreement_signature_record
  1303. (
  1304. id int auto_increment comment 'id'
  1305. primary key,
  1306. user_id int not null comment '用户id',
  1307. target int(1) not null comment '协议方',
  1308. agreement mediumtext null comment '协议文本',
  1309. sign_time datetime not null comment '签署时间',
  1310. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  1311. sign_img longtext null comment '手签图片'
  1312. )
  1313. comment '用户协议签名';
  1314. create table wm_ad_record
  1315. (
  1316. record_id bigint unsigned auto_increment comment 'id'
  1317. primary key,
  1318. user_id int not null comment '用户id',
  1319. ad_url varchar(255) not null comment '跳转地址',
  1320. created_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  1321. )
  1322. comment '部门管理';
  1323. create table wm_af_customer
  1324. (
  1325. id int auto_increment comment '主键id'
  1326. primary key,
  1327. dept_id int null comment '部门id',
  1328. customer_number varchar(20) charset utf8mb4 not null comment '客户id',
  1329. customer_name varchar(50) charset utf8mb4 not null comment '客户名称',
  1330. customer_type varchar(20) not null comment '客户类别(0-药企、1-CSO、2-CRO、3-其他)',
  1331. customer_manager varchar(50) charset utf8mb4 not null comment '客户经理',
  1332. channel_name varchar(50) charset utf8mb4 null comment '渠道名称',
  1333. sign_date datetime null comment '签订日期',
  1334. expiration_date datetime null comment '有效期截止',
  1335. customer_status varchar(20) null comment '客户状态:(0-客户备案、1-合同立项、2-签约 、3-上线)',
  1336. remark varchar(128) charset utf8mb4 null comment '说明',
  1337. contract_file varchar(512) charset utf8mb4 null comment '合同附件',
  1338. contract_name varchar(50) charset utf8mb4 null comment '合同名称',
  1339. create_time datetime null comment '创建时间',
  1340. create_user int null comment '创建人',
  1341. update_time datetime null comment '更新时间',
  1342. update_user int null comment '更新人'
  1343. )
  1344. comment '档案-客户管理' charset = utf8
  1345. row_format = DYNAMIC;
  1346. create table wm_contract
  1347. (
  1348. id bigint(11) auto_increment comment '编号'
  1349. primary key,
  1350. customer_id int null comment '客户主键id',
  1351. tenant_id int null comment '租户id',
  1352. serial_no varchar(255) null comment '合同编号',
  1353. title varchar(255) charset utf8 null comment '合同名称',
  1354. party_a varchar(255) charset utf8 null comment '签约甲方',
  1355. party_b varchar(255) charset utf8 null comment '签约乙方',
  1356. sign_time datetime null comment '签约时间',
  1357. expiration_time datetime null comment '有效截止时间',
  1358. filing_time datetime null comment '归档时间',
  1359. state varchar(255) charset utf8 null comment '说明',
  1360. pic_url varchar(255) charset utf8mb4 null comment '合同图片地址',
  1361. mgr varchar(50) charset utf8mb4 null comment '客户经理名称',
  1362. remark varchar(255) charset utf8 null comment '备注',
  1363. create_user int null comment '创建人',
  1364. create_time datetime null comment '创建时间',
  1365. update_user int null comment '修改人',
  1366. update_time datetime null comment '修改时间'
  1367. )
  1368. comment '档案-合同管理' charset = latin1
  1369. row_format = DYNAMIC;
  1370. create table wm_contract0609
  1371. (
  1372. id bigint(11) auto_increment comment '编号'
  1373. primary key,
  1374. contract_number varchar(255) null comment '合同编号',
  1375. contract_name varchar(255) charset utf8 null comment '合同名称',
  1376. sign_jia varchar(255) charset utf8 null comment '签约甲方',
  1377. sign_yi varchar(255) charset utf8 null comment '签约乙方',
  1378. sign_time datetime null comment '签约时间',
  1379. filing_time datetime null comment '归档时间',
  1380. state varchar(255) charset utf8 null comment '说明',
  1381. annex_contract varchar(500) charset utf8mb4 null comment '合同附件',
  1382. remark varchar(255) charset utf8 null comment '备注',
  1383. create_time datetime null comment '创建时间',
  1384. update_user varchar(128) charset utf8 null comment '修改人',
  1385. update_time datetime null comment '修改时间',
  1386. dept_id varchar(11) charset utf8mb4 null comment '组织机构ID'
  1387. )
  1388. comment '档案-合同管理' charset = latin1
  1389. row_format = DYNAMIC;
  1390. create table wm_da_agent
  1391. (
  1392. id int auto_increment
  1393. primary key,
  1394. gsmc varchar(50) not null comment '公司名称',
  1395. yyzz varchar(5000) null comment '营业执照',
  1396. sbjnzm varchar(5000) null comment '社保缴纳证明',
  1397. frsfzzm_zm varchar(500) null comment '法人身份证证明-正面',
  1398. frsfzzm_bm varchar(500) null comment '法人身份证证明-背面',
  1399. frsfzzm_sc varchar(500) null comment '法人身份证证明-手持',
  1400. is_examine char null comment '是否审核',
  1401. zj_type varchar(20) null comment '证件类型',
  1402. zj_number varchar(50) null comment '证件号码',
  1403. ext_drug_ent varchar(255) null comment '扩展可选药企',
  1404. dept_id varchar(11) null comment '组织机构ID',
  1405. del_flag char default '0' not null comment '是否删除',
  1406. enable_flag char default '0' not null comment '是否禁用',
  1407. tenant_id int default 1 not null comment '所属租户',
  1408. create_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '创建时间',
  1409. create_user int null comment '创建人',
  1410. update_time datetime null comment '更新时间',
  1411. update_user varchar(200) null comment '更新人',
  1412. drug_ent_id varchar(20) null comment '所属药企',
  1413. temp1 varchar(255) null,
  1414. temp2 varchar(255) null,
  1415. js_account varchar(32) null comment '结算账号 ',
  1416. management varchar(2) null comment '管理模式',
  1417. pgqx varchar(11) null comment '派工权限',
  1418. qylx varchar(11) null comment '企业类型',
  1419. subject_type varchar(1024) null,
  1420. agent_type char(2) not null,
  1421. mah_settle_dept_id int null comment 'MAH结算-药企deptId'
  1422. )
  1423. comment '档案-代理商' row_format = DYNAMIC;
  1424. create table wm_da_agent_0517
  1425. (
  1426. id int auto_increment
  1427. primary key,
  1428. gsmc varchar(50) not null comment '公司名称',
  1429. yyzz varchar(500) null comment '营业执照',
  1430. sbjnzm varchar(500) null comment '社保缴纳证明',
  1431. frsfzzm_zm varchar(500) null comment '法人身份证证明-正面',
  1432. frsfzzm_bm varchar(500) null comment '法人身份证证明-背面',
  1433. frsfzzm_sc varchar(500) null comment '法人身份证证明-手持',
  1434. is_examine char null comment '是否审核',
  1435. zj_type varchar(20) null comment '证件类型',
  1436. zj_number varchar(50) null comment '证件号码',
  1437. ext_drug_ent varchar(255) null comment '扩展可选药企',
  1438. dept_id varchar(11) null comment '组织机构ID',
  1439. del_flag char default '0' not null comment '是否删除',
  1440. enable_flag char default '0' not null comment '是否禁用',
  1441. tenant_id int default 1 not null comment '所属租户',
  1442. create_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '创建时间',
  1443. create_user int null comment '创建人',
  1444. update_time datetime null comment '更新时间',
  1445. update_user varchar(200) null comment '更新人',
  1446. drug_ent_id varchar(20) null comment '所属药企',
  1447. temp1 varchar(255) null,
  1448. temp2 varchar(255) null,
  1449. js_account varchar(32) null comment '结算账号 ',
  1450. management varchar(2) null comment '管理模式',
  1451. pgqx varchar(11) null comment '派工权限',
  1452. qylx varchar(11) null comment '企业类型',
  1453. subject_type varchar(50) null
  1454. )
  1455. comment '档案-代理商' row_format = DYNAMIC;
  1456. create table wm_da_dis_excel
  1457. (
  1458. 商业公司名称 varchar(255) null,
  1459. 商业公司地址 varchar(255) null,
  1460. f3 varchar(255) null,
  1461. 三合一社会信用代码 varchar(255) null,
  1462. GSP证书编号 varchar(255) null,
  1463. 公司注册地 varchar(255) null,
  1464. 注册资本 varchar(255) null,
  1465. 法人代表 varchar(255) null
  1466. )
  1467. row_format = DYNAMIC;
  1468. create table wm_da_distribution
  1469. (
  1470. id int auto_increment
  1471. primary key,
  1472. gsmc varchar(50) not null comment '商业公司名称',
  1473. province longtext null comment '省',
  1474. city longtext null comment '市',
  1475. area longtext null comment '区',
  1476. address varchar(255) not null comment '地址',
  1477. longitude varchar(255) null comment '经度',
  1478. latitude varchar(255) null comment '纬度',
  1479. gsgm varchar(50) null comment '公司规模',
  1480. shyshxydm varchar(20) not null comment '三合一社会信用代码',
  1481. gszcd varchar(255) not null comment '公司注册地',
  1482. zczb varchar(20) null comment '注册资本',
  1483. gspzsbh varchar(20) null comment 'GSP证书编号',
  1484. frdb varchar(20) not null comment '法人代表',
  1485. zjl varchar(20) null comment '总经理',
  1486. cjbmfzrxm varchar(20) null comment '采购部门负责人姓名',
  1487. cjbmfzrlxfs varchar(20) null comment '采购部门负责人联系方式',
  1488. cgbmdjrxm varchar(20) null comment '采购部门对接人姓名',
  1489. cgbmdjrlxfs varchar(20) null comment '采购部门对接人联系方式',
  1490. xsbmfzrxm varchar(20) null comment '销售部门负责人姓名',
  1491. xsbmfzrlxfs varchar(20) null comment '销售部门负责人联系方式',
  1492. xsbmdjrxm varchar(20) null comment '销售部门对接人姓名',
  1493. xsbmdjrlxfs varchar(20) null comment '销售部门对接人联系方式',
  1494. gsjj varchar(2048) null comment '公司简介',
  1495. jyys varchar(500) null comment '经营优势',
  1496. dept_id varchar(11) null comment '组织机构ID',
  1497. del_flag varchar(1) default '0' not null comment '是否删除',
  1498. enable_flag varchar(1) default '0' not null comment '是否禁用',
  1499. tenant_id int default 1 not null comment '所属租户',
  1500. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  1501. create_user int null comment '创建人',
  1502. update_time datetime null comment '更新时间',
  1503. update_user int null comment '更新人',
  1504. sygsdz varchar(255) null comment '商业公司地址',
  1505. medicine_traceability varchar(1) not null comment '药品信息化追溯体系(0-扫码入库,1-其他)',
  1506. medicine_traceability_other varchar(255) null comment '药品信息化追溯体系-其他(追溯体系介绍)'
  1507. )
  1508. comment '档案-配送公司' row_format = DYNAMIC;
  1509. create table wm_da_drug_ent
  1510. (
  1511. id int auto_increment
  1512. primary key,
  1513. entname varchar(50) null comment '企业名称',
  1514. entcode varchar(50) null comment '组织机构代码',
  1515. temp1 varchar(50) null,
  1516. temp2 varchar(50) null,
  1517. temp3 varchar(50) null,
  1518. temp4 varchar(50) null,
  1519. dept_id int null comment '组织机构ID',
  1520. del_flag int(1) default 0 not null comment '是否删除',
  1521. enable_flag int(1) default 0 not null comment '是否禁用',
  1522. tenant_id int default 1 not null comment '所属租户',
  1523. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  1524. create_user int null comment '创建人',
  1525. update_time datetime null comment '更新时间',
  1526. update_user int null comment '更新人',
  1527. pgqx varchar(2) null comment '派工权限',
  1528. management varchar(2) null comment '管理模式',
  1529. subject_type varchar(1024) null,
  1530. constraint code
  1531. unique (entcode)
  1532. )
  1533. comment '档案-药企' row_format = DYNAMIC;
  1534. create table wm_da_drug_ent_drugtable
  1535. (
  1536. id int auto_increment
  1537. primary key,
  1538. drugname varchar(50) null comment '药品名称',
  1539. drugname_ty varchar(255) null comment '通用药品你名称',
  1540. drug_ent_id char(11) null comment '企业ID',
  1541. is_yb char null comment '是否医保',
  1542. dose_id char(11) null comment '剂型ID',
  1543. guige_id char(11) null comment '规格ID',
  1544. remark varchar(255) null comment '备注',
  1545. dept_id int null comment '组织机构ID',
  1546. del_flag int(1) default 0 not null comment '是否删除',
  1547. enable_flag int(1) default 0 not null comment '是否禁用',
  1548. tenant_id int default 1 not null comment '所属租户',
  1549. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  1550. create_user int null comment '创建人',
  1551. update_time datetime null comment '更新时间',
  1552. update_user int null comment '更新人',
  1553. drug_ent_name varchar(255) null comment '所属药企名称',
  1554. drug_ent_num int null comment '分配统计',
  1555. ssxkcyy varchar(64) null comment '上市许可持有人',
  1556. yyfz varchar(128) null comment '原验/仿制',
  1557. dose_name varchar(128) null comment '剂型名称',
  1558. guige_name varchar(128) null comment '规格名称',
  1559. detail text null comment '详情信息(暂手动维护,用于报告)'
  1560. )
  1561. comment '档案-药企药品' row_format = DYNAMIC;
  1562. create index 剂型
  1563. on wm_da_drug_ent_drugtable (dose_id);
  1564. create index 药企外键
  1565. on wm_da_drug_ent_drugtable (drug_ent_id);
  1566. create index 规格
  1567. on wm_da_drug_ent_drugtable (guige_id);
  1568. create table wm_da_hospital
  1569. (
  1570. id int auto_increment
  1571. primary key,
  1572. yymc varchar(100) not null comment '医院名称',
  1573. province varchar(20) null comment '省',
  1574. city varchar(20) null comment '市',
  1575. area varchar(20) null comment '区',
  1576. address varchar(255) null comment '地址',
  1577. longitude varchar(255) null comment '经度',
  1578. latitude varchar(255) null comment '纬度',
  1579. yygm varchar(20) null comment '医院规模',
  1580. yyxz varchar(255) null comment '医院性质',
  1581. lxzj varchar(50) null comment '联系总机',
  1582. ggyx varchar(50) null comment '公共邮箱',
  1583. yzxm varchar(50) null comment '院长姓名',
  1584. yzlxfs varchar(20) null comment '院长联系方式',
  1585. fyzxm varchar(20) null comment '副院长姓名',
  1586. fyzlxfs varchar(20) null comment '副院长联系方式',
  1587. ywcczxm varchar(20) null comment '医务处处长姓名',
  1588. ywcczlxfs varchar(20) null comment '医务处处长联系方式',
  1589. jwcczxm varchar(20) null comment '教务处处长姓名',
  1590. jwcczlxfs varchar(20) null comment '教务处处长联系方式',
  1591. yjkzrxm varchar(20) null comment '药剂科主任姓名',
  1592. yjkzrlsfs varchar(20) null comment '药剂科主任联系方式',
  1593. ybczs varchar(10) null comment '院病床总数(张)',
  1594. zlghsy varchar(255) null comment '主流供货商业',
  1595. pspzsfry char null comment '普什品种是否入院',
  1596. pspzpssy varchar(50) null comment '普什品种配送商业',
  1597. dept_id varchar(11) null comment '组织机构ID',
  1598. website varchar(1024) null comment '医院官网',
  1599. del_flag varchar(1) default '0' not null comment '是否删除',
  1600. enable_flag varchar(1) default '0' not null comment '是否禁用',
  1601. tenant_id int default 1 not null comment '所属租户',
  1602. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  1603. create_user int null comment '创建人',
  1604. update_time datetime null comment '更新时间',
  1605. update_user int null comment '更新人',
  1606. ybczs_bak int(10) null comment '备份床位数字段历史数据'
  1607. )
  1608. comment '档案-医院' row_format = DYNAMIC;
  1609. create table wm_da_pharmacy
  1610. (
  1611. id int auto_increment
  1612. primary key,
  1613. pharmacy_name varchar(255) null comment '药店名称',
  1614. province longtext null comment '省',
  1615. city varchar(20) null comment '市',
  1616. area varchar(20) null comment '区',
  1617. address varchar(255) null comment '地址',
  1618. longitude varchar(255) null comment '经度',
  1619. latitude varchar(255) null comment '纬度',
  1620. dept_id varchar(11) null comment '组织机构ID',
  1621. del_flag varchar(1) default '0' not null comment '是否删除',
  1622. enable_flag varchar(1) default '0' not null comment '是否禁用',
  1623. tenant_id int default 1 not null comment '所属租户',
  1624. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  1625. create_user int null comment '创建人',
  1626. update_time datetime null comment '更新时间',
  1627. update_user int null comment '更新人',
  1628. pharmacy_type char(10) default 'ORDINARY' null comment '药店类型'
  1629. )
  1630. comment '药店档案' row_format = DYNAMIC;
  1631. create table wm_da_project
  1632. (
  1633. id int(50) auto_increment comment '主键id'
  1634. primary key,
  1635. project_id bigint null comment '项目id',
  1636. project_name varchar(50) charset utf8mb4 null comment '项目名称',
  1637. partya varchar(30) charset utf8mb4 null comment '项目甲方',
  1638. partyb varchar(30) charset utf8mb4 null comment '项目乙方',
  1639. sign_data datetime null comment '签订日期',
  1640. expiration_date datetime null comment '有效期截止',
  1641. project_status int(1) null comment '项目状态 2进行中 1已完成',
  1642. customer_care varchar(30) charset utf8mb4 null comment '客户维护',
  1643. remark varchar(50) charset utf8mb4 default '' null comment '说明',
  1644. contract_file varchar(500) charset utf8mb4 default '' null comment '合同附件',
  1645. contract_name varchar(30) charset utf8mb4 null comment '合同名称',
  1646. create_time datetime null comment '创建时间',
  1647. create_user int null comment '创建人',
  1648. update_time datetime null comment '更新时间',
  1649. update_user int null comment '更新人',
  1650. export1 varchar(30) charset utf8mb4 null comment '备用1',
  1651. export2 varchar(30) charset utf8mb4 null comment '备用2',
  1652. export3 varchar(30) charset utf8mb4 null comment '备用3'
  1653. )
  1654. comment '档案-项目管理' charset = utf8
  1655. row_format = DYNAMIC;
  1656. create table wm_da_track
  1657. (
  1658. id int auto_increment comment '主键id'
  1659. primary key,
  1660. trace_principal_name varchar(50) charset utf8mb4 null comment '跟踪主体名称',
  1661. trace_object_name varchar(50) charset utf8mb4 null comment '跟踪客体名称',
  1662. status int(1) null comment '状态 0进行中 1已完成',
  1663. create_time datetime null comment '创建时间',
  1664. create_user int null comment '创建人',
  1665. update_time datetime null comment '更新时间',
  1666. update_user int null comment '更新人',
  1667. project_id bigint null comment '项目id',
  1668. export1 varchar(30) charset utf8mb4 default '' null comment '备用1',
  1669. export2 varchar(30) charset utf8mb4 default '' null comment '备用2',
  1670. export3 varchar(30) charset utf8mb4 default '' null comment '备用3'
  1671. )
  1672. comment '档案-跟踪信息' charset = utf8
  1673. row_format = DYNAMIC;
  1674. create table wm_da_zb
  1675. (
  1676. 地区 varchar(255) null,
  1677. 医院编码 varchar(255) null,
  1678. 医院名称 varchar(255) null,
  1679. 医院地址 varchar(255) null,
  1680. 邮编 varchar(255) null,
  1681. 电话 varchar(255) null,
  1682. 院长 varchar(255) null,
  1683. 床位数 varchar(255) null,
  1684. 日门诊量 varchar(255) null,
  1685. 等级 varchar(255) null,
  1686. 专科 varchar(255) null,
  1687. 设备 varchar(255) null,
  1688. 网址 varchar(255) null,
  1689. 邮箱 varchar(255) null,
  1690. f15 varchar(255) null,
  1691. f16 varchar(255) null,
  1692. id int auto_increment
  1693. primary key
  1694. )
  1695. row_format = DYNAMIC;
  1696. create table wm_dept_budget
  1697. (
  1698. id int auto_increment
  1699. primary key,
  1700. dept_id int null comment '所属机构',
  1701. belong_date varchar(20) null comment '预算月份',
  1702. declare_dept varchar(255) null comment '申报机构',
  1703. budget_type varchar(2) null comment '预算类型',
  1704. budget int(20) null comment '预算值',
  1705. create_time datetime null comment '创建时间'
  1706. )
  1707. comment '预算管理' row_format = DYNAMIC;
  1708. create table wm_dept_gmv
  1709. (
  1710. id int auto_increment comment '主键id'
  1711. primary key,
  1712. dept_id int not null comment '部门ID',
  1713. year char(4) not null comment '年份',
  1714. month char(4) not null comment '月份',
  1715. gmv1 bigint not null comment '按积分值统计的GMV(单位:积分)',
  1716. gmv1_rate int not null comment 'gmv1收益率(万分之)',
  1717. gmv2 bigint not null comment '按结算额统计的GMV(单位:分)',
  1718. gmv2_rate int not null comment 'gmv2收益率(万分之)',
  1719. renlijia_service_charge_rate int null comment '人力家服务费(万分之)',
  1720. income bigint not null comment '要易收益(单位:分)',
  1721. update_time datetime default CURRENT_TIMESTAMP not null comment '修改时间'
  1722. )
  1723. comment 'GMV数据统计主表' row_format = DYNAMIC;
  1724. create table wm_dept_gmv_record
  1725. (
  1726. id int auto_increment comment 'id'
  1727. primary key,
  1728. gmv_id int not null comment 'GMV数据统计主表id',
  1729. statistics_day char(2) not null comment '统计日(1-31)',
  1730. gmv1 bigint not null comment '按积分值统计的GMV(单位:积分)',
  1731. gmv1_rate int not null comment 'gmv1收益率(万分之)',
  1732. gmv2 bigint not null comment '按结算额统计的GMV(单位:分)',
  1733. gmv2_rate int not null comment 'gmv2收益率(万分之)',
  1734. renlijia_service_charge_rate int null comment '人力家服务费(万分之)',
  1735. income bigint not null comment '要易收益(单位:分)',
  1736. update_time datetime default CURRENT_TIMESTAMP not null comment '修改时间'
  1737. )
  1738. comment 'GMV数据统计每日记录表' row_format = DYNAMIC;
  1739. create table wm_dept_regulations
  1740. (
  1741. id int auto_increment comment 'id'
  1742. primary key,
  1743. dept_id int null comment '部门id',
  1744. file_name varchar(50) not null comment '文件名称',
  1745. file_url varchar(1024) not null comment '文件地址',
  1746. sort int default 0 not null comment '排序',
  1747. del_flag char default '0' not null comment '删除标记:0(未删除),1(已删除)',
  1748. enable_flag char default '0' not null comment '是否禁用:0(启用),1(禁用)',
  1749. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  1750. update_time datetime null on update CURRENT_TIMESTAMP comment '修改时间',
  1751. constraint wm_dept_regulations_dept_id_uindex
  1752. unique (dept_id, file_name)
  1753. )
  1754. comment '企业规章制度';
  1755. create table wm_dept_task_type_config
  1756. (
  1757. id int auto_increment
  1758. primary key,
  1759. dept_id int not null comment '组织机构ID',
  1760. task_type_json text null comment '任务类型配置',
  1761. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  1762. create_user int null comment '创建人',
  1763. update_time datetime null comment '更新时间',
  1764. update_user int null comment '更新人'
  1765. )
  1766. comment '部门任务类型配置';
  1767. create table wm_dept_task_type_template
  1768. (
  1769. id int auto_increment
  1770. primary key,
  1771. dept_id int not null comment '组织机构ID',
  1772. task_type_id int null comment '任务类型id',
  1773. template varchar(64) null comment '模板',
  1774. detail json null comment '规则详情',
  1775. create_time datetime null comment '创建时间',
  1776. create_user int null comment '创建人',
  1777. update_time datetime null comment '更新时间',
  1778. update_user int null comment '更新人'
  1779. )
  1780. comment '部门任务类型模板';
  1781. create table wm_ent_rate
  1782. (
  1783. id int auto_increment,
  1784. dept_id int not null,
  1785. end_type varchar(32) not null,
  1786. subject_location varchar(32) not null comment '结算渠道',
  1787. type int not null comment '结算手续费包含;0不包含、1包含',
  1788. rate double null comment '结算渠道的服务费率',
  1789. constraint wm_ent_rate_id_uindex
  1790. unique (id)
  1791. )
  1792. comment '企业服务费率';
  1793. create table wm_ent_relation
  1794. (
  1795. id int auto_increment
  1796. primary key,
  1797. dept_id_parent int not null comment '当前企业的父级企业',
  1798. dept_id int null comment '当前企业',
  1799. dept_name varchar(32) null comment '冗余字段,用于matebase检索企业名称',
  1800. constraint wm_end_relation_id_uindex
  1801. unique (id)
  1802. )
  1803. comment '企业关联关系(仅限单层,暂不支持递归父级)';
  1804. create table wm_ent_type
  1805. (
  1806. id int auto_increment,
  1807. dept_id int not null comment '关联企业id,详见sys_dept.dept_id'
  1808. primary key,
  1809. end_type varchar(32) not null comment '企业所属类型;CSO、HCP',
  1810. constraint wm_end_type_id_uindex
  1811. unique (id)
  1812. )
  1813. comment '企业类型';
  1814. create table wm_feedback
  1815. (
  1816. id int auto_increment
  1817. primary key,
  1818. yj_userid char(11) null comment '反馈意见用户ID',
  1819. yg_content longtext null comment '反馈意见内容',
  1820. dept_id int null comment '组织机构ID',
  1821. del_flag int(1) default 0 not null comment '是否删除',
  1822. enable_flag int(1) default 0 not null comment '是否禁用',
  1823. tenant_id int default 1 not null comment '所属租户',
  1824. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  1825. create_user int null comment '创建人',
  1826. update_time datetime null comment '更新时间',
  1827. update_user int null comment '更新人'
  1828. )
  1829. comment '意见反馈' row_format = DYNAMIC;
  1830. create index 反馈人ID
  1831. on wm_feedback (yj_userid);
  1832. create table wm_import_user
  1833. (
  1834. id int auto_increment
  1835. primary key,
  1836. score_id varchar(50) not null comment '积分包ID',
  1837. import_name varchar(20) null comment '姓名',
  1838. import_phone varchar(20) null comment '手机号',
  1839. import_id_card_number varchar(18) null comment '身份证号',
  1840. user_sign varchar(255) null comment '签名',
  1841. cert_status int(2) null comment '认证状态',
  1842. cert_remark varchar(255) null comment '认证结果描述',
  1843. create_time datetime null comment '创建时间',
  1844. create_user int null comment '创建人',
  1845. del_flag char default '0' not null comment '是否删除',
  1846. real_flag char default '0' not null comment '是否禁用'
  1847. )
  1848. comment '导入任务成员表' row_format = DYNAMIC;
  1849. create table wm_payoff
  1850. (
  1851. id int auto_increment comment '主键id'
  1852. primary key,
  1853. score_name varchar(50) charset utf8mb4 null comment '积分包名称',
  1854. id_number varchar(20) charset utf8mb4 null comment '身份证号',
  1855. settle_status int(2) null comment '结算状态',
  1856. cause_failure varchar(50) charset utf8mb4 null comment '失败原因',
  1857. cert_status int(2) null comment '实名认证状态',
  1858. submitted_value varchar(50) charset utf8mb4 null comment '已提交积分值',
  1859. settle_amount decimal(30, 2) null comment '实际结算金额',
  1860. discount decimal(11, 4) null comment '折扣',
  1861. score_id varchar(50) charset utf8mb4 null comment '关联积分包id',
  1862. settle_people varchar(20) charset utf8mb4 null comment '结算人',
  1863. settle_time datetime null comment '结算时间',
  1864. statement_no varchar(64) charset utf8mb4 null comment '结算单号',
  1865. export1 varchar(20) charset utf8mb4 null comment '备用1',
  1866. export2 varchar(20) charset utf8mb4 null comment '备用2',
  1867. export3 varchar(20) charset utf8mb4 null comment '备用3'
  1868. )
  1869. comment '结算表' charset = utf8
  1870. row_format = DYNAMIC;
  1871. create table wm_pkg_quiz_rel
  1872. (
  1873. rel_id int auto_increment comment 'Id'
  1874. primary key,
  1875. pkg_id int not null comment '积分包ID',
  1876. quiz_id int null comment '试卷id',
  1877. quiz_title varchar(64) not null comment '标题',
  1878. item_qty int unsigned not null comment '试卷项数量',
  1879. total_mark int unsigned default 0 not null comment '总分',
  1880. passing_mark int unsigned default 0 not null comment '及格分',
  1881. quiz_items json null comment '试卷项',
  1882. avail tinyint(1) default 1 not null comment '可视化',
  1883. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间'
  1884. )
  1885. comment '积分包试卷表';
  1886. create table wm_project
  1887. (
  1888. id int auto_increment comment '主键id'
  1889. primary key,
  1890. dept_id int not null comment '部门id',
  1891. project_number varchar(50) not null comment '项目编号',
  1892. project_name varchar(50) not null comment '项目名称',
  1893. delegate varchar(50) not null comment '委托方',
  1894. sign_time datetime not null comment '项目签约时间',
  1895. remark varchar(128) null comment '备注',
  1896. create_time datetime null comment '创建时间',
  1897. create_user int null comment '创建人',
  1898. update_time datetime null comment '更新时间',
  1899. update_user int null comment '更新人',
  1900. constraint dept_id_project_number_unique
  1901. unique (dept_id, project_number)
  1902. )
  1903. comment '项目管理' row_format = DYNAMIC;
  1904. create table wm_project_evidence
  1905. (
  1906. id int auto_increment comment '主键id'
  1907. primary key,
  1908. project_id int not null comment '项目id',
  1909. filename varchar(64) not null comment '文件名称',
  1910. url varchar(512) not null comment '静态证据url',
  1911. type varchar(10) not null comment '文件类型',
  1912. create_time datetime null comment '创建时间',
  1913. create_user int null comment '创建人'
  1914. )
  1915. comment '项目管理-静态证据子表' row_format = DYNAMIC;
  1916. create table wm_question
  1917. (
  1918. qst_id int auto_increment comment 'Id'
  1919. primary key,
  1920. serial_num varchar(64) not null comment '序列号',
  1921. label varchar(64) not null comment '标题',
  1922. options json null comment '选项',
  1923. answer varchar(255) null comment '答案',
  1924. ent_id int unsigned not null comment '企业信息',
  1925. create_by varchar(64) not null comment '创建人',
  1926. update_by varchar(64) not null comment '修改人',
  1927. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  1928. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  1929. constraint uk_sn
  1930. unique (serial_num)
  1931. )
  1932. comment '试题表';
  1933. create index idx_eid
  1934. on wm_question (ent_id);
  1935. create table wm_quiz
  1936. (
  1937. quiz_id int auto_increment comment 'Id'
  1938. primary key,
  1939. serial_num varchar(64) not null comment '序列号',
  1940. quiz_title varchar(64) not null comment '标题',
  1941. introduction varchar(255) null comment '简介',
  1942. source_type varchar(8) not null comment '问卷来源类型',
  1943. quiz_state varchar(8) not null comment '问卷状态',
  1944. ent_id int unsigned not null comment '企业信息',
  1945. quiz_expand json null comment '试卷统计',
  1946. create_by varchar(64) not null comment '创建人',
  1947. update_by varchar(64) not null comment '修改人',
  1948. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  1949. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间',
  1950. constraint uk_sn
  1951. unique (serial_num)
  1952. )
  1953. comment '试卷表';
  1954. create index idx_eid
  1955. on wm_quiz (ent_id);
  1956. create index idx_st
  1957. on wm_quiz (source_type);
  1958. create index idx_state
  1959. on wm_quiz (quiz_state);
  1960. create table wm_quiz_item
  1961. (
  1962. item_id int auto_increment comment 'Id'
  1963. primary key,
  1964. quiz_sn varchar(64) not null comment '试卷序号',
  1965. label varchar(1024) not null comment '标题',
  1966. quiz_options json null comment '选项',
  1967. answer varchar(255) null comment '答案',
  1968. widget bigint not null comment '排序权重',
  1969. mark int default 0 not null comment '分数',
  1970. create_by varchar(64) not null comment '创建人',
  1971. update_by varchar(64) not null comment '修改人',
  1972. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  1973. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间'
  1974. )
  1975. comment '试卷项表';
  1976. create index idx_quiz_sn
  1977. on wm_quiz_item (quiz_sn);
  1978. create table wm_relation
  1979. (
  1980. up_id int not null,
  1981. down_id int not null,
  1982. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  1983. constraint wm_relation_pk
  1984. unique (up_id, down_id)
  1985. )
  1986. comment '企业关系表' row_format = DYNAMIC;
  1987. create table wm_report
  1988. (
  1989. id int auto_increment comment '主键id'
  1990. primary key,
  1991. report_no varchar(64) not null comment '报告单号',
  1992. drug_ent_id int null comment '结算企业ID',
  1993. score_id int not null comment '积分包ID',
  1994. apply_drug_ent_id int null comment '申请结算企业ID',
  1995. package_score varchar(11) null comment '积分包值',
  1996. task_number varchar(11) null comment '任务数量',
  1997. total_score varchar(11) null comment '合计分值',
  1998. report_status varchar(2) null comment '报告状态',
  1999. create_people varchar(50) null comment '创建人',
  2000. create_time datetime null comment '创建时间',
  2001. approval_people varchar(20) null comment '审核人',
  2002. approval_time datetime null comment '审核时间',
  2003. update_people varchar(20) null comment '更新人',
  2004. update_time datetime null comment '更新时间',
  2005. del_flag varchar(2) default '0' not null comment '是否删除',
  2006. export1 varchar(20) charset utf8mb4 null comment '备用1',
  2007. export2 varchar(20) charset utf8mb4 null comment '备用2',
  2008. export3 varchar(20) charset utf8mb4 null comment '备用3'
  2009. )
  2010. comment '报告审核表' charset = utf8
  2011. row_format = DYNAMIC;
  2012. create index wm_report_score_id_index
  2013. on wm_report (score_id);
  2014. create table wm_report_export_record
  2015. (
  2016. record_id int auto_increment comment '主键id'
  2017. primary key,
  2018. report_no varchar(64) not null comment '报告单号',
  2019. report_title varchar(128) not null comment '报告名称',
  2020. dept_id int null comment '结算企业ID',
  2021. export_status varchar(2) null comment '报告状态',
  2022. oss_url varchar(255) null comment '报告地址',
  2023. created_by varchar(50) null comment '创建人',
  2024. created_time datetime null comment '创建时间',
  2025. finish_time datetime null comment '完成时间'
  2026. )
  2027. comment '报告审核表' charset = utf8;
  2028. create table wm_score_package
  2029. (
  2030. id int auto_increment
  2031. primary key,
  2032. task_rule_id varchar(11) null comment '规则ID',
  2033. drug_ent_id varchar(11) null,
  2034. score_id varchar(50) null,
  2035. score_name varchar(255) null comment '积分包名称',
  2036. score varchar(11) null,
  2037. agent_type_id varchar(1) null,
  2038. level1_id varchar(11) null comment '一级代理商',
  2039. level2_id varchar(11) null comment '二级代理商',
  2040. zb_id varchar(11) null comment '众包ID',
  2041. xxdb_id varchar(11) null comment '销售代表ID',
  2042. typeid varchar(11) null comment '分配对象类型',
  2043. package_status varchar(11) null comment '积分包状态',
  2044. package_finish_status varchar(2) null comment '积分包完成状态',
  2045. package_audit_status varchar(2) null comment '积分包审核状态',
  2046. send_package_dept_id varchar(11) null comment '发包方ID',
  2047. dept_id varchar(11) null comment '组织机构ID',
  2048. del_flag char default '0' not null comment '是否删除',
  2049. enable_flag char default '0' not null comment '是否禁用',
  2050. tenant_id int default 1 not null comment '所属租户',
  2051. create_time datetime null comment '创建时间',
  2052. create_user int null comment '创建人',
  2053. update_time datetime null comment '更新时间',
  2054. update_user int null comment '更新人',
  2055. ytj int null,
  2056. ysh int null,
  2057. dsh int null,
  2058. ytjtt int null,
  2059. ywctt int null,
  2060. yshtt int null,
  2061. receive_date datetime null comment '领取时间',
  2062. is_conduct varchar(1) null comment '是否进行中',
  2063. drugs_ids varchar(255) null,
  2064. statement_no varchar(64) null comment '结算单号',
  2065. settle_status int(2) null comment '结算状态',
  2066. remark varchar(255) null comment '结算结果描述',
  2067. invoice_category varchar(50) null comment '发票类目',
  2068. settle_amount decimal(30, 2) null comment '实际结算金额',
  2069. discount decimal(11, 4) null comment '折扣',
  2070. package_finish_time datetime null comment '完成时间',
  2071. relation_score_id varchar(11) null comment '关联积分包id',
  2072. package_type1 varchar(11) null comment '积分包任务类型1',
  2073. package_type2 varchar(11) null comment '积分包任务类型2',
  2074. user_num int null comment '需求人数',
  2075. task_num int null comment '任务个数',
  2076. package_user_scope varchar(11) null comment '接单对象范围',
  2077. kfpjf int(30) null comment '可分配积分',
  2078. belong_date varchar(20) null comment '所属月份',
  2079. allocation_date datetime null comment '分配日期',
  2080. pay_rate decimal(20, 2) null comment '已支付百分比',
  2081. finish_rate decimal(20, 2) null comment '已完成百分比',
  2082. pay_score varchar(11) null comment '已支付积分值',
  2083. end_label_date varchar(64) null comment '查询结束日期',
  2084. score_package_name varchar(255) null comment '积分包名称',
  2085. related_service varchar(11) null comment '关联服务企业',
  2086. package_is_conduct varchar(1) null comment '积分包是否进行中',
  2087. description varchar(255) null comment '描述',
  2088. user_score varchar(11) null comment '个人预计包值',
  2089. enable_type char default '0' null comment '终止方式',
  2090. is_receive varchar(1) null comment '是否允许接单',
  2091. rule_id varchar(50) null comment '规则id',
  2092. accept_sug varchar(20) default '' null comment '接包对象',
  2093. task_add_flag varchar(1) default '1' null comment '是否可以新增任务1-可以 0-不可以',
  2094. settle_flag char default '0' null comment '结算状态',
  2095. score_package_status varchar(11) null comment '积分包状态',
  2096. old_package char(2) default '0' null comment '是否为旧数据',
  2097. settlement_date datetime null comment '结算时间',
  2098. source_type char default '0' null comment '数据来源类型(0:手动上传,1:系统对接)',
  2099. project_num varchar(50) null comment '项目编号',
  2100. drug_producer varchar(512) null comment '关联药品生产厂商名称',
  2101. p2p_amount decimal(11, 2) null,
  2102. p2p_time datetime null comment '公对公提交时间',
  2103. oms_order_sn varchar(64) null comment '订单号',
  2104. sub_type varchar(2) null comment '结算渠道',
  2105. sub_location varchar(64) null comment '税源地',
  2106. p2p_service_amount decimal(11, 2) default 0.00 null comment '公对公服务费',
  2107. pkg_sn varchar(32) null comment '积分包编号',
  2108. mah_settle_dept_id int null comment 'MAH结算-药企deptId',
  2109. mah_settle_step char(8) null comment 'MAH结算-步进状态(BUSINESS-业务, FINANCE-财务)',
  2110. mah_settle_time datetime null comment 'mah结算时间',
  2111. ent_task_limit decimal(5, 2) default 0.00 null comment '企业任务上限(单位%)',
  2112. drugtable varchar(255) null comment '推广药品id',
  2113. invoice_number varchar(64) null comment '发票号码',
  2114. invoice_file json null comment '发票文件',
  2115. audit_management_fee_rates decimal(5, 2) default 0.00 not null comment '审核管理费比例',
  2116. end_time date null comment '截止日期'
  2117. )
  2118. comment '积分包' row_format = DYNAMIC;
  2119. create index wm_score_package_accept_sug_index
  2120. on wm_score_package (accept_sug);
  2121. create index wm_score_package_mah_settle_dept_id_index
  2122. on wm_score_package (mah_settle_dept_id);
  2123. create index wm_score_package_relation_score_id_index
  2124. on wm_score_package (relation_score_id);
  2125. create index wm_score_package_send_dept_id_index
  2126. on wm_score_package (send_package_dept_id);
  2127. create index 一级代理商1
  2128. on wm_score_package (level1_id);
  2129. create index 二级代理商2
  2130. on wm_score_package (level2_id);
  2131. create index 代理商
  2132. on wm_score_package (agent_type_id);
  2133. create index 代理商类型
  2134. on wm_score_package (drug_ent_id);
  2135. create index 众包
  2136. on wm_score_package (zb_id);
  2137. create table wm_score_package_0226
  2138. (
  2139. id int auto_increment
  2140. primary key,
  2141. task_rule_id varchar(11) null comment '规则ID',
  2142. drug_ent_id varchar(11) null,
  2143. score_id varchar(50) null,
  2144. score_name varchar(255) null comment '积分包名称',
  2145. score varchar(11) null,
  2146. agent_type_id varchar(1) null,
  2147. level1_id varchar(11) null comment '一级代理商',
  2148. level2_id varchar(11) null comment '二级代理商',
  2149. zb_id varchar(11) null comment '众包ID',
  2150. xxdb_id varchar(11) null comment '销售代表ID',
  2151. typeid varchar(11) null comment '分配对象类型',
  2152. package_status varchar(11) null comment '积分包状态',
  2153. package_finish_status varchar(2) null comment '积分包完成状态',
  2154. package_audit_status varchar(2) null comment '积分包审核状态',
  2155. send_package_dept_id varchar(11) null comment '发包方ID',
  2156. dept_id varchar(11) null comment '组织机构ID',
  2157. del_flag char default '0' not null comment '是否删除',
  2158. enable_flag char default '0' not null comment '是否禁用',
  2159. tenant_id int default 1 not null comment '所属租户',
  2160. create_time datetime null comment '创建时间',
  2161. create_user int null comment '创建人',
  2162. update_time datetime null comment '更新时间',
  2163. update_user int null comment '更新人',
  2164. ytj int null,
  2165. ysh int null,
  2166. dsh int null,
  2167. ytjtt int null,
  2168. ywctt int null,
  2169. yshtt int null,
  2170. receive_date datetime null comment '领取时间',
  2171. is_conduct varchar(1) null comment '是否进行中',
  2172. drugs_ids varchar(255) null,
  2173. statement_no varchar(64) null comment '结算单号',
  2174. settle_status int(2) null comment '结算状态',
  2175. remark varchar(255) null comment '结算结果描述',
  2176. invoice_category varchar(50) null comment '发票类目',
  2177. settle_amount decimal(30, 2) null comment '实际结算金额',
  2178. discount decimal(11, 4) null comment '折扣',
  2179. package_finish_time datetime null comment '完成时间',
  2180. relation_score_id varchar(11) null comment '关联积分包id',
  2181. package_type1 varchar(11) null comment '积分包任务类型1',
  2182. package_type2 varchar(11) null comment '积分包任务类型2',
  2183. user_num int null comment '需求人数',
  2184. task_num int null comment '任务个数',
  2185. package_user_scope varchar(11) null comment '接单对象范围',
  2186. kfpjf int(30) null comment '可分配积分',
  2187. belong_date varchar(20) null comment '所属月份',
  2188. allocation_date datetime null comment '分配日期',
  2189. pay_rate decimal(20, 2) null comment '已支付百分比',
  2190. finish_rate decimal(20, 2) null comment '已完成百分比',
  2191. pay_score varchar(11) null comment '已支付积分值',
  2192. end_label_date varchar(64) null comment '查询结束日期',
  2193. score_package_name varchar(255) null comment '积分包名称',
  2194. related_service varchar(11) null comment '关联服务企业',
  2195. package_is_conduct varchar(1) null comment '积分包是否进行中',
  2196. description varchar(255) null comment '描述',
  2197. user_score varchar(11) null comment '个人预计包值',
  2198. enable_type char default '0' null comment '终止方式',
  2199. is_receive varchar(1) null comment '是否允许接单',
  2200. rule_id varchar(50) null comment '规则id',
  2201. accept_sug varchar(20) default '' null comment '接包对象',
  2202. task_add_flag varchar(1) default '1' null comment '是否可以新增任务1-可以 0-不可以',
  2203. settle_flag char default '0' null comment '结算状态',
  2204. score_package_status varchar(11) null comment '积分包状态',
  2205. old_package char(2) default '0' null comment '是否为旧数据'
  2206. )
  2207. comment '积分包' row_format = DYNAMIC;
  2208. create index 一级代理商1
  2209. on wm_score_package_0226 (level1_id);
  2210. create index 二级代理商2
  2211. on wm_score_package_0226 (level2_id);
  2212. create index 代理商
  2213. on wm_score_package_0226 (agent_type_id);
  2214. create index 代理商类型
  2215. on wm_score_package_0226 (drug_ent_id);
  2216. create index 众包
  2217. on wm_score_package_0226 (zb_id);
  2218. create table wm_score_package_0517
  2219. (
  2220. id int auto_increment
  2221. primary key,
  2222. task_rule_id varchar(11) null comment '规则ID',
  2223. drug_ent_id varchar(11) null,
  2224. score_id varchar(50) null,
  2225. score_name varchar(255) null comment '积分包名称',
  2226. score varchar(11) null,
  2227. agent_type_id varchar(1) null,
  2228. level1_id varchar(11) null comment '一级代理商',
  2229. level2_id varchar(11) null comment '二级代理商',
  2230. zb_id varchar(11) null comment '众包ID',
  2231. xxdb_id varchar(11) null comment '销售代表ID',
  2232. typeid varchar(11) null comment '分配对象类型',
  2233. package_status varchar(11) null comment '积分包状态',
  2234. package_finish_status varchar(2) null comment '积分包完成状态',
  2235. package_audit_status varchar(2) null comment '积分包审核状态',
  2236. send_package_dept_id varchar(11) null comment '发包方ID',
  2237. dept_id varchar(11) null comment '组织机构ID',
  2238. del_flag char default '0' not null comment '是否删除',
  2239. enable_flag char default '0' not null comment '是否禁用',
  2240. tenant_id int default 1 not null comment '所属租户',
  2241. create_time datetime null comment '创建时间',
  2242. create_user int null comment '创建人',
  2243. update_time datetime null comment '更新时间',
  2244. update_user int null comment '更新人',
  2245. ytj int null,
  2246. ysh int null,
  2247. dsh int null,
  2248. ytjtt int null,
  2249. ywctt int null,
  2250. yshtt int null,
  2251. receive_date datetime null comment '领取时间',
  2252. is_conduct varchar(1) null comment '是否进行中',
  2253. drugs_ids varchar(255) null,
  2254. statement_no varchar(64) null comment '结算单号',
  2255. settle_status int(2) null comment '结算状态',
  2256. remark varchar(255) null comment '结算结果描述',
  2257. invoice_category varchar(50) null comment '发票类目',
  2258. settle_amount decimal(30, 2) null comment '实际结算金额',
  2259. discount decimal(11, 4) null comment '折扣',
  2260. package_finish_time datetime null comment '完成时间',
  2261. relation_score_id varchar(11) null comment '关联积分包id',
  2262. package_type1 varchar(11) null comment '积分包任务类型1',
  2263. package_type2 varchar(11) null comment '积分包任务类型2',
  2264. user_num int null comment '需求人数',
  2265. task_num int null comment '任务个数',
  2266. package_user_scope varchar(11) null comment '接单对象范围',
  2267. kfpjf int(30) null comment '可分配积分',
  2268. belong_date varchar(20) null comment '所属月份',
  2269. allocation_date datetime null comment '分配日期',
  2270. pay_rate decimal(20, 2) null comment '已支付百分比',
  2271. finish_rate decimal(20, 2) null comment '已完成百分比',
  2272. pay_score varchar(11) null comment '已支付积分值',
  2273. end_label_date varchar(64) null comment '查询结束日期',
  2274. score_package_name varchar(255) null comment '积分包名称',
  2275. related_service varchar(11) null comment '关联服务企业',
  2276. package_is_conduct varchar(1) null comment '积分包是否进行中',
  2277. description varchar(255) null comment '描述',
  2278. user_score varchar(11) null comment '个人预计包值',
  2279. enable_type char default '0' null comment '终止方式',
  2280. is_receive varchar(1) null comment '是否允许接单',
  2281. rule_id varchar(50) null comment '规则id',
  2282. accept_sug varchar(20) default '' null comment '接包对象',
  2283. task_add_flag varchar(1) default '1' null comment '是否可以新增任务1-可以 0-不可以',
  2284. settle_flag char default '0' null comment '结算状态',
  2285. score_package_status varchar(11) null comment '积分包状态',
  2286. old_package char(2) default '0' null comment '是否为旧数据',
  2287. settlement_date datetime null comment '结算时间'
  2288. )
  2289. comment '积分包' row_format = DYNAMIC;
  2290. create index 一级代理商1
  2291. on wm_score_package_0517 (level1_id);
  2292. create index 二级代理商2
  2293. on wm_score_package_0517 (level2_id);
  2294. create index 代理商
  2295. on wm_score_package_0517 (agent_type_id);
  2296. create index 代理商类型
  2297. on wm_score_package_0517 (drug_ent_id);
  2298. create index 众包
  2299. on wm_score_package_0517 (zb_id);
  2300. create table wm_score_package_settle_note
  2301. (
  2302. id int auto_increment
  2303. primary key,
  2304. package_status_id varchar(20) null,
  2305. package_id varchar(20) null,
  2306. settle_amount decimal(10, 2) null,
  2307. user_id varchar(20) null,
  2308. invoice_type int(20) null,
  2309. settle_no varchar(128) null,
  2310. discount decimal(10, 2) null,
  2311. settle_note_status int(2) default 0 null,
  2312. remark text null,
  2313. notify_time datetime null,
  2314. task_id varchar(20) null comment '任务ID',
  2315. category_name varchar(128) null comment '开票类型名称',
  2316. create_time datetime null comment '创建时间',
  2317. sub_time datetime null comment '提交时间',
  2318. update_time datetime null comment '更新时间',
  2319. stream_id varchar(50) null comment '税邦云流水号',
  2320. id_card_number varchar(20) null comment '身份证号',
  2321. sub_to_gig_time datetime null comment '提交到零工平台时间',
  2322. sub_type varchar(2) null comment '结算类型',
  2323. subject_location varchar(64) null comment '税源地',
  2324. third_task_id varchar(20) null comment '第三方任务id',
  2325. finish_task_flag int default 0 null comment '是否完成完单操作',
  2326. actual_amount decimal(18, 2) null,
  2327. settle_dept_id int null comment '实际结算企业id',
  2328. settle_dept_sub_id int null comment '实际结算企业subId',
  2329. review_status char(20) null comment '财务复核状态',
  2330. review_time datetime null comment '复核时间',
  2331. review_user int null comment '复核人'
  2332. )
  2333. charset = utf8
  2334. row_format = DYNAMIC;
  2335. create table wm_score_package_settle_note_0510
  2336. (
  2337. id int auto_increment
  2338. primary key,
  2339. package_status_id varchar(20) null,
  2340. package_id varchar(20) null,
  2341. settle_amount decimal(10, 2) null,
  2342. user_id varchar(20) null,
  2343. invoice_type int(20) null,
  2344. settle_no varchar(128) null,
  2345. discount decimal(10, 2) null,
  2346. settle_note_status int(2) default 0 null,
  2347. remark varchar(256) null,
  2348. notify_time timestamp default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  2349. )
  2350. charset = utf8
  2351. row_format = DYNAMIC;
  2352. create table wm_score_package_settle_note_0517
  2353. (
  2354. id int auto_increment
  2355. primary key,
  2356. package_status_id varchar(20) null,
  2357. package_id varchar(20) null,
  2358. settle_amount decimal(10, 2) null,
  2359. user_id varchar(20) null,
  2360. invoice_type int(20) null,
  2361. settle_no varchar(128) null,
  2362. discount decimal(10, 2) null,
  2363. settle_note_status int(2) default 0 null,
  2364. remark varchar(256) null,
  2365. notify_time timestamp default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP
  2366. )
  2367. charset = utf8
  2368. row_format = DYNAMIC;
  2369. create table wm_score_package_settle_note_111
  2370. (
  2371. id int auto_increment
  2372. primary key,
  2373. package_status_id varchar(20) null,
  2374. package_id varchar(20) null,
  2375. settle_amount decimal(10, 2) null,
  2376. user_id varchar(20) null,
  2377. invoice_type int(20) null,
  2378. settle_no varchar(128) null,
  2379. discount decimal(10, 2) null,
  2380. settle_note_status int(2) default 0 null,
  2381. remark varchar(256) null,
  2382. notify_time timestamp null,
  2383. task_id varchar(20) null comment '任务ID',
  2384. category_name varchar(128) null comment '开票类型名称',
  2385. create_time datetime null comment '创建时间',
  2386. sub_time datetime null comment '提交时间',
  2387. update_time datetime null comment '更新时间',
  2388. stream_id varchar(50) null comment '税邦云流水号',
  2389. id_card_number varchar(20) null comment '身份证号',
  2390. sub_type varchar(2) null comment '结算类型'
  2391. )
  2392. charset = utf8
  2393. row_format = DYNAMIC;
  2394. create table wm_score_package_settle_note_20220113
  2395. (
  2396. id int null,
  2397. package_status_id varchar(20) null,
  2398. package_id varchar(20) null,
  2399. settle_amount decimal(10, 2) null,
  2400. user_id varchar(20) null,
  2401. invoice_type int null,
  2402. settle_no varchar(128) null,
  2403. discount decimal(10, 2) null,
  2404. settle_note_status int null,
  2405. remark varchar(256) null,
  2406. notify_time datetime null,
  2407. task_id varchar(20) null,
  2408. category_name varchar(128) null,
  2409. create_time datetime null,
  2410. sub_time datetime null,
  2411. update_time datetime null,
  2412. stream_id varchar(50) null,
  2413. id_card_number varchar(20) null,
  2414. sub_type varchar(2) null,
  2415. sub_to_gig_time datetime null
  2416. )
  2417. comment '税邦云回调数据异常,数据回滚前备份';
  2418. create table wm_score_package_status
  2419. (
  2420. id int auto_increment
  2421. primary key,
  2422. user_id varchar(11) null comment '用户id',
  2423. package_id varchar(11) null comment '积分包id',
  2424. status varchar(11) null comment '审核状态:1.审核中,2.审核通过,3.审核不通过',
  2425. dept_id varchar(11) null comment '组织机构ID',
  2426. del_flag char default '0' not null comment '是否删除',
  2427. enable_flag char default '0' not null comment '是否禁用',
  2428. tenant_id int default 1 not null comment '所属租户',
  2429. create_time datetime null comment '创建时间',
  2430. create_user int null comment '创建人',
  2431. update_time datetime null comment '更新时间',
  2432. update_user int null comment '更新人',
  2433. user_score varchar(11) null comment '个人预计包值',
  2434. enable_type char default '0' null comment '终止方式',
  2435. task_num int null comment '个人包任务个数',
  2436. task_add_flag varchar(1) default '1' null comment '是否可以新增任务1-可以 0-不可以',
  2437. quiz_res json null comment '测评结果'
  2438. )
  2439. comment '积分包状态' row_format = DYNAMIC;
  2440. create table wm_score_package_status_0226
  2441. (
  2442. id int auto_increment
  2443. primary key,
  2444. user_id varchar(11) null,
  2445. package_id varchar(11) null,
  2446. status varchar(11) null,
  2447. dept_id varchar(11) null comment '组织机构ID',
  2448. del_flag char default '0' not null comment '是否删除',
  2449. enable_flag char default '0' not null comment '是否禁用',
  2450. tenant_id int default 1 not null comment '所属租户',
  2451. create_time datetime null comment '创建时间',
  2452. create_user int null comment '创建人',
  2453. update_time datetime null comment '更新时间',
  2454. update_user int null comment '更新人',
  2455. user_score varchar(11) null comment '个人预计包值',
  2456. enable_type char default '0' null comment '终止方式',
  2457. task_num int null comment '个人包任务个数',
  2458. task_add_flag varchar(1) default '1' null comment '是否可以新增任务1-可以 0-不可以'
  2459. )
  2460. comment '积分包状态' row_format = DYNAMIC;
  2461. create table wm_score_package_task_ref
  2462. (
  2463. id int not null
  2464. primary key,
  2465. task_id varchar(11) null comment '任务ID',
  2466. task_package_id varchar(11) null comment '任务所属积分包ID',
  2467. user_id varchar(11) null comment '医药代表ID',
  2468. status varchar(11) null comment '任务状态',
  2469. dept_id varchar(11) null comment '组织机构ID',
  2470. del_flag char default '0' not null comment '是否删除',
  2471. enable_flag char default '0' not null comment '是否禁用',
  2472. tenant_id int default 1 not null comment '所属租户',
  2473. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  2474. create_user int null comment '创建人',
  2475. update_time datetime null comment '更新时间',
  2476. update_user int null comment '更新人'
  2477. )
  2478. comment '任务-积分包关联' row_format = DYNAMIC;
  2479. create index package1
  2480. on wm_score_package_task_ref (task_package_id);
  2481. create index rw1
  2482. on wm_score_package_task_ref (task_id);
  2483. create index user11
  2484. on wm_score_package_task_ref (user_id);
  2485. create table wm_score_task_type
  2486. (
  2487. id bigint auto_increment comment '主键id'
  2488. primary key,
  2489. score_id varchar(20) charset utf8mb4 null comment '关联积分包id',
  2490. task_type_id varchar(11) charset utf8mb4 null comment '有效任务类型id',
  2491. type varchar(255) charset utf8mb4 null comment '积分包类型,1:定额,2定量'
  2492. )
  2493. comment '积分包任务类型表' charset = utf8
  2494. row_format = DYNAMIC;
  2495. create table wm_settle_account_receive
  2496. (
  2497. id int auto_increment
  2498. primary key,
  2499. account_name varchar(255) null,
  2500. account_no varchar(255) null,
  2501. op_type varchar(255) null,
  2502. amount varchar(255) null,
  2503. bank_serial_no varchar(255) null,
  2504. explore1 varchar(255) null,
  2505. explore2 varchar(255) null,
  2506. explore3 varchar(255) null,
  2507. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '更新时间'
  2508. )
  2509. charset = utf8
  2510. row_format = DYNAMIC;
  2511. create table wm_task
  2512. (
  2513. id int auto_increment
  2514. primary key,
  2515. task_number varchar(32) null comment '任务编号',
  2516. task_rule_id varchar(11) null comment '积分规则',
  2517. score int(5) null comment '积分值',
  2518. score_package_drug_id varchar(11) null comment '任务提交到的积分包ID',
  2519. score_package_level1_id varchar(11) null comment '任务提交到一级经销商的集分宝id',
  2520. score_package_id varchar(11) null comment '积分包',
  2521. task_type_id varchar(11) null comment '任务类型ID',
  2522. lookinto_date datetime null comment '调研时间',
  2523. province varchar(20) null comment '省',
  2524. city varchar(20) null comment '市',
  2525. area varchar(20) null comment '区',
  2526. address varchar(255) null comment '地址',
  2527. lookinto_type_id varchar(11) null comment '调研类型ID',
  2528. task_content_id varchar(11) null comment '任务内容ID',
  2529. task_status char(2) null comment '任务状态',
  2530. task_user_id varchar(11) null comment '任务用户ID',
  2531. task_user_type varchar(11) null comment '用户类型ID',
  2532. drug_ent_id varchar(11) null comment '服务药企',
  2533. dept_id varchar(11) null comment '组织机构ID',
  2534. del_flag char default '0' not null comment '是否删除',
  2535. enable_flag char default '0' not null comment '是否禁用',
  2536. tenant_id int default 1 not null comment '所属租户',
  2537. create_time datetime null comment '创建时间',
  2538. create_user int null comment '创建人',
  2539. update_time datetime null comment '更新时间',
  2540. update_user int null comment '更新人',
  2541. submit_status varchar(2) null comment '提交状态',
  2542. share_img_url varchar(255) null comment '分享图片地址',
  2543. plat_audit_status char(2) default '0' null comment '平台审核状态',
  2544. ext_ids varchar(255) null comment '备用字段',
  2545. task_info_img varchar(255) null comment '任务详情图片',
  2546. compare_result varchar(2) null comment '对比结果',
  2547. approval_opinion varchar(2) null comment '审批意见',
  2548. approval_info varchar(500) null comment '审批说明',
  2549. real_flag char(2) default '0' null comment '是否真实',
  2550. report_one_id int null comment '任务提交到一级cso的报告ID',
  2551. report_one_approval_status varchar(32) default '0' null comment '任务提交到一级cso的报告审核状态',
  2552. report_one_approval_opinion varchar(2) null comment '任务提交到一级cso的报告审批意见',
  2553. report_one_approval_info varchar(1024) null comment '任务提交到一级cso的报告审批说明',
  2554. report_second_id int null comment '任务提交到二级cso的报告ID',
  2555. report_second_approval_status varchar(32) default '0' null comment '任务提交到二级cso的报告审核状态',
  2556. report_second_approval_opinion varchar(2) null comment '任务提交到二级cso的报告审批意见',
  2557. report_second_approval_info varchar(1024) null comment '任务提交到二级cso的报告审批说明',
  2558. report_drug_id int null comment '任务提交到药企的报告ID',
  2559. report_drug_approval_status varchar(32) default '0' null comment '任务提交到药企的报告审核状态',
  2560. report_drug_approval_opinion varchar(2) null comment '任务提交到药企的报告审批意见',
  2561. report_drug_approval_info varchar(1024) null comment '任务提交到药企的报告审批说明',
  2562. task_status_info varchar(500) null comment 'cso审核审核意见',
  2563. task_from varchar(2) default '1' null comment '来源',
  2564. task_settle_status int null comment '任务结算状态',
  2565. review_task_count int default 0 not null comment '复审次数记录',
  2566. dept_review_task_count int default 0 not null comment '企业复审次数记录',
  2567. approval_user_id int null comment '审核人userId',
  2568. approval_time datetime null comment '审核时间',
  2569. dept_approval_user_id int null comment '企业审核人userId',
  2570. dept_approval_time datetime null comment '企业审核时间',
  2571. remote_ip varchar(255) null comment '远端ip',
  2572. ip2region varchar(255) null comment '地址'
  2573. )
  2574. comment '任务表' row_format = DYNAMIC;
  2575. create index sp_ts_rf_index
  2576. on wm_task (score_package_id, real_flag, task_status);
  2577. create index wm_task_report_drug_id_index
  2578. on wm_task (report_drug_id);
  2579. create index wm_task_report_one_id_index
  2580. on wm_task (report_one_id);
  2581. create index wm_task_report_second_id_index
  2582. on wm_task (report_second_id);
  2583. create index wm_task_score_package_id_index
  2584. on wm_task (score_package_id);
  2585. create index wm_task_user_id_index
  2586. on wm_task (task_user_id);
  2587. create index 任务内容
  2588. on wm_task (task_content_id);
  2589. create index 任务类型task
  2590. on wm_task (task_type_id);
  2591. create index 调研类型
  2592. on wm_task (lookinto_type_id);
  2593. create table wm_task_0514
  2594. (
  2595. id int auto_increment
  2596. primary key,
  2597. task_rule_id varchar(11) null comment '积分规则',
  2598. score int(5) null comment '积分值',
  2599. score_package_drug_id varchar(11) null comment '任务提交到的积分包ID',
  2600. score_package_level1_id varchar(11) null comment '任务提交到一级经销商的集分宝id',
  2601. score_package_id varchar(11) null comment '积分包',
  2602. task_type_id varchar(11) null comment '任务类型ID',
  2603. lookinto_date datetime null comment '调研时间',
  2604. province varchar(20) null comment '省',
  2605. city varchar(20) null comment '市',
  2606. area varchar(20) null comment '区',
  2607. address varchar(255) null comment '地址',
  2608. lookinto_type_id varchar(11) null comment '调研类型ID',
  2609. task_content_id varchar(11) null comment '任务内容ID',
  2610. task_status char(2) null comment '任务状态',
  2611. task_user_id varchar(11) null comment '任务用户ID',
  2612. task_user_type varchar(11) null comment '用户类型ID',
  2613. drug_ent_id varchar(11) null comment '服务药企',
  2614. dept_id varchar(11) null comment '组织机构ID',
  2615. del_flag char default '0' not null comment '是否删除',
  2616. enable_flag char default '0' not null comment '是否禁用',
  2617. tenant_id int default 1 not null comment '所属租户',
  2618. create_time datetime null comment '创建时间',
  2619. create_user int null comment '创建人',
  2620. update_time datetime null comment '更新时间',
  2621. update_user int null comment '更新人',
  2622. submit_status varchar(2) null comment '提交状态',
  2623. share_img_url varchar(255) null comment '分享图片地址',
  2624. plat_audit_status char(2) default '0' null comment '平台审核状态',
  2625. ext_ids varchar(255) null comment '备用字段',
  2626. task_info_img varchar(255) null comment '任务详情图片',
  2627. compare_result varchar(2) null comment '对比结果',
  2628. approval_opinion varchar(2) null comment '审批意见',
  2629. approval_info varchar(500) null comment '审批说明',
  2630. real_flag char(2) default '0' null comment '是否真实',
  2631. report_one_id int null comment '任务提交到一级cso的报告ID',
  2632. report_one_approval_status varchar(32) default '0' null comment '任务提交到一级cso的报告审核状态',
  2633. report_one_approval_opinion varchar(2) null comment '任务提交到一级cso的报告审批意见',
  2634. report_one_approval_info varchar(50) null comment '任务提交到一级cso的报告审批说明',
  2635. report_second_id int null comment '任务提交到二级cso的报告ID',
  2636. report_second_approval_status varchar(32) default '0' null comment '任务提交到二级cso的报告审核状态',
  2637. report_second_approval_opinion varchar(2) null comment '任务提交到二级cso的报告审批意见',
  2638. report_second_approval_info varchar(50) null comment '任务提交到二级cso的报告审批说明',
  2639. report_drug_id int null comment '任务提交到药企的报告ID',
  2640. report_drug_approval_status varchar(32) default '0' null comment '任务提交到药企的报告审核状态',
  2641. report_drug_approval_opinion varchar(2) null comment '任务提交到药企的报告审批意见',
  2642. report_drug_approval_info varchar(50) null comment '任务提交到药企的报告审批说明',
  2643. task_status_info varchar(500) null comment 'cso审核审核意见',
  2644. task_from varchar(2) default '1' null comment '来源'
  2645. )
  2646. comment '任务表' row_format = DYNAMIC;
  2647. create index 任务内容
  2648. on wm_task_0514 (task_content_id);
  2649. create index 任务类型task
  2650. on wm_task_0514 (task_type_id);
  2651. create index 调研类型
  2652. on wm_task_0514 (lookinto_type_id);
  2653. create table wm_task_0518
  2654. (
  2655. id int auto_increment
  2656. primary key,
  2657. task_rule_id varchar(11) null comment '积分规则',
  2658. score int(5) null comment '积分值',
  2659. score_package_drug_id varchar(11) null comment '任务提交到的积分包ID',
  2660. score_package_level1_id varchar(11) null comment '任务提交到一级经销商的集分宝id',
  2661. score_package_id varchar(11) null comment '积分包',
  2662. task_type_id varchar(11) null comment '任务类型ID',
  2663. lookinto_date datetime null comment '调研时间',
  2664. province varchar(20) null comment '省',
  2665. city varchar(20) null comment '市',
  2666. area varchar(20) null comment '区',
  2667. address varchar(255) null comment '地址',
  2668. lookinto_type_id varchar(11) null comment '调研类型ID',
  2669. task_content_id varchar(11) null comment '任务内容ID',
  2670. task_status char(2) null comment '任务状态',
  2671. task_user_id varchar(11) null comment '任务用户ID',
  2672. task_user_type varchar(11) null comment '用户类型ID',
  2673. drug_ent_id varchar(11) null comment '服务药企',
  2674. dept_id varchar(11) null comment '组织机构ID',
  2675. del_flag char default '0' not null comment '是否删除',
  2676. enable_flag char default '0' not null comment '是否禁用',
  2677. tenant_id int default 1 not null comment '所属租户',
  2678. create_time datetime null comment '创建时间',
  2679. create_user int null comment '创建人',
  2680. update_time datetime null comment '更新时间',
  2681. update_user int null comment '更新人',
  2682. submit_status varchar(2) null comment '提交状态',
  2683. share_img_url varchar(255) null comment '分享图片地址',
  2684. plat_audit_status char(2) default '0' null comment '平台审核状态',
  2685. ext_ids varchar(255) null comment '备用字段',
  2686. task_info_img varchar(255) null comment '任务详情图片',
  2687. compare_result varchar(2) null comment '对比结果',
  2688. approval_opinion varchar(2) null comment '审批意见',
  2689. approval_info varchar(500) null comment '审批说明',
  2690. real_flag char(2) default '0' null comment '是否真实',
  2691. report_one_id int null comment '任务提交到一级cso的报告ID',
  2692. report_one_approval_status varchar(32) default '0' null comment '任务提交到一级cso的报告审核状态',
  2693. report_one_approval_opinion varchar(2) null comment '任务提交到一级cso的报告审批意见',
  2694. report_one_approval_info varchar(50) null comment '任务提交到一级cso的报告审批说明',
  2695. report_second_id int null comment '任务提交到二级cso的报告ID',
  2696. report_second_approval_status varchar(32) default '0' null comment '任务提交到二级cso的报告审核状态',
  2697. report_second_approval_opinion varchar(2) null comment '任务提交到二级cso的报告审批意见',
  2698. report_second_approval_info varchar(50) null comment '任务提交到二级cso的报告审批说明',
  2699. report_drug_id int null comment '任务提交到药企的报告ID',
  2700. report_drug_approval_status varchar(32) default '0' null comment '任务提交到药企的报告审核状态',
  2701. report_drug_approval_opinion varchar(2) null comment '任务提交到药企的报告审批意见',
  2702. report_drug_approval_info varchar(50) null comment '任务提交到药企的报告审批说明',
  2703. task_status_info varchar(500) null comment 'cso审核审核意见',
  2704. task_from varchar(2) default '1' null comment '来源'
  2705. )
  2706. comment '任务表' row_format = DYNAMIC;
  2707. create index 任务内容
  2708. on wm_task_0518 (task_content_id);
  2709. create index 任务类型task
  2710. on wm_task_0518 (task_type_id);
  2711. create index 调研类型
  2712. on wm_task_0518 (lookinto_type_id);
  2713. create table wm_task_content
  2714. (
  2715. id int auto_increment
  2716. primary key,
  2717. temp1 varchar(1000) null comment '字段1',
  2718. temp2 varchar(1000) null comment '字段2',
  2719. temp3 varchar(1000) null comment '字段3',
  2720. temp4 varchar(1000) null comment '字段4',
  2721. temp5 varchar(1000) null,
  2722. temp6 varchar(1000) null,
  2723. temp7 varchar(1000) null,
  2724. temp8 varchar(1000) null,
  2725. temp9 varchar(1000) null,
  2726. temp10 longtext null,
  2727. temp11 varchar(255) null,
  2728. temp12 longtext null,
  2729. temp13 varchar(255) null,
  2730. temp14 varchar(255) null,
  2731. temp15 varchar(255) null,
  2732. temp16 varchar(255) null,
  2733. temp17 varchar(255) null,
  2734. temp18 varchar(255) null,
  2735. temp19 varchar(255) null,
  2736. temp20 longtext null,
  2737. temp21 varchar(2000) null,
  2738. temp22 varchar(255) null,
  2739. temp23 varchar(255) null,
  2740. temp24 varchar(255) null,
  2741. temp25 varchar(255) null,
  2742. temp26 varchar(255) null,
  2743. temp28 text null,
  2744. temp29 text null,
  2745. temp30 varchar(255) null,
  2746. temp31 varchar(255) null comment 'temp31',
  2747. temp32 varchar(255) null comment 'temp32'
  2748. )
  2749. comment '任务内容表' row_format = DYNAMIC;
  2750. create table wm_task_content_config
  2751. (
  2752. id int auto_increment
  2753. primary key,
  2754. base_type_id char(10) null comment '任务大类',
  2755. task_type_id char(10) null comment '任务ID',
  2756. task_filed_key varchar(255) null comment '字段1',
  2757. task_filed_value varchar(255) null comment '字段2',
  2758. seq int null comment '顺序',
  2759. task_filed_type char(20) null comment '字段类型',
  2760. task_filed_minsize int null comment '最大长度',
  2761. task_filed_maxsize int null comment '最小长度',
  2762. task_filed_alert varchar(255) null comment '弹框提示',
  2763. dict_url varchar(255) null comment '字典值请求URL',
  2764. dict_group_name varchar(255) null comment '字典值分组名称',
  2765. is_mustfill char null comment '是否必填',
  2766. dept_id int null comment '组织机构ID',
  2767. del_flag char default '0' not null comment '是否删除',
  2768. enable_flag char default '0' not null comment '是否禁用',
  2769. tenant_id int default 1 not null comment '所属租户',
  2770. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间',
  2771. create_user int null comment '创建人',
  2772. update_time datetime default CURRENT_TIMESTAMP null comment '更新时间',
  2773. update_user int null comment '更新人'
  2774. )
  2775. comment '任务内容字段配置' row_format = DYNAMIC;
  2776. create index 任务5
  2777. on wm_task_content_config (task_type_id);
  2778. create table wm_task_download_job
  2779. (
  2780. id int auto_increment
  2781. primary key,
  2782. agent_id varchar(10) not null,
  2783. task_type_id varchar(10) not null,
  2784. download_user_id varchar(10) null
  2785. )
  2786. row_format = DYNAMIC;
  2787. create table wm_task_info_config_ref
  2788. (
  2789. id int not null
  2790. primary key,
  2791. task_table_name varchar(50) null comment '任务表名称',
  2792. task_table_filed_name varchar(50) not null comment '任务表字段名称',
  2793. config_filed_name varchar(50) null comment '配置字段名称',
  2794. task_type_id int null comment '任务类型ID'
  2795. )
  2796. row_format = DYNAMIC;
  2797. create table wm_task_rule
  2798. (
  2799. id int auto_increment
  2800. primary key,
  2801. drugent_id char(10) null comment '药企ID',
  2802. rule_type_id char(2) null comment '规则类型,1药企 2一级代理商',
  2803. rule_month varchar(255) null comment '规则月份',
  2804. level1_id varchar(11) null comment '一级代理商ID',
  2805. level2_id varchar(11) null comment '二级代理商ID',
  2806. dept_id varchar(11) null comment '组织机构ID',
  2807. del_flag varchar(1) default '0' not null comment '是否删除',
  2808. enable_flag varchar(1) default '0' not null comment '是否禁用',
  2809. tenant_id int default 1 not null comment '所属租户',
  2810. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  2811. create_user int null comment '创建人',
  2812. update_time datetime null comment '更新时间',
  2813. update_user int null comment '更新人'
  2814. )
  2815. comment '任务积分规则' row_format = DYNAMIC;
  2816. create table wm_task_settle_note
  2817. (
  2818. id int auto_increment
  2819. primary key,
  2820. package_id varchar(20) null,
  2821. package_status_id varchar(20) null,
  2822. task_id varchar(20) null,
  2823. settle_amount decimal(10, 2) null,
  2824. user_id varchar(20) null,
  2825. invoice_type int(20) null,
  2826. settle_no varchar(128) null,
  2827. discount decimal(10, 2) null,
  2828. settle_note_status int(2) default 0 null,
  2829. remark varchar(256) null,
  2830. category_name varchar(255) null,
  2831. create_time datetime null,
  2832. sub_time datetime null,
  2833. notify_time datetime null,
  2834. update_time datetime null,
  2835. stream_id varchar(255) default '' null
  2836. )
  2837. charset = utf8
  2838. row_format = DYNAMIC;
  2839. create table wm_task_sub_percent_rule
  2840. (
  2841. rule_id int(20) auto_increment comment '规则ID'
  2842. primary key,
  2843. dept_id int(20) not null comment '企业id',
  2844. sub_cate varchar(50) not null comment '次级分类',
  2845. batch_id varchar(32) null comment '批量保存编号',
  2846. sub_rule json null comment '规则',
  2847. opt_flag varchar(32) not null comment '操作标记',
  2848. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  2849. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间'
  2850. )
  2851. comment '任务提交百分比限制规则表';
  2852. create index idx_dept_id
  2853. on wm_task_sub_percent_rule (dept_id);
  2854. create index idx_sub_cate
  2855. on wm_task_sub_percent_rule (sub_cate);
  2856. create table wm_task_sub_rule
  2857. (
  2858. rule_id int(20) auto_increment comment '规则ID'
  2859. primary key,
  2860. dept_id int(20) not null comment '企业id',
  2861. sub_cate varchar(32) not null comment '次级分类',
  2862. sub_rule json null comment '规则',
  2863. opt_flag varchar(32) not null comment '操作标记',
  2864. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  2865. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间'
  2866. )
  2867. comment '任务提交规则表';
  2868. create index idx_dept_id
  2869. on wm_task_sub_rule (dept_id);
  2870. create index idx_sub_cate
  2871. on wm_task_sub_rule (sub_cate);
  2872. create table wm_task_type
  2873. (
  2874. id int(11) unsigned auto_increment
  2875. primary key,
  2876. task_type_name varchar(50) null comment '任务类型名称',
  2877. task_type_level char null comment '任务类型级别',
  2878. task_score_start int(5) null comment '积分范围开始',
  2879. task_score_end int(5) null comment '积分范围结束',
  2880. score int(10) null comment '完成后可获得分',
  2881. task_ent_id varchar(11) null comment '积分分配代理商',
  2882. durgent_id char(11) null comment '药企ID',
  2883. level1_id char(11) null comment '一级代理商ID',
  2884. dept_id int null comment '组织机构ID',
  2885. del_flag int(1) default 0 not null comment '是否删除',
  2886. enable_flag char default '0' not null comment '是否禁用',
  2887. tenant_id int default 1 not null comment '所属租户',
  2888. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  2889. create_user int null comment '创建人',
  2890. update_time datetime null comment '更新时间',
  2891. update_user int null comment '更新人',
  2892. status int(1) default 0 null comment '积分规则状态',
  2893. base_id varchar(11) null comment '父类ID',
  2894. real_flag char null,
  2895. rule_id varchar(64) default '' null,
  2896. parent_id varchar(11) null comment '父级ID',
  2897. task_receiver_type char default '1' null comment '承接对象(1-个人,2-企业)',
  2898. task_remark text null comment '任务备注'
  2899. )
  2900. comment '任务类型打分表' row_format = DYNAMIC;
  2901. create table wm_task_type_0422
  2902. (
  2903. id int(11) unsigned auto_increment
  2904. primary key,
  2905. task_type_name varchar(50) null comment '任务类型名称',
  2906. task_type_level char null comment '任务类型级别',
  2907. task_score_start int(5) null comment '积分范围开始',
  2908. task_score_end int(5) null comment '积分范围结束',
  2909. score int(10) null comment '完成后可获得分',
  2910. task_ent_id varchar(11) null comment '积分分配代理商',
  2911. durgent_id char(11) null comment '药企ID',
  2912. level1_id char(11) null comment '一级代理商ID',
  2913. dept_id int null comment '组织机构ID',
  2914. del_flag int(1) default 0 not null comment '是否删除',
  2915. enable_flag char default '0' not null comment '是否禁用',
  2916. tenant_id int default 1 not null comment '所属租户',
  2917. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  2918. create_user int null comment '创建人',
  2919. update_time datetime null comment '更新时间',
  2920. update_user int null comment '更新人',
  2921. status int(1) default 0 null comment '积分规则状态',
  2922. base_id varchar(11) null comment '父类ID',
  2923. real_flag char null,
  2924. rule_id varchar(64) default '' null,
  2925. parent_id varchar(11) null comment '父级ID'
  2926. )
  2927. comment '任务类型打分表' row_format = DYNAMIC;
  2928. create table wm_task_type_ent_ref
  2929. (
  2930. id int auto_increment
  2931. primary key,
  2932. agent_id varchar(11) null comment '代理商ID',
  2933. drugent_id varchar(11) null comment '药企ID',
  2934. dept_id int null comment '组织机构ID',
  2935. del_flag char default '0' not null comment '是否删除',
  2936. enable_flag char default '0' not null comment '是否禁用',
  2937. tenant_id int default 1 not null comment '所属租户',
  2938. create_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP comment '创建时间',
  2939. create_user int null comment '创建人',
  2940. update_time datetime null comment '更新时间',
  2941. update_user int null comment '更新人'
  2942. )
  2943. comment '药企给代理商设定积分规则' row_format = DYNAMIC;
  2944. create table wm_task_type_score_ref
  2945. (
  2946. id int not null
  2947. primary key,
  2948. task_rule_id int null comment '积分规则ID',
  2949. task_type_score varchar(255) null comment '任务类型打分',
  2950. task_type_id int null comment '任务类型ID',
  2951. typeid int(1) null comment '1.平台给一级代理商打分
  2952. 2.一级代理商给二级代理商打分',
  2953. level1_id int(10) null comment '一级代理商ID',
  2954. level2_id int(10) null comment '二级代理商ID',
  2955. drugent_id int(10) null comment '药企ID',
  2956. month_str varchar(255) null comment '积分规则所属月份',
  2957. dept_id int null comment '组织机构ID',
  2958. del_flag int(1) default 0 not null comment '是否删除',
  2959. enable_flag int(1) default 0 not null comment '是否禁用',
  2960. tenant_id int default 1 not null comment '所属租户',
  2961. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  2962. create_user int null comment '创建人',
  2963. update_time datetime null comment '更新时间',
  2964. update_user int null comment '更新人'
  2965. )
  2966. comment '任务类型打分' row_format = DYNAMIC;
  2967. create index taskrule11
  2968. on wm_task_type_score_ref (task_rule_id);
  2969. create index tasktype112
  2970. on wm_task_type_score_ref (task_type_id);
  2971. create table wm_task_type_sub_cate
  2972. (
  2973. ttsc_id int(20) auto_increment comment '规则ID'
  2974. primary key,
  2975. type_id int(20) not null comment '企业id',
  2976. type_name varchar(32) not null comment '任务名称',
  2977. sub_cate varchar(32) not null comment '次级分类',
  2978. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  2979. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间'
  2980. )
  2981. comment '任务提交规则表';
  2982. create index idx_dept_id
  2983. on wm_task_type_sub_cate (type_id);
  2984. create index idx_sub_cate
  2985. on wm_task_type_sub_cate (sub_cate);
  2986. create table wm_task_type_sub_cate2
  2987. (
  2988. dtt_id int(20) auto_increment comment '主键ID'
  2989. primary key,
  2990. type_id int(20) not null comment '企业id',
  2991. type_name varchar(32) not null comment '任务名称',
  2992. sub_cate varchar(50) not null comment '次级分类',
  2993. parent_id varchar(10) null comment '对应wm_task_type的parent_id',
  2994. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  2995. update_time datetime default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP comment '修改时间'
  2996. )
  2997. comment '任务类型二级分类表';
  2998. create index idx_dept_id
  2999. on wm_task_type_sub_cate2 (type_id);
  3000. create index idx_sub_cate
  3001. on wm_task_type_sub_cate2 (sub_cate);
  3002. create table wm_task_ware
  3003. (
  3004. ware_id bigint unsigned auto_increment comment 'id'
  3005. primary key,
  3006. ware_sn varchar(64) not null comment '库存序号',
  3007. task_id varchar(18) not null comment '任务id',
  3008. ava_count bigint unsigned default 1 not null comment '可用库存数',
  3009. locked_count bigint unsigned default 0 not null comment '已锁定数量',
  3010. order_sn bigint null comment '锁定订单',
  3011. created_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  3012. modified_time datetime not null on update CURRENT_TIMESTAMP comment '修改时间',
  3013. constraint uk_record_id
  3014. unique (task_id)
  3015. )
  3016. comment '任务库存表';
  3017. create table wm_team
  3018. (
  3019. id int auto_increment
  3020. primary key,
  3021. dept_id int not null comment '组织机构ID',
  3022. name varchar(50) not null comment '团队名称',
  3023. leader varchar(128) null comment '团队负责人',
  3024. member varchar(2048) null comment '团队成员',
  3025. enable_flag char default '0' not null comment '是否禁用(0-企业,1-禁用)',
  3026. del_flag char default '0' not null comment '是否删除(0-正常,1-已删除)',
  3027. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间',
  3028. create_user int null comment '创建人',
  3029. update_time datetime null comment '更新时间',
  3030. update_user int null comment '更新人'
  3031. )
  3032. comment '团队管理';
  3033. create table wm_user_plat_quiz_res
  3034. (
  3035. res_id int auto_increment comment 'Id'
  3036. primary key,
  3037. user_id int not null comment '用户ID',
  3038. quiz_id int null comment '试卷id',
  3039. quiz_res json null comment '测试结果',
  3040. res_expiry date not null comment '测评有效期',
  3041. create_time datetime default CURRENT_TIMESTAMP not null comment '创建时间'
  3042. )
  3043. comment '用户测评的评判结果';
  3044. create index idx_qid
  3045. on wm_user_plat_quiz_res (quiz_id);
  3046. create index idx_uid
  3047. on wm_user_plat_quiz_res (user_id);
  3048. create table wm_user_sign
  3049. (
  3050. id int auto_increment
  3051. primary key,
  3052. sign_userid varchar(11) null comment '签到人',
  3053. sign_ent_id varchar(11) null comment '签到企业ID',
  3054. sign_date datetime null comment '签到日期',
  3055. score int null comment '得分',
  3056. longitude varchar(255) not null comment '经度',
  3057. latitude varchar(255) not null comment '纬度',
  3058. sign_ent_name varchar(255) null comment '签单企业名称',
  3059. sign_ent_type varchar(11) null comment '签到企业类型',
  3060. task_type_id varchar(11) null comment '任务类型id'
  3061. )
  3062. comment '用户签到表' row_format = DYNAMIC;
  3063. create table wm_user_sign_detail
  3064. (
  3065. id int auto_increment
  3066. primary key,
  3067. sign_id int not null comment '签到表id',
  3068. drug text not null comment '推广药品',
  3069. purpose varchar(20) not null comment '拜访目的',
  3070. result char not null comment '拜访结果',
  3071. remark varchar(255) null comment '备注',
  3072. department varchar(64) null comment '拜访科室',
  3073. visitor varchar(64) null comment '拜访人员',
  3074. detail json null comment '详情数据',
  3075. template_type char(10) default 'TEMPLATE1' null comment '所属模板类型'
  3076. )
  3077. comment '用户签到详情';
  3078. create table wm_wk_album
  3079. (
  3080. id int auto_increment
  3081. primary key,
  3082. xcmc varchar(255) not null comment '相册名称',
  3083. scfm varchar(255) not null comment '封面',
  3084. glyp varchar(255) null comment '关联药品',
  3085. wb longtext not null comment '文本',
  3086. dept_id int null comment '组织机构ID',
  3087. del_flag int(1) default 0 not null comment '是否删除',
  3088. enable_flag int(1) default 0 not null comment '是否禁用',
  3089. tenant_id int default 1 not null comment '所属租户',
  3090. create_time datetime null on update CURRENT_TIMESTAMP comment '创建时间',
  3091. create_user int null comment '创建人',
  3092. update_time datetime null comment '更新时间',
  3093. update_user int null comment '更新人',
  3094. forward_num int default 0 null comment '转发数',
  3095. temp1 varchar(255) null comment '关联药品汉字',
  3096. score varchar(255) null comment '前端显示分数使用'
  3097. )
  3098. comment '文库-相册' row_format = DYNAMIC;
  3099. create table wm_wk_article
  3100. (
  3101. id int auto_increment
  3102. primary key,
  3103. title varchar(500) not null comment '文章标题',
  3104. author varchar(255) not null comment '作者',
  3105. fm varchar(255) null comment '封面',
  3106. content longtext not null comment '文章内容',
  3107. source varchar(255) null comment '文章来源',
  3108. description varchar(1000) null comment '描述',
  3109. dept_id int null comment '组织机构ID',
  3110. del_flag int(1) default 0 not null comment '是否删除',
  3111. enable_flag int(1) default 0 not null comment '是否禁用',
  3112. tenant_id int default 1 not null comment '所属租户',
  3113. create_time datetime null comment '创建时间',
  3114. create_user int null comment '创建人',
  3115. update_time datetime null comment '更新时间',
  3116. update_user int null comment '更新人',
  3117. forward_num int null comment '转发数',
  3118. channel_id varchar(50) null comment '抓取文章栏目ID',
  3119. article_id varchar(50) null comment '抓取文章ID',
  3120. score varchar(255) null,
  3121. read_num int default 0 null comment '阅读数',
  3122. new_flag int(1) default 0 null comment '新标签',
  3123. hot_flag int(1) default 0 null comment '热门标签',
  3124. area varchar(128) null comment '区域',
  3125. source_ent varchar(255) null comment '文章来源(来源企业)'
  3126. )
  3127. comment '文库-文章' row_format = DYNAMIC;
  3128. create table wm_wk_article0507
  3129. (
  3130. id int default 0 not null,
  3131. title varchar(500) not null comment '文章标题',
  3132. author varchar(255) not null comment '作者',
  3133. fm varchar(255) null comment '封面',
  3134. content longtext not null comment '文章内容',
  3135. source varchar(255) null comment '文章来源',
  3136. description varchar(1000) null comment '描述',
  3137. dept_id int null comment '组织机构ID',
  3138. del_flag int(1) default 0 not null comment '是否删除',
  3139. enable_flag int(1) default 0 not null comment '是否禁用',
  3140. tenant_id int default 1 not null comment '所属租户',
  3141. create_time datetime null comment '创建时间',
  3142. create_user int null comment '创建人',
  3143. update_time datetime null comment '更新时间',
  3144. update_user int null comment '更新人',
  3145. forward_num int null comment '转发数',
  3146. channel_id varchar(50) null comment '抓取文章栏目ID',
  3147. article_id varchar(50) null comment '抓取文章ID',
  3148. score varchar(255) null,
  3149. read_num int default 0 null comment '阅读数',
  3150. new_flag int(1) default 0 null comment '新标签',
  3151. hot_flag int(1) default 0 null comment '热门标签',
  3152. area varchar(128) null comment '区域'
  3153. )
  3154. row_format = DYNAMIC;
  3155. create table wm_wk_article_20210225
  3156. (
  3157. id int auto_increment
  3158. primary key,
  3159. title varchar(500) not null comment '文章标题',
  3160. author varchar(255) not null comment '作者',
  3161. fm varchar(255) null comment '封面',
  3162. content longtext not null comment '文章内容',
  3163. source varchar(255) null comment '文章来源',
  3164. description varchar(1000) null comment '描述',
  3165. dept_id int null comment '组织机构ID',
  3166. del_flag int(1) default 0 not null comment '是否删除',
  3167. enable_flag int(1) default 0 not null comment '是否禁用',
  3168. tenant_id int default 1 not null comment '所属租户',
  3169. create_time datetime null comment '创建时间',
  3170. create_user int null comment '创建人',
  3171. update_time datetime null comment '更新时间',
  3172. update_user int null comment '更新人',
  3173. forward_num int null comment '转发数',
  3174. channel_id varchar(50) null comment '抓取文章栏目ID',
  3175. article_id varchar(50) null comment '抓取文章ID',
  3176. score varchar(255) null,
  3177. read_num int default 0 null comment '阅读数',
  3178. new_flag int(1) default 0 null comment '新标签',
  3179. hot_flag int(1) default 0 null comment '热门标签',
  3180. area varchar(128) null comment '区域'
  3181. )
  3182. comment '文库-文章' row_format = DYNAMIC;
  3183. create table wm_wk_article_20210225001
  3184. (
  3185. id int auto_increment
  3186. primary key,
  3187. title varchar(500) not null comment '文章标题',
  3188. author varchar(255) not null comment '作者',
  3189. fm varchar(255) null comment '封面',
  3190. content longtext not null comment '文章内容',
  3191. source varchar(255) null comment '文章来源',
  3192. description varchar(1000) null comment '描述',
  3193. dept_id int null comment '组织机构ID',
  3194. del_flag int(1) default 0 not null comment '是否删除',
  3195. enable_flag int(1) default 0 not null comment '是否禁用',
  3196. tenant_id int default 1 not null comment '所属租户',
  3197. create_time datetime null comment '创建时间',
  3198. create_user int null comment '创建人',
  3199. update_time datetime null comment '更新时间',
  3200. update_user int null comment '更新人',
  3201. forward_num int null comment '转发数',
  3202. channel_id varchar(50) null comment '抓取文章栏目ID',
  3203. article_id varchar(50) null comment '抓取文章ID',
  3204. score varchar(255) null,
  3205. read_num int default 0 null comment '阅读数',
  3206. new_flag int(1) default 0 null comment '新标签',
  3207. hot_flag int(1) default 0 null comment '热门标签',
  3208. area varchar(128) null comment '区域'
  3209. )
  3210. comment '文库-文章' row_format = DYNAMIC;
  3211. create table wm_wk_article_55798
  3212. (
  3213. id int default 0 not null,
  3214. title varchar(500) not null comment '文章标题',
  3215. author varchar(255) not null comment '作者',
  3216. fm varchar(255) null comment '封面',
  3217. content longtext not null comment '文章内容',
  3218. source varchar(255) null comment '文章来源',
  3219. description varchar(1000) null comment '描述',
  3220. dept_id int null comment '组织机构ID',
  3221. del_flag int(1) default 0 not null comment '是否删除',
  3222. enable_flag int(1) default 0 not null comment '是否禁用',
  3223. tenant_id int default 1 not null comment '所属租户',
  3224. create_time datetime null comment '创建时间',
  3225. create_user int null comment '创建人',
  3226. update_time datetime null comment '更新时间',
  3227. update_user int null comment '更新人',
  3228. forward_num int null comment '转发数',
  3229. channel_id varchar(50) null comment '抓取文章栏目ID',
  3230. article_id varchar(50) null comment '抓取文章ID',
  3231. score varchar(255) null,
  3232. read_num int default 0 null comment '阅读数',
  3233. new_flag int(1) default 0 null comment '新标签',
  3234. hot_flag int(1) default 0 null comment '热门标签',
  3235. area varchar(128) null comment '区域'
  3236. )
  3237. row_format = DYNAMIC;
  3238. create table wm_wk_article_config
  3239. (
  3240. id int auto_increment
  3241. primary key,
  3242. type char(2) null,
  3243. source varchar(11) null,
  3244. total int null,
  3245. create_time datetime default CURRENT_TIMESTAMP null
  3246. )
  3247. comment '文章抓取配置' row_format = DYNAMIC;
  3248. create table wm_wk_article_share
  3249. (
  3250. id int auto_increment
  3251. primary key,
  3252. share_type varchar(11) null comment '分享类型',
  3253. arctile_id varchar(200) null comment '文章ID',
  3254. share_userid varchar(11) null comment '分享用户ID',
  3255. open_user varchar(255) null comment '打开文章用户',
  3256. create_time datetime null comment '打开时间',
  3257. temp1 varchar(255) null comment '备用字段1',
  3258. temp2 varchar(255) null comment '备用字段2',
  3259. temp3 varchar(255) null comment '备用字段3'
  3260. )
  3261. comment '文章分享' row_format = DYNAMIC;
  3262. create table xinbada_input_record
  3263. (
  3264. id int auto_increment comment '主键id'
  3265. primary key,
  3266. signature varchar(128) not null comment '签名',
  3267. action_name varchar(32) not null comment '通知类型',
  3268. req_body text not null comment '请求body内容',
  3269. order_uuid varchar(64) null comment '订单编号唯一',
  3270. order_status int null comment '订单状态',
  3271. order_no varchar(32) null,
  3272. customer_user_uuid varchar(64) null,
  3273. server_user_uuid varchar(64) null,
  3274. public_key varchar(2048) null comment '请求公钥',
  3275. private_key varchar(2048) null comment '请求时私钥',
  3276. create_time timestamp default CURRENT_TIMESTAMP not null comment '创建时间',
  3277. gig_type varchar(32) default 'ZHENG_QI_ZHI_XING' null comment '零工平台类型'
  3278. )
  3279. comment '正启之星请求记录';
  3280. create table xinshiyi_input_record
  3281. (
  3282. id int auto_increment comment '主键id'
  3283. primary key,
  3284. req_id varchar(64) null comment '请求序号',
  3285. batch_id varchar(64) null comment '批次号',
  3286. msg_method char(20) null comment '消息接口名称',
  3287. order_status int null comment '订单状态',
  3288. req_body text null comment '请求body',
  3289. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  3290. )
  3291. comment '薪事易回调异步通知记录';
  3292. create table xxl_job_group
  3293. (
  3294. id int auto_increment
  3295. primary key,
  3296. app_name varchar(64) not null comment '执行器AppName',
  3297. title varchar(12) not null comment '执行器名称',
  3298. `order` int default 0 not null comment '排序',
  3299. address_type tinyint default 0 not null comment '执行器地址类型:0=自动注册、1=手动录入',
  3300. address_list varchar(512) null comment '执行器地址列表,多地址逗号分隔'
  3301. )
  3302. row_format = DYNAMIC;
  3303. create table xxl_job_info
  3304. (
  3305. id int auto_increment
  3306. primary key,
  3307. job_group int not null comment '执行器主键ID',
  3308. job_cron varchar(128) not null comment '任务执行CRON',
  3309. job_desc varchar(255) not null,
  3310. add_time datetime null,
  3311. update_time datetime null,
  3312. author varchar(64) null comment '作者',
  3313. alarm_email varchar(255) null comment '报警邮件',
  3314. executor_route_strategy varchar(50) null comment '执行器路由策略',
  3315. executor_handler varchar(255) null comment '执行器任务handler',
  3316. executor_param varchar(512) null comment '执行器任务参数',
  3317. executor_block_strategy varchar(50) null comment '阻塞处理策略',
  3318. executor_timeout int default 0 not null comment '任务执行超时时间,单位秒',
  3319. executor_fail_retry_count int default 0 not null comment '失败重试次数',
  3320. glue_type varchar(50) not null comment 'GLUE类型',
  3321. glue_source mediumtext null comment 'GLUE源代码',
  3322. glue_remark varchar(128) null comment 'GLUE备注',
  3323. glue_updatetime datetime null comment 'GLUE更新时间',
  3324. child_jobid varchar(255) null comment '子任务ID,多个逗号分隔',
  3325. trigger_status tinyint default 0 not null comment '调度状态:0-停止,1-运行',
  3326. trigger_last_time bigint(13) default 0 not null comment '上次调度时间',
  3327. trigger_next_time bigint(13) default 0 not null comment '下次调度时间'
  3328. )
  3329. row_format = DYNAMIC;
  3330. create table xxl_job_lock
  3331. (
  3332. lock_name varchar(50) not null comment '锁名称'
  3333. primary key
  3334. )
  3335. row_format = DYNAMIC;
  3336. create table xxl_job_log
  3337. (
  3338. id bigint auto_increment
  3339. primary key,
  3340. job_group int not null comment '执行器主键ID',
  3341. job_id int not null comment '任务,主键ID',
  3342. executor_address varchar(255) null comment '执行器地址,本次执行的地址',
  3343. executor_handler varchar(255) null comment '执行器任务handler',
  3344. executor_param varchar(512) null comment '执行器任务参数',
  3345. executor_sharding_param varchar(20) null comment '执行器任务分片参数,格式如 1/2',
  3346. executor_fail_retry_count int default 0 not null comment '失败重试次数',
  3347. trigger_time datetime null comment '调度-时间',
  3348. trigger_code int not null comment '调度-结果',
  3349. trigger_msg text null comment '调度-日志',
  3350. handle_time datetime null comment '执行-时间',
  3351. handle_code int not null comment '执行-状态',
  3352. handle_msg text null comment '执行-日志',
  3353. alarm_status tinyint default 0 not null comment '告警状态:0-默认、1-无需告警、2-告警成功、3-告警失败'
  3354. )
  3355. row_format = DYNAMIC;
  3356. create index I_handle_code
  3357. on xxl_job_log (handle_code);
  3358. create index I_trigger_time
  3359. on xxl_job_log (trigger_time);
  3360. create table xxl_job_log_report
  3361. (
  3362. id int auto_increment
  3363. primary key,
  3364. trigger_day datetime null comment '调度-时间',
  3365. running_count int default 0 not null comment '运行中-日志数量',
  3366. suc_count int default 0 not null comment '执行成功-日志数量',
  3367. fail_count int default 0 not null comment '执行失败-日志数量',
  3368. constraint i_trigger_day
  3369. unique (trigger_day)
  3370. )
  3371. row_format = DYNAMIC;
  3372. create table xxl_job_logglue
  3373. (
  3374. id int auto_increment
  3375. primary key,
  3376. job_id int not null comment '任务,主键ID',
  3377. glue_type varchar(50) null comment 'GLUE类型',
  3378. glue_source mediumtext null comment 'GLUE源代码',
  3379. glue_remark varchar(128) not null comment 'GLUE备注',
  3380. add_time datetime null,
  3381. update_time datetime null
  3382. )
  3383. row_format = DYNAMIC;
  3384. create table xxl_job_registry
  3385. (
  3386. id int auto_increment
  3387. primary key,
  3388. registry_group varchar(50) not null,
  3389. registry_key varchar(255) not null,
  3390. registry_value varchar(255) not null,
  3391. update_time datetime null
  3392. )
  3393. row_format = DYNAMIC;
  3394. create index i_g_k_v
  3395. on xxl_job_registry (registry_group, registry_key(191), registry_value(191));
  3396. create table xxl_job_user
  3397. (
  3398. id int auto_increment
  3399. primary key,
  3400. username varchar(50) not null comment '账号',
  3401. password varchar(50) not null comment '密码',
  3402. role tinyint not null comment '角色:0-普通用户、1-管理员',
  3403. permission varchar(255) null comment '权限:执行器ID列表,多个逗号分割',
  3404. constraint i_username
  3405. unique (username)
  3406. )
  3407. row_format = DYNAMIC;
  3408. create table zhongyiyun_input_record
  3409. (
  3410. id int auto_increment comment '主键id'
  3411. primary key,
  3412. req_type varchar(20) not null comment '请求业务类型',
  3413. req_id varchar(64) null comment '请求序号',
  3414. req_body text null comment '请求body',
  3415. decrypt_body text null comment '解密后的body',
  3416. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  3417. )
  3418. comment '众蚁云回调异步通知记录';
  3419. create table zhongzhi_input_record
  3420. (
  3421. id int auto_increment comment '主键id'
  3422. primary key,
  3423. req_type varchar(20) not null comment '请求业务类型',
  3424. order_no varchar(64) null comment '三方订单号',
  3425. req_body text null comment '请求body',
  3426. create_time datetime default CURRENT_TIMESTAMP null comment '创建时间'
  3427. )
  3428. comment '中智回调异步通知记录';
  3429. create definer = root@`%` view view_wm_socre_package_total as
  3430. select `ccc`.`id` AS `id`,
  3431. `ccc`.`invoice_category` AS `invoice_category`,
  3432. `ccc`.`settle_status` AS `settle_status`,
  3433. `ccc`.`settle_amount` AS `settle_amount`,
  3434. `ccc`.`discount` AS `discount`,
  3435. `ccc`.`task_rule_id` AS `task_rule_id`,
  3436. `ccc`.`drug_ent_id` AS `drug_ent_id`,
  3437. `ccc`.`score_id` AS `score_id`,
  3438. `ccc`.`score_name` AS `score_name`,
  3439. `ccc`.`score` AS `score`,
  3440. `ccc`.`agent_type_id` AS `agent_type_id`,
  3441. `ccc`.`level1_id` AS `level1_id`,
  3442. `ccc`.`level2_id` AS `level2_id`,
  3443. `ccc`.`zb_id` AS `zb_id`,
  3444. `ccc`.`xxdb_id` AS `xxdb_id`,
  3445. `ccc`.`typeid` AS `typeid`,
  3446. `ccc`.`package_status` AS `package_status`,
  3447. `ccc`.`package_finish_status` AS `package_finish_status`,
  3448. `ccc`.`package_audit_status` AS `package_audit_status`,
  3449. `ccc`.`send_package_dept_id` AS `send_package_dept_id`,
  3450. `ccc`.`dept_id` AS `dept_id`,
  3451. `ccc`.`del_flag` AS `del_flag`,
  3452. `ccc`.`enable_flag` AS `enable_flag`,
  3453. `ccc`.`tenant_id` AS `tenant_id`,
  3454. `ccc`.`create_time` AS `create_time`,
  3455. `ccc`.`create_user` AS `create_user`,
  3456. `ccc`.`update_time` AS `update_time`,
  3457. `ccc`.`update_user` AS `update_user`,
  3458. `ccc`.`receive_date` AS `receive_date`,
  3459. `ccc`.`ytj` AS `ytj`,
  3460. `ccc`.`ysh` AS `ysh`,
  3461. `ccc`.`dsh` AS `dsh`,
  3462. `ccc`.`t_type` AS `t_type`
  3463. from (select `hnqzx`.`wm_score_package`.`id` AS `id`,
  3464. `hnqzx`.`wm_score_package`.`invoice_category` AS `invoice_category`,
  3465. `hnqzx`.`wm_score_package`.`settle_status` AS `settle_status`,
  3466. `hnqzx`.`wm_score_package`.`settle_amount` AS `settle_amount`,
  3467. `hnqzx`.`wm_score_package`.`discount` AS `discount`,
  3468. `hnqzx`.`wm_score_package`.`task_rule_id` AS `task_rule_id`,
  3469. `hnqzx`.`wm_score_package`.`drug_ent_id` AS `drug_ent_id`,
  3470. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  3471. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  3472. `hnqzx`.`wm_score_package`.`score` AS `score`,
  3473. `hnqzx`.`wm_score_package`.`agent_type_id` AS `agent_type_id`,
  3474. `hnqzx`.`wm_score_package`.`level1_id` AS `level1_id`,
  3475. `hnqzx`.`wm_score_package`.`level2_id` AS `level2_id`,
  3476. `hnqzx`.`wm_score_package`.`zb_id` AS `zb_id`,
  3477. `hnqzx`.`wm_score_package`.`xxdb_id` AS `xxdb_id`,
  3478. `hnqzx`.`wm_score_package`.`typeid` AS `typeid`,
  3479. `hnqzx`.`wm_score_package`.`package_status` AS `package_status`,
  3480. `hnqzx`.`wm_score_package`.`package_finish_status` AS `package_finish_status`,
  3481. `hnqzx`.`wm_score_package`.`package_audit_status` AS `package_audit_status`,
  3482. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  3483. `hnqzx`.`wm_score_package`.`dept_id` AS `dept_id`,
  3484. `hnqzx`.`wm_score_package`.`del_flag` AS `del_flag`,
  3485. `hnqzx`.`wm_score_package`.`enable_flag` AS `enable_flag`,
  3486. `hnqzx`.`wm_score_package`.`tenant_id` AS `tenant_id`,
  3487. `hnqzx`.`wm_score_package`.`create_time` AS `create_time`,
  3488. `hnqzx`.`wm_score_package`.`create_user` AS `create_user`,
  3489. `hnqzx`.`wm_score_package`.`update_time` AS `update_time`,
  3490. `hnqzx`.`wm_score_package`.`update_user` AS `update_user`,
  3491. `hnqzx`.`wm_score_package`.`receive_date` AS `receive_date`,
  3492. `hnqzx`.`wm_score_package`.`is_conduct` AS `is_conduct`,
  3493. `bb`.`ytj` AS `ytj`,
  3494. `bb`.`ysh` AS `ysh`,
  3495. `bb`.`dsh` AS `dsh`,
  3496. 1 AS `t_type`
  3497. from (`hnqzx`.`wm_score_package` left join (select `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  3498. sum(if((`hnqzx`.`wm_task`.`task_status` > 0),
  3499. `hnqzx`.`wm_task`.`score`, 0)) AS `ytj`,
  3500. sum(if((`hnqzx`.`wm_task`.`task_status` = 3),
  3501. `hnqzx`.`wm_task`.`score`, 0)) AS `ysh`,
  3502. sum(if((`hnqzx`.`wm_task`.`task_status` = 2),
  3503. `hnqzx`.`wm_task`.`score`, 0)) AS `dsh`
  3504. from `hnqzx`.`wm_task`
  3505. where ((`hnqzx`.`wm_task`.`score_package_id` is not null) and
  3506. (`hnqzx`.`wm_task`.`real_flag` = '0'))
  3507. group by `hnqzx`.`wm_task`.`score_package_id`) `bb`
  3508. on ((`hnqzx`.`wm_score_package`.`id` = `bb`.`score_package_id`)))
  3509. where ((`hnqzx`.`wm_score_package`.`del_flag` = '0') and (`hnqzx`.`wm_score_package`.`enable_flag` = '0') and
  3510. (`hnqzx`.`wm_score_package`.`agent_type_id` = 2) and (`hnqzx`.`wm_score_package`.`typeid` in (3, 4)))
  3511. union
  3512. select `hnqzx`.`wm_score_package`.`id` AS `id`,
  3513. `hnqzx`.`wm_score_package`.`invoice_category` AS `invoice_category`,
  3514. `hnqzx`.`wm_score_package`.`settle_status` AS `settle_status`,
  3515. `hnqzx`.`wm_score_package`.`settle_amount` AS `settle_amount`,
  3516. `hnqzx`.`wm_score_package`.`discount` AS `discount`,
  3517. `hnqzx`.`wm_score_package`.`task_rule_id` AS `task_rule_id`,
  3518. `hnqzx`.`wm_score_package`.`drug_ent_id` AS `drug_ent_id`,
  3519. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  3520. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  3521. `hnqzx`.`wm_score_package`.`score` AS `score`,
  3522. `hnqzx`.`wm_score_package`.`agent_type_id` AS `agent_type_id`,
  3523. `hnqzx`.`wm_score_package`.`level1_id` AS `level1_id`,
  3524. `hnqzx`.`wm_score_package`.`level2_id` AS `level2_id`,
  3525. `hnqzx`.`wm_score_package`.`zb_id` AS `zb_id`,
  3526. `hnqzx`.`wm_score_package`.`xxdb_id` AS `xxdb_id`,
  3527. `hnqzx`.`wm_score_package`.`typeid` AS `typeid`,
  3528. `hnqzx`.`wm_score_package`.`package_status` AS `package_status`,
  3529. `hnqzx`.`wm_score_package`.`package_finish_status` AS `package_finish_status`,
  3530. `hnqzx`.`wm_score_package`.`package_audit_status` AS `package_audit_status`,
  3531. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  3532. `hnqzx`.`wm_score_package`.`dept_id` AS `dept_id`,
  3533. `hnqzx`.`wm_score_package`.`del_flag` AS `del_flag`,
  3534. `hnqzx`.`wm_score_package`.`enable_flag` AS `enable_flag`,
  3535. `hnqzx`.`wm_score_package`.`tenant_id` AS `tenant_id`,
  3536. `hnqzx`.`wm_score_package`.`create_time` AS `create_time`,
  3537. `hnqzx`.`wm_score_package`.`create_user` AS `create_user`,
  3538. `hnqzx`.`wm_score_package`.`update_time` AS `update_time`,
  3539. `hnqzx`.`wm_score_package`.`update_user` AS `update_user`,
  3540. `hnqzx`.`wm_score_package`.`receive_date` AS `receive_date`,
  3541. `hnqzx`.`wm_score_package`.`is_conduct` AS `is_conduct`,
  3542. `bb`.`ytj` AS `ytj`,
  3543. `bb`.`ysh` AS `ysh`,
  3544. `bb`.`dsh` AS `dsh`,
  3545. 2 AS `t_type`
  3546. from (`hnqzx`.`wm_score_package` left join (select `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_id`,
  3547. sum(if((`hnqzx`.`wm_task`.`task_status` > 0),
  3548. `hnqzx`.`wm_task`.`score`, 0)) AS `ytj`,
  3549. sum(if((`hnqzx`.`wm_task`.`task_status` = 3),
  3550. `hnqzx`.`wm_task`.`score`, 0)) AS `ysh`,
  3551. sum(if((`hnqzx`.`wm_task`.`task_status` = 2),
  3552. `hnqzx`.`wm_task`.`score`, 0)) AS `dsh`
  3553. from `hnqzx`.`wm_task`
  3554. where ((`hnqzx`.`wm_task`.`score_package_id` is not null) and
  3555. (`hnqzx`.`wm_task`.`real_flag` = '0'))
  3556. group by `hnqzx`.`wm_task`.`score_package_level1_id`) `bb`
  3557. on ((`hnqzx`.`wm_score_package`.`id` = `bb`.`score_package_id`)))
  3558. where ((`hnqzx`.`wm_score_package`.`del_flag` = '0') and (`hnqzx`.`wm_score_package`.`enable_flag` = '0') and
  3559. (`hnqzx`.`wm_score_package`.`agent_type_id` = 2) and (`hnqzx`.`wm_score_package`.`typeid` = 2))
  3560. union
  3561. select `hnqzx`.`wm_score_package`.`id` AS `id`,
  3562. `hnqzx`.`wm_score_package`.`invoice_category` AS `invoice_category`,
  3563. `hnqzx`.`wm_score_package`.`settle_status` AS `settle_status`,
  3564. `hnqzx`.`wm_score_package`.`settle_amount` AS `settle_amount`,
  3565. `hnqzx`.`wm_score_package`.`discount` AS `discount`,
  3566. `hnqzx`.`wm_score_package`.`task_rule_id` AS `task_rule_id`,
  3567. `hnqzx`.`wm_score_package`.`drug_ent_id` AS `drug_ent_id`,
  3568. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  3569. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  3570. `hnqzx`.`wm_score_package`.`score` AS `score`,
  3571. `hnqzx`.`wm_score_package`.`agent_type_id` AS `agent_type_id`,
  3572. `hnqzx`.`wm_score_package`.`level1_id` AS `level1_id`,
  3573. `hnqzx`.`wm_score_package`.`level2_id` AS `level2_id`,
  3574. `hnqzx`.`wm_score_package`.`zb_id` AS `zb_id`,
  3575. `hnqzx`.`wm_score_package`.`xxdb_id` AS `xxdb_id`,
  3576. `hnqzx`.`wm_score_package`.`typeid` AS `typeid`,
  3577. `hnqzx`.`wm_score_package`.`package_status` AS `package_status`,
  3578. `hnqzx`.`wm_score_package`.`package_finish_status` AS `package_finish_status`,
  3579. `hnqzx`.`wm_score_package`.`package_audit_status` AS `package_audit_status`,
  3580. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  3581. `hnqzx`.`wm_score_package`.`dept_id` AS `dept_id`,
  3582. `hnqzx`.`wm_score_package`.`del_flag` AS `del_flag`,
  3583. `hnqzx`.`wm_score_package`.`enable_flag` AS `enable_flag`,
  3584. `hnqzx`.`wm_score_package`.`tenant_id` AS `tenant_id`,
  3585. `hnqzx`.`wm_score_package`.`create_time` AS `create_time`,
  3586. `hnqzx`.`wm_score_package`.`create_user` AS `create_user`,
  3587. `hnqzx`.`wm_score_package`.`update_time` AS `update_time`,
  3588. `hnqzx`.`wm_score_package`.`update_user` AS `update_user`,
  3589. `hnqzx`.`wm_score_package`.`receive_date` AS `receive_date`,
  3590. `hnqzx`.`wm_score_package`.`is_conduct` AS `is_conduct`,
  3591. `bb`.`ytj` AS `ytj`,
  3592. `bb`.`ysh` AS `ysh`,
  3593. `bb`.`dsh` AS `dsh`,
  3594. 3 AS `t_type`
  3595. from (`hnqzx`.`wm_score_package` left join (select `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_id`,
  3596. sum(if((`hnqzx`.`wm_task`.`task_status` > 0),
  3597. `hnqzx`.`wm_task`.`score`, 0)) AS `ytj`,
  3598. sum(if((`hnqzx`.`wm_task`.`task_status` = 3),
  3599. `hnqzx`.`wm_task`.`score`, 0)) AS `ysh`,
  3600. sum(if((`hnqzx`.`wm_task`.`task_status` = 2),
  3601. `hnqzx`.`wm_task`.`score`, 0)) AS `dsh`
  3602. from `hnqzx`.`wm_task`
  3603. where ((`hnqzx`.`wm_task`.`score_package_id` is not null) and
  3604. (`hnqzx`.`wm_task`.`real_flag` = '0'))
  3605. group by `hnqzx`.`wm_task`.`score_package_drug_id`) `bb`
  3606. on ((`hnqzx`.`wm_score_package`.`id` = `bb`.`score_package_id`)))
  3607. where ((`hnqzx`.`wm_score_package`.`del_flag` = '0') and (`hnqzx`.`wm_score_package`.`enable_flag` = '0') and
  3608. (`hnqzx`.`wm_score_package`.`agent_type_id` = 1))) `ccc`
  3609. order by `ccc`.`agent_type_id`, `ccc`.`create_time` desc;
  3610. create definer = root@`%` view view_wm_socre_package_total_20210115 as
  3611. select `ccc`.`id` AS `id`,
  3612. `ccc`.`invoice_category` AS `invoice_category`,
  3613. `ccc`.`settle_status` AS `settle_status`,
  3614. `ccc`.`settle_amount` AS `settle_amount`,
  3615. `ccc`.`discount` AS `discount`,
  3616. `ccc`.`task_rule_id` AS `task_rule_id`,
  3617. `ccc`.`drug_ent_id` AS `drug_ent_id`,
  3618. `ccc`.`score_id` AS `score_id`,
  3619. `ccc`.`score_name` AS `score_name`,
  3620. `ccc`.`score` AS `score`,
  3621. `ccc`.`agent_type_id` AS `agent_type_id`,
  3622. `ccc`.`level1_id` AS `level1_id`,
  3623. `ccc`.`level2_id` AS `level2_id`,
  3624. `ccc`.`zb_id` AS `zb_id`,
  3625. `ccc`.`xxdb_id` AS `xxdb_id`,
  3626. `ccc`.`typeid` AS `typeid`,
  3627. `ccc`.`package_status` AS `package_status`,
  3628. `ccc`.`package_finish_status` AS `package_finish_status`,
  3629. `ccc`.`package_audit_status` AS `package_audit_status`,
  3630. `ccc`.`send_package_dept_id` AS `send_package_dept_id`,
  3631. `ccc`.`dept_id` AS `dept_id`,
  3632. `ccc`.`del_flag` AS `del_flag`,
  3633. `ccc`.`enable_flag` AS `enable_flag`,
  3634. `ccc`.`tenant_id` AS `tenant_id`,
  3635. `ccc`.`create_time` AS `create_time`,
  3636. `ccc`.`create_user` AS `create_user`,
  3637. `ccc`.`update_time` AS `update_time`,
  3638. `ccc`.`update_user` AS `update_user`,
  3639. `ccc`.`receive_date` AS `receive_date`,
  3640. `ccc`.`ytj` AS `ytj`,
  3641. `ccc`.`ysh` AS `ysh`,
  3642. `ccc`.`dsh` AS `dsh`,
  3643. `ccc`.`t_type` AS `t_type`
  3644. from (select `hnqzx`.`wm_score_package`.`id` AS `id`,
  3645. `hnqzx`.`wm_score_package`.`invoice_category` AS `invoice_category`,
  3646. `hnqzx`.`wm_score_package`.`settle_status` AS `settle_status`,
  3647. `hnqzx`.`wm_score_package`.`settle_amount` AS `settle_amount`,
  3648. `hnqzx`.`wm_score_package`.`discount` AS `discount`,
  3649. `hnqzx`.`wm_score_package`.`task_rule_id` AS `task_rule_id`,
  3650. `hnqzx`.`wm_score_package`.`drug_ent_id` AS `drug_ent_id`,
  3651. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  3652. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  3653. `hnqzx`.`wm_score_package`.`score` AS `score`,
  3654. `hnqzx`.`wm_score_package`.`agent_type_id` AS `agent_type_id`,
  3655. `hnqzx`.`wm_score_package`.`level1_id` AS `level1_id`,
  3656. `hnqzx`.`wm_score_package`.`level2_id` AS `level2_id`,
  3657. `hnqzx`.`wm_score_package`.`zb_id` AS `zb_id`,
  3658. `hnqzx`.`wm_score_package`.`xxdb_id` AS `xxdb_id`,
  3659. `hnqzx`.`wm_score_package`.`typeid` AS `typeid`,
  3660. `hnqzx`.`wm_score_package`.`package_status` AS `package_status`,
  3661. `hnqzx`.`wm_score_package`.`package_finish_status` AS `package_finish_status`,
  3662. `hnqzx`.`wm_score_package`.`package_audit_status` AS `package_audit_status`,
  3663. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  3664. `hnqzx`.`wm_score_package`.`dept_id` AS `dept_id`,
  3665. `hnqzx`.`wm_score_package`.`del_flag` AS `del_flag`,
  3666. `hnqzx`.`wm_score_package`.`enable_flag` AS `enable_flag`,
  3667. `hnqzx`.`wm_score_package`.`tenant_id` AS `tenant_id`,
  3668. `hnqzx`.`wm_score_package`.`create_time` AS `create_time`,
  3669. `hnqzx`.`wm_score_package`.`create_user` AS `create_user`,
  3670. `hnqzx`.`wm_score_package`.`update_time` AS `update_time`,
  3671. `hnqzx`.`wm_score_package`.`update_user` AS `update_user`,
  3672. `hnqzx`.`wm_score_package`.`receive_date` AS `receive_date`,
  3673. `hnqzx`.`wm_score_package`.`is_conduct` AS `is_conduct`,
  3674. `bb`.`ytj` AS `ytj`,
  3675. `bb`.`ysh` AS `ysh`,
  3676. `bb`.`dsh` AS `dsh`,
  3677. 1 AS `t_type`
  3678. from (`hnqzx`.`wm_score_package` left join (select `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  3679. sum(if((`hnqzx`.`wm_task`.`task_status` > 0),
  3680. `hnqzx`.`wm_task`.`score`, 0)) AS `ytj`,
  3681. sum(if((`hnqzx`.`wm_task`.`task_status` = 3),
  3682. `hnqzx`.`wm_task`.`score`, 0)) AS `ysh`,
  3683. sum(if((`hnqzx`.`wm_task`.`task_status` = 2),
  3684. `hnqzx`.`wm_task`.`score`, 0)) AS `dsh`
  3685. from `hnqzx`.`wm_task`
  3686. where (`hnqzx`.`wm_task`.`score_package_id` is not null)
  3687. group by `hnqzx`.`wm_task`.`score_package_id`) `bb`
  3688. on ((`hnqzx`.`wm_score_package`.`id` = `bb`.`score_package_id`)))
  3689. where ((`hnqzx`.`wm_score_package`.`del_flag` = '0') and (`hnqzx`.`wm_score_package`.`enable_flag` = '0') and
  3690. (`hnqzx`.`wm_score_package`.`agent_type_id` = 2) and (`hnqzx`.`wm_score_package`.`typeid` in (3, 4)))
  3691. union
  3692. select `hnqzx`.`wm_score_package`.`id` AS `id`,
  3693. `hnqzx`.`wm_score_package`.`invoice_category` AS `invoice_category`,
  3694. `hnqzx`.`wm_score_package`.`settle_status` AS `settle_status`,
  3695. `hnqzx`.`wm_score_package`.`settle_amount` AS `settle_amount`,
  3696. `hnqzx`.`wm_score_package`.`discount` AS `discount`,
  3697. `hnqzx`.`wm_score_package`.`task_rule_id` AS `task_rule_id`,
  3698. `hnqzx`.`wm_score_package`.`drug_ent_id` AS `drug_ent_id`,
  3699. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  3700. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  3701. `hnqzx`.`wm_score_package`.`score` AS `score`,
  3702. `hnqzx`.`wm_score_package`.`agent_type_id` AS `agent_type_id`,
  3703. `hnqzx`.`wm_score_package`.`level1_id` AS `level1_id`,
  3704. `hnqzx`.`wm_score_package`.`level2_id` AS `level2_id`,
  3705. `hnqzx`.`wm_score_package`.`zb_id` AS `zb_id`,
  3706. `hnqzx`.`wm_score_package`.`xxdb_id` AS `xxdb_id`,
  3707. `hnqzx`.`wm_score_package`.`typeid` AS `typeid`,
  3708. `hnqzx`.`wm_score_package`.`package_status` AS `package_status`,
  3709. `hnqzx`.`wm_score_package`.`package_finish_status` AS `package_finish_status`,
  3710. `hnqzx`.`wm_score_package`.`package_audit_status` AS `package_audit_status`,
  3711. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  3712. `hnqzx`.`wm_score_package`.`dept_id` AS `dept_id`,
  3713. `hnqzx`.`wm_score_package`.`del_flag` AS `del_flag`,
  3714. `hnqzx`.`wm_score_package`.`enable_flag` AS `enable_flag`,
  3715. `hnqzx`.`wm_score_package`.`tenant_id` AS `tenant_id`,
  3716. `hnqzx`.`wm_score_package`.`create_time` AS `create_time`,
  3717. `hnqzx`.`wm_score_package`.`create_user` AS `create_user`,
  3718. `hnqzx`.`wm_score_package`.`update_time` AS `update_time`,
  3719. `hnqzx`.`wm_score_package`.`update_user` AS `update_user`,
  3720. `hnqzx`.`wm_score_package`.`receive_date` AS `receive_date`,
  3721. `hnqzx`.`wm_score_package`.`is_conduct` AS `is_conduct`,
  3722. `bb`.`ytj` AS `ytj`,
  3723. `bb`.`ysh` AS `ysh`,
  3724. `bb`.`dsh` AS `dsh`,
  3725. 2 AS `t_type`
  3726. from (`hnqzx`.`wm_score_package` left join (select `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_id`,
  3727. sum(if((`hnqzx`.`wm_task`.`task_status` > 0),
  3728. `hnqzx`.`wm_task`.`score`, 0)) AS `ytj`,
  3729. sum(if((`hnqzx`.`wm_task`.`task_status` = 3),
  3730. `hnqzx`.`wm_task`.`score`, 0)) AS `ysh`,
  3731. sum(if((`hnqzx`.`wm_task`.`task_status` = 2),
  3732. `hnqzx`.`wm_task`.`score`, 0)) AS `dsh`
  3733. from `hnqzx`.`wm_task`
  3734. where (`hnqzx`.`wm_task`.`score_package_id` is not null)
  3735. group by `hnqzx`.`wm_task`.`score_package_level1_id`) `bb`
  3736. on ((`hnqzx`.`wm_score_package`.`id` = `bb`.`score_package_id`)))
  3737. where ((`hnqzx`.`wm_score_package`.`del_flag` = '0') and (`hnqzx`.`wm_score_package`.`enable_flag` = '0') and
  3738. (`hnqzx`.`wm_score_package`.`agent_type_id` = 2) and (`hnqzx`.`wm_score_package`.`typeid` = 2))
  3739. union
  3740. select `hnqzx`.`wm_score_package`.`id` AS `id`,
  3741. `hnqzx`.`wm_score_package`.`invoice_category` AS `invoice_category`,
  3742. `hnqzx`.`wm_score_package`.`settle_status` AS `settle_status`,
  3743. `hnqzx`.`wm_score_package`.`settle_amount` AS `settle_amount`,
  3744. `hnqzx`.`wm_score_package`.`discount` AS `discount`,
  3745. `hnqzx`.`wm_score_package`.`task_rule_id` AS `task_rule_id`,
  3746. `hnqzx`.`wm_score_package`.`drug_ent_id` AS `drug_ent_id`,
  3747. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  3748. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  3749. `hnqzx`.`wm_score_package`.`score` AS `score`,
  3750. `hnqzx`.`wm_score_package`.`agent_type_id` AS `agent_type_id`,
  3751. `hnqzx`.`wm_score_package`.`level1_id` AS `level1_id`,
  3752. `hnqzx`.`wm_score_package`.`level2_id` AS `level2_id`,
  3753. `hnqzx`.`wm_score_package`.`zb_id` AS `zb_id`,
  3754. `hnqzx`.`wm_score_package`.`xxdb_id` AS `xxdb_id`,
  3755. `hnqzx`.`wm_score_package`.`typeid` AS `typeid`,
  3756. `hnqzx`.`wm_score_package`.`package_status` AS `package_status`,
  3757. `hnqzx`.`wm_score_package`.`package_finish_status` AS `package_finish_status`,
  3758. `hnqzx`.`wm_score_package`.`package_audit_status` AS `package_audit_status`,
  3759. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  3760. `hnqzx`.`wm_score_package`.`dept_id` AS `dept_id`,
  3761. `hnqzx`.`wm_score_package`.`del_flag` AS `del_flag`,
  3762. `hnqzx`.`wm_score_package`.`enable_flag` AS `enable_flag`,
  3763. `hnqzx`.`wm_score_package`.`tenant_id` AS `tenant_id`,
  3764. `hnqzx`.`wm_score_package`.`create_time` AS `create_time`,
  3765. `hnqzx`.`wm_score_package`.`create_user` AS `create_user`,
  3766. `hnqzx`.`wm_score_package`.`update_time` AS `update_time`,
  3767. `hnqzx`.`wm_score_package`.`update_user` AS `update_user`,
  3768. `hnqzx`.`wm_score_package`.`receive_date` AS `receive_date`,
  3769. `hnqzx`.`wm_score_package`.`is_conduct` AS `is_conduct`,
  3770. `bb`.`ytj` AS `ytj`,
  3771. `bb`.`ysh` AS `ysh`,
  3772. `bb`.`dsh` AS `dsh`,
  3773. 3 AS `t_type`
  3774. from (`hnqzx`.`wm_score_package` left join (select `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_id`,
  3775. sum(if((`hnqzx`.`wm_task`.`task_status` > 0),
  3776. `hnqzx`.`wm_task`.`score`, 0)) AS `ytj`,
  3777. sum(if((`hnqzx`.`wm_task`.`task_status` = 3),
  3778. `hnqzx`.`wm_task`.`score`, 0)) AS `ysh`,
  3779. sum(if((`hnqzx`.`wm_task`.`task_status` = 2),
  3780. `hnqzx`.`wm_task`.`score`, 0)) AS `dsh`
  3781. from `hnqzx`.`wm_task`
  3782. where (`hnqzx`.`wm_task`.`score_package_id` is not null)
  3783. group by `hnqzx`.`wm_task`.`score_package_drug_id`) `bb`
  3784. on ((`hnqzx`.`wm_score_package`.`id` = `bb`.`score_package_id`)))
  3785. where ((`hnqzx`.`wm_score_package`.`del_flag` = '0') and (`hnqzx`.`wm_score_package`.`enable_flag` = '0') and
  3786. (`hnqzx`.`wm_score_package`.`agent_type_id` = 1))) `ccc`
  3787. order by `ccc`.`agent_type_id`, `ccc`.`create_time` desc;
  3788. create definer = root@`%` view wm_zb_count as
  3789. select distinct `ccc`.`package_id` AS `package_id`,
  3790. `ccc`.`score_name` AS `score_name`,
  3791. `ccc`.`score_id` AS `score_id`,
  3792. `ccc`.`package_score` AS `package_score`,
  3793. `ccc`.`send_package_dept_id` AS `send_package_dept_id`,
  3794. `ccc`.`pcreate_time` AS `pcreate_time`,
  3795. `ccc`.`realname` AS `realname`,
  3796. `ccc`.`idcard` AS `idcard`,
  3797. `ccc`.`phone` AS `phone`,
  3798. `ccc`.`dept_name` AS `dept_name`,
  3799. `ccc`.`user_id` AS `user_id`,
  3800. `ccc`.`task_type_name` AS `task_type_name`,
  3801. `ccc`.`base_id` AS `base_id`,
  3802. `ccc`.`id` AS `id`,
  3803. `ccc`.`task_rule_id` AS `task_rule_id`,
  3804. `ccc`.`score` AS `score`,
  3805. `ccc`.`score_package_drug_id` AS `score_package_drug_id`,
  3806. `ccc`.`score_package_level1_id` AS `score_package_level1_id`,
  3807. `ccc`.`score_package_id` AS `score_package_id`,
  3808. `ccc`.`task_type_id` AS `task_type_id`,
  3809. `ccc`.`lookinto_date` AS `lookinto_date`,
  3810. `ccc`.`province` AS `province`,
  3811. `ccc`.`city` AS `city`,
  3812. `ccc`.`area` AS `area`,
  3813. `ccc`.`address` AS `address`,
  3814. `ccc`.`lookinto_type_id` AS `lookinto_type_id`,
  3815. `ccc`.`task_content_id` AS `task_content_id`,
  3816. `ccc`.`task_status` AS `task_status`,
  3817. `ccc`.`task_user_id` AS `task_user_id`,
  3818. `ccc`.`task_user_type` AS `task_user_type`,
  3819. `ccc`.`drug_ent_id` AS `drug_ent_id`,
  3820. `ccc`.`dept_id` AS `dept_id`,
  3821. `ccc`.`del_flag` AS `del_flag`,
  3822. `ccc`.`enable_flag` AS `enable_flag`,
  3823. `ccc`.`tenant_id` AS `tenant_id`,
  3824. `ccc`.`lookinto_date` AS `create_time`,
  3825. `ccc`.`create_user` AS `create_user`,
  3826. `ccc`.`update_time` AS `update_time`,
  3827. `ccc`.`update_user` AS `update_user`,
  3828. `ccc`.`submit_status` AS `submit_status`,
  3829. `ccc`.`share_img_url` AS `share_img_url`,
  3830. `ccc`.`plat_audit_status` AS `plat_audit_status`,
  3831. `ccc`.`ext_ids` AS `ext_ids`,
  3832. `ccc`.`task_info_img` AS `task_info_img`,
  3833. `ccc`.`t_type` AS `t_type`
  3834. from (select `hnqzx`.`wm_score_package`.`id` AS `package_id`,
  3835. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  3836. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  3837. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  3838. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  3839. `hnqzx`.`wm_score_package`.`create_time` AS `pcreate_time`,
  3840. `hnqzx`.`sys_user`.`realname` AS `realname`,
  3841. `hnqzx`.`sys_user`.`id_card_number` AS `idcard`,
  3842. `hnqzx`.`sys_user`.`phone` AS `phone`,
  3843. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  3844. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  3845. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  3846. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  3847. `hnqzx`.`wm_task`.`id` AS `id`,
  3848. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  3849. `hnqzx`.`wm_task`.`score` AS `score`,
  3850. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  3851. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  3852. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  3853. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  3854. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  3855. `hnqzx`.`wm_task`.`province` AS `province`,
  3856. `hnqzx`.`wm_task`.`city` AS `city`,
  3857. `hnqzx`.`wm_task`.`area` AS `area`,
  3858. `hnqzx`.`wm_task`.`address` AS `address`,
  3859. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  3860. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  3861. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  3862. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  3863. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  3864. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  3865. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  3866. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  3867. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  3868. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  3869. `hnqzx`.`wm_task`.`lookinto_date` AS `create_time`,
  3870. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  3871. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  3872. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  3873. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  3874. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  3875. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  3876. `hnqzx`.`wm_task`.`real_flag` AS `real_flag`,
  3877. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  3878. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  3879. 1 AS `t_type`
  3880. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_id` =
  3881. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  3882. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  3883. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  3884. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))
  3885. union
  3886. select `hnqzx`.`wm_task`.`score_package_drug_id` AS `package_id`,
  3887. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  3888. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  3889. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  3890. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  3891. `hnqzx`.`wm_score_package`.`create_time` AS `pcreate_time`,
  3892. `hnqzx`.`sys_user`.`realname` AS `realname`,
  3893. `hnqzx`.`sys_user`.`id_card_number` AS `idcard`,
  3894. `hnqzx`.`sys_user`.`phone` AS `phone`,
  3895. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  3896. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  3897. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  3898. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  3899. `hnqzx`.`wm_task`.`id` AS `id`,
  3900. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  3901. `hnqzx`.`wm_task`.`score` AS `score`,
  3902. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  3903. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  3904. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  3905. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  3906. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  3907. `hnqzx`.`wm_task`.`province` AS `province`,
  3908. `hnqzx`.`wm_task`.`city` AS `city`,
  3909. `hnqzx`.`wm_task`.`area` AS `area`,
  3910. `hnqzx`.`wm_task`.`address` AS `address`,
  3911. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  3912. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  3913. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  3914. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  3915. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  3916. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  3917. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  3918. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  3919. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  3920. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  3921. `hnqzx`.`wm_task`.`lookinto_date` AS `create_time`,
  3922. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  3923. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  3924. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  3925. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  3926. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  3927. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  3928. `hnqzx`.`wm_task`.`real_flag` AS `real_flag`,
  3929. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  3930. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  3931. 2 AS `t_type`
  3932. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_drug_id` =
  3933. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  3934. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  3935. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  3936. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))
  3937. union
  3938. select `hnqzx`.`wm_task`.`score_package_level1_id` AS `package_id`,
  3939. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  3940. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  3941. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  3942. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  3943. `hnqzx`.`wm_score_package`.`create_time` AS `pcreate_time`,
  3944. `hnqzx`.`sys_user`.`realname` AS `realname`,
  3945. `hnqzx`.`sys_user`.`id_card_number` AS `idcard`,
  3946. `hnqzx`.`sys_user`.`phone` AS `phone`,
  3947. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  3948. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  3949. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  3950. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  3951. `hnqzx`.`wm_task`.`id` AS `id`,
  3952. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  3953. `hnqzx`.`wm_task`.`score` AS `score`,
  3954. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  3955. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  3956. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  3957. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  3958. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  3959. `hnqzx`.`wm_task`.`province` AS `province`,
  3960. `hnqzx`.`wm_task`.`city` AS `city`,
  3961. `hnqzx`.`wm_task`.`area` AS `area`,
  3962. `hnqzx`.`wm_task`.`address` AS `address`,
  3963. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  3964. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  3965. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  3966. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  3967. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  3968. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  3969. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  3970. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  3971. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  3972. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  3973. `hnqzx`.`wm_task`.`lookinto_date` AS `create_time`,
  3974. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  3975. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  3976. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  3977. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  3978. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  3979. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  3980. `hnqzx`.`wm_task`.`real_flag` AS `real_flag`,
  3981. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  3982. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  3983. 3 AS `t_type`
  3984. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_level1_id` =
  3985. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  3986. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  3987. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  3988. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))) `ccc`
  3989. where ((`ccc`.`package_id` is not null) and (`ccc`.`task_status` = 3) and (`ccc`.`enable_flag` = 0) and
  3990. (`ccc`.`del_flag` = 0) and (`ccc`.`real_flag` = '0'))
  3991. order by `ccc`.`task_rule_id`, `ccc`.`task_user_id`, `ccc`.`lookinto_date`;
  3992. create definer = root@`%` view wm_zb_count_20210115 as
  3993. select distinct `ccc`.`package_id` AS `package_id`,
  3994. `ccc`.`score_name` AS `score_name`,
  3995. `ccc`.`score_id` AS `score_id`,
  3996. `ccc`.`package_score` AS `package_score`,
  3997. `ccc`.`send_package_dept_id` AS `send_package_dept_id`,
  3998. `ccc`.`pcreate_time` AS `pcreate_time`,
  3999. `ccc`.`realname` AS `realname`,
  4000. `ccc`.`idcard` AS `idcard`,
  4001. `ccc`.`phone` AS `phone`,
  4002. `ccc`.`dept_name` AS `dept_name`,
  4003. `ccc`.`user_id` AS `user_id`,
  4004. `ccc`.`task_type_name` AS `task_type_name`,
  4005. `ccc`.`base_id` AS `base_id`,
  4006. `ccc`.`id` AS `id`,
  4007. `ccc`.`task_rule_id` AS `task_rule_id`,
  4008. `ccc`.`score` AS `score`,
  4009. `ccc`.`score_package_drug_id` AS `score_package_drug_id`,
  4010. `ccc`.`score_package_level1_id` AS `score_package_level1_id`,
  4011. `ccc`.`score_package_id` AS `score_package_id`,
  4012. `ccc`.`task_type_id` AS `task_type_id`,
  4013. `ccc`.`lookinto_date` AS `lookinto_date`,
  4014. `ccc`.`province` AS `province`,
  4015. `ccc`.`city` AS `city`,
  4016. `ccc`.`area` AS `area`,
  4017. `ccc`.`address` AS `address`,
  4018. `ccc`.`lookinto_type_id` AS `lookinto_type_id`,
  4019. `ccc`.`task_content_id` AS `task_content_id`,
  4020. `ccc`.`task_status` AS `task_status`,
  4021. `ccc`.`task_user_id` AS `task_user_id`,
  4022. `ccc`.`task_user_type` AS `task_user_type`,
  4023. `ccc`.`drug_ent_id` AS `drug_ent_id`,
  4024. `ccc`.`dept_id` AS `dept_id`,
  4025. `ccc`.`del_flag` AS `del_flag`,
  4026. `ccc`.`enable_flag` AS `enable_flag`,
  4027. `ccc`.`tenant_id` AS `tenant_id`,
  4028. `ccc`.`lookinto_date` AS `create_time`,
  4029. `ccc`.`create_user` AS `create_user`,
  4030. `ccc`.`update_time` AS `update_time`,
  4031. `ccc`.`update_user` AS `update_user`,
  4032. `ccc`.`submit_status` AS `submit_status`,
  4033. `ccc`.`share_img_url` AS `share_img_url`,
  4034. `ccc`.`plat_audit_status` AS `plat_audit_status`,
  4035. `ccc`.`ext_ids` AS `ext_ids`,
  4036. `ccc`.`task_info_img` AS `task_info_img`,
  4037. `ccc`.`t_type` AS `t_type`
  4038. from (select `hnqzx`.`wm_score_package`.`id` AS `package_id`,
  4039. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  4040. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  4041. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  4042. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  4043. `hnqzx`.`wm_score_package`.`create_time` AS `pcreate_time`,
  4044. `hnqzx`.`sys_user`.`realname` AS `realname`,
  4045. `hnqzx`.`sys_user`.`temp1` AS `idcard`,
  4046. `hnqzx`.`sys_user`.`phone` AS `phone`,
  4047. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  4048. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  4049. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  4050. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  4051. `hnqzx`.`wm_task`.`id` AS `id`,
  4052. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  4053. `hnqzx`.`wm_task`.`score` AS `score`,
  4054. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  4055. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  4056. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  4057. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  4058. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  4059. `hnqzx`.`wm_task`.`province` AS `province`,
  4060. `hnqzx`.`wm_task`.`city` AS `city`,
  4061. `hnqzx`.`wm_task`.`area` AS `area`,
  4062. `hnqzx`.`wm_task`.`address` AS `address`,
  4063. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  4064. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  4065. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  4066. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  4067. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  4068. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  4069. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  4070. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  4071. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  4072. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  4073. `hnqzx`.`wm_task`.`lookinto_date` AS `create_time`,
  4074. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  4075. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  4076. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  4077. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  4078. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  4079. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  4080. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  4081. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  4082. 1 AS `t_type`
  4083. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_id` =
  4084. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  4085. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  4086. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  4087. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))
  4088. union
  4089. select `hnqzx`.`wm_task`.`score_package_drug_id` AS `package_id`,
  4090. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  4091. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  4092. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  4093. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  4094. `hnqzx`.`wm_score_package`.`create_time` AS `pcreate_time`,
  4095. `hnqzx`.`sys_user`.`realname` AS `realname`,
  4096. `hnqzx`.`sys_user`.`temp1` AS `idcard`,
  4097. `hnqzx`.`sys_user`.`phone` AS `phone`,
  4098. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  4099. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  4100. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  4101. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  4102. `hnqzx`.`wm_task`.`id` AS `id`,
  4103. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  4104. `hnqzx`.`wm_task`.`score` AS `score`,
  4105. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  4106. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  4107. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  4108. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  4109. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  4110. `hnqzx`.`wm_task`.`province` AS `province`,
  4111. `hnqzx`.`wm_task`.`city` AS `city`,
  4112. `hnqzx`.`wm_task`.`area` AS `area`,
  4113. `hnqzx`.`wm_task`.`address` AS `address`,
  4114. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  4115. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  4116. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  4117. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  4118. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  4119. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  4120. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  4121. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  4122. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  4123. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  4124. `hnqzx`.`wm_task`.`lookinto_date` AS `create_time`,
  4125. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  4126. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  4127. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  4128. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  4129. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  4130. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  4131. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  4132. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  4133. 2 AS `t_type`
  4134. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_drug_id` =
  4135. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  4136. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  4137. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  4138. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))
  4139. union
  4140. select `hnqzx`.`wm_task`.`score_package_level1_id` AS `package_id`,
  4141. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  4142. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  4143. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  4144. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  4145. `hnqzx`.`wm_score_package`.`create_time` AS `pcreate_time`,
  4146. `hnqzx`.`sys_user`.`realname` AS `realname`,
  4147. `hnqzx`.`sys_user`.`temp1` AS `idcard`,
  4148. `hnqzx`.`sys_user`.`phone` AS `phone`,
  4149. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  4150. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  4151. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  4152. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  4153. `hnqzx`.`wm_task`.`id` AS `id`,
  4154. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  4155. `hnqzx`.`wm_task`.`score` AS `score`,
  4156. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  4157. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  4158. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  4159. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  4160. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  4161. `hnqzx`.`wm_task`.`province` AS `province`,
  4162. `hnqzx`.`wm_task`.`city` AS `city`,
  4163. `hnqzx`.`wm_task`.`area` AS `area`,
  4164. `hnqzx`.`wm_task`.`address` AS `address`,
  4165. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  4166. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  4167. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  4168. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  4169. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  4170. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  4171. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  4172. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  4173. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  4174. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  4175. `hnqzx`.`wm_task`.`lookinto_date` AS `create_time`,
  4176. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  4177. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  4178. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  4179. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  4180. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  4181. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  4182. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  4183. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  4184. 3 AS `t_type`
  4185. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_level1_id` =
  4186. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  4187. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  4188. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  4189. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))) `ccc`
  4190. where ((`ccc`.`package_id` is not null) and (`ccc`.`task_status` = 3) and (`ccc`.`enable_flag` = 0) and
  4191. (`ccc`.`del_flag` = 0))
  4192. order by `ccc`.`task_rule_id`, `ccc`.`task_user_id`, `ccc`.`lookinto_date`;
  4193. create definer = root@`%` view wm_zb_count_copy as
  4194. select distinct `ccc`.`package_id` AS `package_id`,
  4195. `ccc`.`score_name` AS `score_name`,
  4196. `ccc`.`score_id` AS `score_id`,
  4197. `ccc`.`package_score` AS `package_score`,
  4198. `ccc`.`send_package_dept_id` AS `send_package_dept_id`,
  4199. `ccc`.`pcreate_time` AS `pcreate_time`,
  4200. `ccc`.`realname` AS `realname`,
  4201. `ccc`.`idcard` AS `idcard`,
  4202. `ccc`.`phone` AS `phone`,
  4203. `ccc`.`dept_name` AS `dept_name`,
  4204. `ccc`.`user_id` AS `user_id`,
  4205. `ccc`.`task_type_name` AS `task_type_name`,
  4206. `ccc`.`base_id` AS `base_id`,
  4207. `ccc`.`id` AS `id`,
  4208. `ccc`.`task_rule_id` AS `task_rule_id`,
  4209. `ccc`.`score` AS `score`,
  4210. `ccc`.`score_package_drug_id` AS `score_package_drug_id`,
  4211. `ccc`.`score_package_level1_id` AS `score_package_level1_id`,
  4212. `ccc`.`score_package_id` AS `score_package_id`,
  4213. `ccc`.`task_type_id` AS `task_type_id`,
  4214. `ccc`.`lookinto_date` AS `lookinto_date`,
  4215. `ccc`.`province` AS `province`,
  4216. `ccc`.`city` AS `city`,
  4217. `ccc`.`area` AS `area`,
  4218. `ccc`.`address` AS `address`,
  4219. `ccc`.`lookinto_type_id` AS `lookinto_type_id`,
  4220. `ccc`.`task_content_id` AS `task_content_id`,
  4221. `ccc`.`task_status` AS `task_status`,
  4222. `ccc`.`task_user_id` AS `task_user_id`,
  4223. `ccc`.`task_user_type` AS `task_user_type`,
  4224. `ccc`.`drug_ent_id` AS `drug_ent_id`,
  4225. `ccc`.`dept_id` AS `dept_id`,
  4226. `ccc`.`del_flag` AS `del_flag`,
  4227. `ccc`.`enable_flag` AS `enable_flag`,
  4228. `ccc`.`tenant_id` AS `tenant_id`,
  4229. `ccc`.`lookinto_date` AS `create_time`,
  4230. `ccc`.`create_user` AS `create_user`,
  4231. `ccc`.`update_time` AS `update_time`,
  4232. `ccc`.`update_user` AS `update_user`,
  4233. `ccc`.`submit_status` AS `submit_status`,
  4234. `ccc`.`share_img_url` AS `share_img_url`,
  4235. `ccc`.`plat_audit_status` AS `plat_audit_status`,
  4236. `ccc`.`ext_ids` AS `ext_ids`,
  4237. `ccc`.`task_info_img` AS `task_info_img`,
  4238. `ccc`.`t_type` AS `t_type`
  4239. from (select `hnqzx`.`wm_score_package`.`id` AS `package_id`,
  4240. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  4241. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  4242. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  4243. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  4244. `hnqzx`.`wm_score_package`.`create_time` AS `pcreate_time`,
  4245. `hnqzx`.`sys_user`.`realname` AS `realname`,
  4246. `hnqzx`.`sys_user`.`temp1` AS `idcard`,
  4247. `hnqzx`.`sys_user`.`phone` AS `phone`,
  4248. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  4249. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  4250. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  4251. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  4252. `hnqzx`.`wm_task`.`id` AS `id`,
  4253. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  4254. `hnqzx`.`wm_task`.`score` AS `score`,
  4255. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  4256. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  4257. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  4258. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  4259. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  4260. `hnqzx`.`wm_task`.`province` AS `province`,
  4261. `hnqzx`.`wm_task`.`city` AS `city`,
  4262. `hnqzx`.`wm_task`.`area` AS `area`,
  4263. `hnqzx`.`wm_task`.`address` AS `address`,
  4264. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  4265. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  4266. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  4267. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  4268. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  4269. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  4270. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  4271. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  4272. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  4273. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  4274. `hnqzx`.`wm_task`.`lookinto_date` AS `create_time`,
  4275. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  4276. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  4277. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  4278. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  4279. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  4280. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  4281. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  4282. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  4283. 1 AS `t_type`
  4284. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_id` =
  4285. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  4286. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  4287. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  4288. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))
  4289. union
  4290. select `hnqzx`.`wm_task`.`score_package_drug_id` AS `package_id`,
  4291. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  4292. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  4293. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  4294. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  4295. `hnqzx`.`wm_score_package`.`create_time` AS `pcreate_time`,
  4296. `hnqzx`.`sys_user`.`realname` AS `realname`,
  4297. `hnqzx`.`sys_user`.`temp1` AS `idcard`,
  4298. `hnqzx`.`sys_user`.`phone` AS `phone`,
  4299. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  4300. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  4301. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  4302. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  4303. `hnqzx`.`wm_task`.`id` AS `id`,
  4304. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  4305. `hnqzx`.`wm_task`.`score` AS `score`,
  4306. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  4307. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  4308. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  4309. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  4310. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  4311. `hnqzx`.`wm_task`.`province` AS `province`,
  4312. `hnqzx`.`wm_task`.`city` AS `city`,
  4313. `hnqzx`.`wm_task`.`area` AS `area`,
  4314. `hnqzx`.`wm_task`.`address` AS `address`,
  4315. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  4316. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  4317. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  4318. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  4319. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  4320. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  4321. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  4322. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  4323. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  4324. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  4325. `hnqzx`.`wm_task`.`lookinto_date` AS `create_time`,
  4326. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  4327. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  4328. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  4329. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  4330. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  4331. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  4332. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  4333. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  4334. 2 AS `t_type`
  4335. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_drug_id` =
  4336. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  4337. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  4338. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  4339. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))
  4340. union
  4341. select `hnqzx`.`wm_task`.`score_package_level1_id` AS `package_id`,
  4342. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  4343. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  4344. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  4345. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  4346. `hnqzx`.`wm_score_package`.`create_time` AS `pcreate_time`,
  4347. `hnqzx`.`sys_user`.`realname` AS `realname`,
  4348. `hnqzx`.`sys_user`.`temp1` AS `idcard`,
  4349. `hnqzx`.`sys_user`.`phone` AS `phone`,
  4350. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  4351. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  4352. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  4353. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  4354. `hnqzx`.`wm_task`.`id` AS `id`,
  4355. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  4356. `hnqzx`.`wm_task`.`score` AS `score`,
  4357. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  4358. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  4359. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  4360. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  4361. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  4362. `hnqzx`.`wm_task`.`province` AS `province`,
  4363. `hnqzx`.`wm_task`.`city` AS `city`,
  4364. `hnqzx`.`wm_task`.`area` AS `area`,
  4365. `hnqzx`.`wm_task`.`address` AS `address`,
  4366. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  4367. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  4368. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  4369. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  4370. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  4371. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  4372. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  4373. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  4374. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  4375. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  4376. `hnqzx`.`wm_task`.`lookinto_date` AS `create_time`,
  4377. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  4378. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  4379. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  4380. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  4381. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  4382. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  4383. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  4384. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  4385. 3 AS `t_type`
  4386. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_level1_id` =
  4387. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  4388. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  4389. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  4390. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))) `ccc`
  4391. where ((`ccc`.`package_id` is not null) and (`ccc`.`task_status` = 3) and (`ccc`.`enable_flag` = 0) and
  4392. (`ccc`.`del_flag` = 0))
  4393. order by `ccc`.`task_rule_id`, `ccc`.`task_user_id`, `ccc`.`lookinto_date`;
  4394. create definer = root@`%` view wm_zb_count_copy1 as
  4395. select distinct `ccc`.`package_id` AS `package_id`,
  4396. `ccc`.`score_name` AS `score_name`,
  4397. `ccc`.`score_id` AS `score_id`,
  4398. `ccc`.`package_score` AS `package_score`,
  4399. `ccc`.`send_package_dept_id` AS `send_package_dept_id`,
  4400. `ccc`.`realname` AS `realname`,
  4401. `ccc`.`idcard` AS `idcard`,
  4402. `ccc`.`phone` AS `phone`,
  4403. `ccc`.`dept_name` AS `dept_name`,
  4404. `ccc`.`user_id` AS `user_id`,
  4405. `ccc`.`task_type_name` AS `task_type_name`,
  4406. `ccc`.`base_id` AS `base_id`,
  4407. `ccc`.`id` AS `id`,
  4408. `ccc`.`task_rule_id` AS `task_rule_id`,
  4409. `ccc`.`score` AS `score`,
  4410. `ccc`.`score_package_drug_id` AS `score_package_drug_id`,
  4411. `ccc`.`score_package_level1_id` AS `score_package_level1_id`,
  4412. `ccc`.`score_package_id` AS `score_package_id`,
  4413. `ccc`.`task_type_id` AS `task_type_id`,
  4414. `ccc`.`lookinto_date` AS `lookinto_date`,
  4415. `ccc`.`province` AS `province`,
  4416. `ccc`.`city` AS `city`,
  4417. `ccc`.`area` AS `area`,
  4418. `ccc`.`address` AS `address`,
  4419. `ccc`.`lookinto_type_id` AS `lookinto_type_id`,
  4420. `ccc`.`task_content_id` AS `task_content_id`,
  4421. `ccc`.`task_status` AS `task_status`,
  4422. `ccc`.`task_user_id` AS `task_user_id`,
  4423. `ccc`.`task_user_type` AS `task_user_type`,
  4424. `ccc`.`drug_ent_id` AS `drug_ent_id`,
  4425. `ccc`.`dept_id` AS `dept_id`,
  4426. `ccc`.`del_flag` AS `del_flag`,
  4427. `ccc`.`enable_flag` AS `enable_flag`,
  4428. `ccc`.`tenant_id` AS `tenant_id`,
  4429. `ccc`.`create_time` AS `create_time`,
  4430. `ccc`.`create_user` AS `create_user`,
  4431. `ccc`.`update_time` AS `update_time`,
  4432. `ccc`.`update_user` AS `update_user`,
  4433. `ccc`.`submit_status` AS `submit_status`,
  4434. `ccc`.`share_img_url` AS `share_img_url`,
  4435. `ccc`.`plat_audit_status` AS `plat_audit_status`,
  4436. `ccc`.`ext_ids` AS `ext_ids`,
  4437. `ccc`.`task_info_img` AS `task_info_img`,
  4438. `ccc`.`t_type` AS `t_type`
  4439. from (select `hnqzx`.`wm_score_package`.`id` AS `package_id`,
  4440. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  4441. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  4442. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  4443. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  4444. `hnqzx`.`sys_user`.`realname` AS `realname`,
  4445. `hnqzx`.`sys_user`.`temp1` AS `idcard`,
  4446. `hnqzx`.`sys_user`.`phone` AS `phone`,
  4447. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  4448. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  4449. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  4450. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  4451. `hnqzx`.`wm_task`.`id` AS `id`,
  4452. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  4453. `hnqzx`.`wm_task`.`score` AS `score`,
  4454. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  4455. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  4456. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  4457. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  4458. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  4459. `hnqzx`.`wm_task`.`province` AS `province`,
  4460. `hnqzx`.`wm_task`.`city` AS `city`,
  4461. `hnqzx`.`wm_task`.`area` AS `area`,
  4462. `hnqzx`.`wm_task`.`address` AS `address`,
  4463. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  4464. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  4465. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  4466. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  4467. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  4468. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  4469. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  4470. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  4471. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  4472. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  4473. `hnqzx`.`wm_task`.`create_time` AS `create_time`,
  4474. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  4475. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  4476. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  4477. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  4478. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  4479. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  4480. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  4481. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  4482. 1 AS `t_type`
  4483. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_id` =
  4484. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  4485. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  4486. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  4487. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))
  4488. union
  4489. select `hnqzx`.`wm_task`.`score_package_drug_id` AS `package_id`,
  4490. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  4491. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  4492. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  4493. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  4494. `hnqzx`.`sys_user`.`realname` AS `realname`,
  4495. `hnqzx`.`sys_user`.`temp1` AS `idcard`,
  4496. `hnqzx`.`sys_user`.`phone` AS `phone`,
  4497. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  4498. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  4499. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  4500. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  4501. `hnqzx`.`wm_task`.`id` AS `id`,
  4502. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  4503. `hnqzx`.`wm_task`.`score` AS `score`,
  4504. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  4505. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  4506. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  4507. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  4508. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  4509. `hnqzx`.`wm_task`.`province` AS `province`,
  4510. `hnqzx`.`wm_task`.`city` AS `city`,
  4511. `hnqzx`.`wm_task`.`area` AS `area`,
  4512. `hnqzx`.`wm_task`.`address` AS `address`,
  4513. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  4514. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  4515. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  4516. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  4517. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  4518. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  4519. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  4520. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  4521. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  4522. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  4523. `hnqzx`.`wm_task`.`create_time` AS `create_time`,
  4524. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  4525. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  4526. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  4527. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  4528. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  4529. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  4530. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  4531. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  4532. 2 AS `t_type`
  4533. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_drug_id` =
  4534. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  4535. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  4536. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  4537. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))
  4538. union
  4539. select `hnqzx`.`wm_task`.`score_package_level1_id` AS `package_id`,
  4540. `hnqzx`.`wm_score_package`.`score_name` AS `score_name`,
  4541. `hnqzx`.`wm_score_package`.`score` AS `package_score`,
  4542. `hnqzx`.`wm_score_package`.`send_package_dept_id` AS `send_package_dept_id`,
  4543. `hnqzx`.`wm_score_package`.`score_id` AS `score_id`,
  4544. `hnqzx`.`sys_user`.`realname` AS `realname`,
  4545. `hnqzx`.`sys_user`.`temp1` AS `idcard`,
  4546. `hnqzx`.`sys_user`.`phone` AS `phone`,
  4547. `hnqzx`.`sys_dept`.`name` AS `dept_name`,
  4548. `hnqzx`.`sys_user`.`user_id` AS `user_id`,
  4549. `hnqzx`.`wm_task_type`.`task_type_name` AS `task_type_name`,
  4550. `hnqzx`.`wm_task_type`.`base_id` AS `base_id`,
  4551. `hnqzx`.`wm_task`.`id` AS `id`,
  4552. `hnqzx`.`wm_task`.`task_rule_id` AS `task_rule_id`,
  4553. `hnqzx`.`wm_task`.`score` AS `score`,
  4554. `hnqzx`.`wm_task`.`score_package_drug_id` AS `score_package_drug_id`,
  4555. `hnqzx`.`wm_task`.`score_package_level1_id` AS `score_package_level1_id`,
  4556. `hnqzx`.`wm_task`.`score_package_id` AS `score_package_id`,
  4557. `hnqzx`.`wm_task`.`task_type_id` AS `task_type_id`,
  4558. `hnqzx`.`wm_task`.`lookinto_date` AS `lookinto_date`,
  4559. `hnqzx`.`wm_task`.`province` AS `province`,
  4560. `hnqzx`.`wm_task`.`city` AS `city`,
  4561. `hnqzx`.`wm_task`.`area` AS `area`,
  4562. `hnqzx`.`wm_task`.`address` AS `address`,
  4563. `hnqzx`.`wm_task`.`lookinto_type_id` AS `lookinto_type_id`,
  4564. `hnqzx`.`wm_task`.`task_content_id` AS `task_content_id`,
  4565. `hnqzx`.`wm_task`.`task_status` AS `task_status`,
  4566. `hnqzx`.`wm_task`.`task_user_id` AS `task_user_id`,
  4567. `hnqzx`.`wm_task`.`task_user_type` AS `task_user_type`,
  4568. `hnqzx`.`wm_task`.`drug_ent_id` AS `drug_ent_id`,
  4569. `hnqzx`.`wm_task`.`dept_id` AS `dept_id`,
  4570. `hnqzx`.`wm_task`.`del_flag` AS `del_flag`,
  4571. `hnqzx`.`wm_task`.`enable_flag` AS `enable_flag`,
  4572. `hnqzx`.`wm_task`.`tenant_id` AS `tenant_id`,
  4573. `hnqzx`.`wm_task`.`create_time` AS `create_time`,
  4574. `hnqzx`.`wm_task`.`create_user` AS `create_user`,
  4575. `hnqzx`.`wm_task`.`update_time` AS `update_time`,
  4576. `hnqzx`.`wm_task`.`update_user` AS `update_user`,
  4577. `hnqzx`.`wm_task`.`submit_status` AS `submit_status`,
  4578. `hnqzx`.`wm_task`.`share_img_url` AS `share_img_url`,
  4579. `hnqzx`.`wm_task`.`plat_audit_status` AS `plat_audit_status`,
  4580. `hnqzx`.`wm_task`.`ext_ids` AS `ext_ids`,
  4581. `hnqzx`.`wm_task`.`task_info_img` AS `task_info_img`,
  4582. 3 AS `t_type`
  4583. from ((((`hnqzx`.`wm_task` left join `hnqzx`.`wm_score_package` on ((`hnqzx`.`wm_task`.`score_package_level1_id` =
  4584. `hnqzx`.`wm_score_package`.`id`))) join `hnqzx`.`wm_task_type`) join `hnqzx`.`sys_user`) join `hnqzx`.`sys_dept`)
  4585. where ((`hnqzx`.`wm_task_type`.`id` = `hnqzx`.`wm_task`.`task_type_id`) and
  4586. (`hnqzx`.`sys_user`.`user_id` = `hnqzx`.`wm_task`.`task_user_id`) and
  4587. (`hnqzx`.`sys_user`.`dept_id` = `hnqzx`.`sys_dept`.`dept_id`))) `ccc`
  4588. where ((`ccc`.`package_id` is not null) and (`ccc`.`task_status` = 3) and (`ccc`.`enable_flag` = 0) and
  4589. (`ccc`.`del_flag` = 0))
  4590. order by `ccc`.`create_time` desc;