change.sql 117 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471
  1. ---- ↓↓↓↓↓↓↓↓↓↓↓↓↓↓此位置加入最新修改的脚本↓↓↓↓↓↓↓↓↓↓↓↓↓↓
  2. -- 2020-10-10 laiyinghe DB:shebao_admin
  3. -- 待结算的金额汇总表
  4. CREATE TABLE `t_report_todofee` (
  5. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  6. `city_code` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '城市',
  7. `opt_month` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '核算月份',
  8. `order_month` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '订单月份',
  9. `shebao_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '社保有效单数',
  10. `shebao_fee` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '社保费',
  11. `sbcharge_fee` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '社保服务费',
  12. `sbcard_fee` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '社保制卡服务费',
  13. `pre_fee` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '社保预收费',
  14. `fund_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '公积金有效单数',
  15. `fund_fee` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '公积金费',
  16. `fund_charge_fee` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '公积金服务费',
  17. `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  18. PRIMARY KEY (`id`),
  19. KEY `todoFee_optmonth_idx` (`opt_month`)
  20. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='待结算的金额汇总';
  21. ----------------------------------- 已同步线上 @ 2020-08-06
  22. -- 2020-08-04 laiyinghe DB:shebao_admin
  23. -- 对帐单表增加充值和转帐或退款金额两字段
  24. ALTER TABLE `t_report_bill`
  25. ADD COLUMN `recharge_fee` decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '充值或收入金额' AFTER `k6`,
  26. ADD COLUMN `trun_refund_fee` decimal(10,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '转帐或退款金额' AFTER `recharge_fee`;
  27. ----------------------------------- 已同步线上 @ 2020-07-31
  28. -- 2020-07-27 laiyinghe DB:shebao
  29. -- 加字段。
  30. ALTER TABLE `t_sb_city`
  31. ADD COLUMN `sb_alone` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否允许单买' AFTER `update_time`;
  32. -- 2020-04-07 laiyinghe DB:shebao
  33. -- 新表。
  34. CREATE TABLE `t_sb_wage_flow_setting` (
  35. `city_code` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '城市代码',
  36. `flow_flag` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否需要流水',
  37. `flow_order` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '已有单是否可以支付',
  38. `flow_start` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '流水超始金额',
  39. `flow_end` int(11) NOT NULL DEFAULT '0' COMMENT '流水最高金额',
  40. `flow_charge` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '服务费',
  41. `remark` varchar(32) NOT NULL DEFAULT '' COMMENT '说明',
  42. `update_time` datetime DEFAULT NULL COMMENT '最新更新时间',
  43. PRIMARY KEY (`city_code`)
  44. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='流水配置表';
  45. ----------------------------------- 已同步线上 @ 2020-05-24
  46. -- 2020-04-07 laiyinghe DB:shebao
  47. -- 增加新字段 支付时间
  48. ALTER TABLE `t_sb_buy_order_added`
  49. ADD COLUMN `pay_time` datetime NULL COMMENT '支付时间';
  50. -- 初始化新加的字段
  51. UPDATE t_sb_buy_order_added SET pay_time=gen_time, gen_time=gen_time WHERE `status`>1;
  52. ----------------------------------- 已同步线上 @ 2020-04-26
  53. -- 2020-04-07 laiyinghe DB:shebao
  54. -- 增加字段长度
  55. ALTER TABLE `t_sb_advertiser`
  56. MODIFY COLUMN `advertiser` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '广告商' AFTER `appid`;
  57. ----------------------------------- 已同步线上 @ 2020-04-09
  58. -- 2020-04-07 laiyinghe DB:shebao
  59. -- 优化券表,增加索引。
  60. ALTER TABLE `t_sb_coupon_user`
  61. ADD INDEX `couponuser_userid_idx` (`user_id`) ;
  62. -- 2020-04-07 laiyinghe DB:shebao_admin
  63. -- 增加支付渠道字段
  64. ALTER TABLE `t_report_user_order`
  65. ADD COLUMN `payChannel` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '合作渠道/支付平台' AFTER `userRegDate`;
  66. -- 2020-03-30 laiyinghe DB:shebao_admin
  67. -- 增加新表
  68. CREATE TABLE `t_report_bill` (
  69. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  70. `mine_flag` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付平台:0; 本地数据:1',
  71. `bill_date` date NOT NULL COMMENT '帐单日期',
  72. `platform_code` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '支付平台代码',
  73. `trade_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '交易订单数',
  74. `trade_fee` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '交易金额',
  75. `refund_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '退款单数',
  76. `refund_fee` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '退款金额',
  77. `k6` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '交易手续费金额',
  78. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  79. PRIMARY KEY (`id`),
  80. KEY `report_bill_date_idx` (`bill_date`)
  81. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='帐单金额表';
  82. ----------------------------------- 已同步线上 @ 2020-03-17
  83. -- 2020-03-03 部署时需要考虑到微信支付退款的配置
  84. -- 1. configure.propertis文件配置回调地址
  85. -- 2. 同步证书文件到线上的etc目录
  86. -- 2020-03-09 laiyinghe DB:shebao
  87. -- 流水表增加字段
  88. ALTER TABLE `t_sb_buy_order_wage`
  89. ADD COLUMN `pay_platform` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '支付平台标识' AFTER `fail_reason`;
  90. -- 2020-03-09 laiyinghe DB:shebao
  91. -- 补差额表增加字段
  92. ALTER TABLE `t_sb_buy_order_added`
  93. ADD COLUMN `pay_platform` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '支付平台标识' AFTER `gen_time`;
  94. -- 2020-02-20 laiyinghe DB:shebao
  95. -- 新建 接口退款请求响应日志表
  96. CREATE TABLE `t_log_refund_api` (
  97. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  98. `refund_no` varchar(36) NOT NULL DEFAULT '' COMMENT '退款单号',
  99. `invoke` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '调用的内容',
  100. `content` text NOT NULL,
  101. `gen_time` datetime DEFAULT NULL COMMENT '创建时间',
  102. PRIMARY KEY (`id`),
  103. KEY `logrefundapi_order_idx` (`refund_no`)
  104. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='接口退款请求响应日志';
  105. -- 2019-12-03 laiyinghe DB:shebao
  106. -- 增加调用接口退款用到的数据字段
  107. ALTER TABLE `shebao`.`t_sb_buy_order_opt`
  108. ADD COLUMN `opt_api` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '退款方式' AFTER `added_no`,
  109. ADD COLUMN `charge_k6` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '千分之六的手续费(分)' AFTER `opt_api`,
  110. ADD COLUMN `opt_status` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '退款状态,同订单' AFTER `charge_k6`,
  111. ADD COLUMN `opt_time` DATETIME NULL COMMENT '退款操作时间' AFTER `opt_status`,
  112. ADD COLUMN `opt_remark` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '退款操作备注' AFTER `opt_time`,
  113. ADD COLUMN `batchNo` varchar(20) NOT NULL DEFAULT '' COMMENT '批次号' AFTER `opt_remark`,
  114. ADD COLUMN `refundNo` varchar(32) NOT NULL DEFAULT '' COMMENT '支付平台的本次退款标识' AFTER `batchNo`,
  115. ADD INDEX `buy_order_opt_status_idx` (`opt_status` ASC);
  116. -- 设置历史数据的状态为退款成功
  117. update t_sb_buy_order_opt set opt_status=4;
  118. ----------------------------------- 已同步线上 @ 2019-11-25
  119. -- 2019-11-25 laiyinghe DB:shebao
  120. -- 为订单表的时间字段加上索引(避免全表扫描)。
  121. create index buy_order_time_idx on shebao.t_sb_buy_order(gen_time);
  122. ----------------------------------- 已同步线上 @ 2019-11-18
  123. -- 2019-11-09 laiyinghe DB:shebao
  124. -- 给表 t_user_wx 增加数据 (从t_user表来)2820719
  125. insert into t_user_wx (u_id, wx_open_id) SELECT u_id, user_id FROM shebao.t_user where user_id !='';
  126. -- 新增用户表
  127. CREATE TABLE `t_user_wx` (
  128. `u_id` INT UNSIGNED NOT NULL,
  129. `wx_open_id` VARCHAR(32) NOT NULL,
  130. PRIMARY KEY (`u_id`),
  131. UNIQUE INDEX `wx_open_id_UNIQUE` (`wx_open_id`))
  132. COMMENT = '用户id与微信openId的关联表';
  133. ----------------------------------- 已同步线上 @ 2019-11-08
  134. -- 2019-10-18 laiyinghe DB:shebao
  135. -- 黑名单表增加手机号
  136. ALTER TABLE `t_sb_user_black`
  137. ADD COLUMN `phone` varchar(16) NOT NULL DEFAULT '' COMMENT '手机号' AFTER `idcard`;
  138. ----------------------------------- 已同步线上 @ 2019-10-31
  139. -- 2019-09-17 laiyinghe DB:shebao_admin
  140. -- 减员表增加专员的用户ID
  141. ALTER TABLE `t_sb_stop`
  142. ADD COLUMN `proUserId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '专员用户ID' AFTER `any_reason`;
  143. ----------------------------------- 已同步线上 @ 2019-10-18
  144. -- 2019-10-18 laiyinghe DB:shebao
  145. --
  146. ALTER TABLE `t_zwcx_type`
  147. ADD UNIQUE INDEX `t_zwcx_tyname_idx` (`typeName`) ;
  148. -- 2019-09-17 laiyinghe DB:shebao_admin
  149. -- 新加表
  150. CREATE TABLE `t_report_market_user` (
  151. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  152. `genDate` date DEFAULT NULL,
  153. `user0` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '游客数',
  154. `user1` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册用户数',
  155. `market` varchar(24) NOT NULL DEFAULT '' COMMENT '市场',
  156. `updateTime` datetime DEFAULT NULL,
  157. PRIMARY KEY (`id`),
  158. KEY `marketuser_gen_idx` (`genDate`),
  159. KEY `marketuser_market_idx` (`market`)
  160. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='市场的日用户汇总';
  161. -- 2019-09-17 laiyinghe DB:shebao_admin
  162. -- 更改表的索引
  163. ALTER TABLE `t_user_device_flag`
  164. DROP INDEX `userFlag_update_idx` ,
  165. ADD INDEX `userFlag_gen_idx` (`gen_time`) USING BTREE ;
  166. -- 2019-09-12 laiyinghe DB:shebao_admin
  167. -- 新加表
  168. CREATE TABLE `t_report_user_order` (
  169. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  170. `payDate` date DEFAULT NULL,
  171. `userId` int(10) unsigned NOT NULL,
  172. `orderCount` smallint(6) NOT NULL,
  173. `charge` smallint(6) NOT NULL,
  174. `phone` varchar(12) NOT NULL,
  175. `deviceId` varchar(36) NOT NULL,
  176. `market` varchar(24) NOT NULL,
  177. `userRegDate` date DEFAULT NULL,
  178. PRIMARY KEY (`id`),
  179. KEY `userorder_date_idx` (`payDate`),
  180. KEY `userorder_market_idx` (`market`),
  181. KEY `user_order_phone_idx` (`phone`)
  182. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户每天订单信息汇总表,供运营查阅';
  183. ----------------------------------- 已同步线上 @ 2019-09-18
  184. -- 2019-09-11 laiyinghe DB:shebao
  185. -- 新加表
  186. CREATE TABLE `t_sb_buy_tmp` (
  187. `trade_no` varchar(32) NOT NULL DEFAULT '',
  188. `buy_no` varchar(32) NOT NULL DEFAULT '',
  189. `added` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否是补缴',
  190. `buy_param` varchar(512) NOT NULL DEFAULT '',
  191. `buy_bean` varchar(512) NOT NULL DEFAULT '',
  192. `gen_time` datetime DEFAULT NULL,
  193. PRIMARY KEY (`trade_no`)
  194. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='买单临时表';
  195. -- 2019-09-09 laiyinghe DB:shebao
  196. -- 政务纠错表
  197. CREATE TABLE `t_zwcx_error` (
  198. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  199. `tid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '话题ID',
  200. `userId` int(10) unsigned NOT NULL DEFAULT '0',
  201. `pos` varchar(16) NOT NULL DEFAULT '' COMMENT '出错项目',
  202. `content` varchar(255) NOT NULL DEFAULT '' COMMENT '出错描述',
  203. `status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态',
  204. `genTime` datetime DEFAULT NULL,
  205. `updateTime` datetime DEFAULT NULL,
  206. PRIMARY KEY (`id`)
  207. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='纠错收集';
  208. -- 2019-09-02 laiyinghe DB:shebao
  209. -- 政务用户表
  210. CREATE TABLE `t_zwcx_user` (
  211. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  212. `openid` varchar(32) NOT NULL DEFAULT '',
  213. `userPhone` varchar(16) NOT NULL DEFAULT '' COMMENT '手机号',
  214. `nickName` varchar(32) NOT NULL DEFAULT '' COMMENT '昵称',
  215. `genTime` datetime DEFAULT NULL COMMENT '生成时间',
  216. `loginTime` datetime DEFAULT NULL COMMENT '最近登录时间',
  217. PRIMARY KEY (`id`),
  218. UNIQUE KEY `zwcx_user_openid_idx` (`openid`)
  219. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户表';
  220. -- 2019-08-14 laiyinghe DB:shebao
  221. -- 广告表新建两字段
  222. ALTER TABLE `t_sb_ad`
  223. ADD COLUMN `adType` varchar(16) NOT NULL DEFAULT '' COMMENT '广告分类' AFTER `enabled`,
  224. ADD COLUMN `adSys` varchar(16) NOT NULL DEFAULT '' COMMENT '广告属于产品' AFTER `adType`;
  225. -- 修改历史数据的上面两字段
  226. UPDATE t_sb_ad SET adSys='ShebaoApp';
  227. UPDATE t_sb_ad SET adType='Banner' WHERE position<11;
  228. UPDATE t_sb_ad SET adType='Service' WHERE position>10;
  229. -- 2019-08-14 laiyinghe DB:shebao
  230. -- 新建内容主表
  231. CREATE TABLE `t_zwcx_title` (
  232. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
  233. `typeId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '所属类型',
  234. `city` varchar(8) NOT NULL DEFAULT '' COMMENT '城市',
  235. `title` varchar(32) NOT NULL DEFAULT '' COMMENT '标题',
  236. `hot` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否常见',
  237. `hotSeq` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '常见的顺序',
  238. `batchNo` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '批次号(辅助编辑)',
  239. `disabled` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否禁用',
  240. PRIMARY KEY (`id`),
  241. KEY `zwcx_title_city_idx` (`city`),
  242. KEY `zwcx_title_type_idx` (`typeId`)
  243. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='内容主表';
  244. -- 新建内容表
  245. CREATE TABLE `t_zwcx_content` (
  246. `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '主表ID',
  247. `content` mediumtext NOT NULL COMMENT '内容',
  248. `updateTime` datetime NOT NULL,
  249. PRIMARY KEY (`id`)
  250. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  251. -- 新建政务类型表
  252. CREATE TABLE `t_zwcx_type` (
  253. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  254. `displayPos` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '显示顺序',
  255. `typeName` varchar(16) NOT NULL DEFAULT '' COMMENT '类型名称',
  256. `img_path` varchar(32) NOT NULL DEFAULT '' COMMENT '图片地址',
  257. PRIMARY KEY (`id`)
  258. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='政务类型表';
  259. ----------------------------------- 已同步线上 @ 2019-08-29
  260. -- 2019-08-27 laiyinghe DB:shebao
  261. -- 增加字段。此字段值来自 表 t_sb_advertiser
  262. ALTER TABLE `t_user_device_flag`
  263. ADD COLUMN `advertiser` varchar(16) NOT NULL DEFAULT '' COMMENT '广告商' AFTER `appMarket`;
  264. -- 2019-08-27 laiyinghe DB:shebao
  265. -- 新建表
  266. CREATE TABLE `t_sb_advertiser` (
  267. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  268. `idfa` varchar(64) NOT NULL DEFAULT '' COMMENT '手机标识',
  269. `appid` varchar(16) NOT NULL DEFAULT '',
  270. `advertiser` varchar(16) NOT NULL DEFAULT '' COMMENT '广告商',
  271. `confirm2` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否有二次确认',
  272. `callbackUrl` varchar(255) NOT NULL DEFAULT '' COMMENT '回调地址',
  273. `gen_time` datetime NOT NULL,
  274. `update_time` datetime NOT NULL,
  275. PRIMARY KEY (`id`),
  276. UNIQUE KEY `tsbadvertiser_idfa_idx` (`idfa`)
  277. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='广告商记录表';
  278. ----------------------------------- 已同步线上 @ 2019-07-26
  279. -- 2019-08-06 laiyinghe DB:shebao
  280. -- 用户表增加应用市场字段。注册时写值后不变
  281. ALTER TABLE `t_user`
  282. ADD COLUMN `appMarket` varchar(32) NOT NULL DEFAULT '' COMMENT '应用市场名称';
  283. -- 2019-08-05 laiyinghe DB:shebao
  284. -- 新建表,设备标识表
  285. CREATE TABLE `t_user_device_flag` (
  286. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  287. `userId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户ID,游客是0',
  288. `deviceId` varchar(36) NOT NULL DEFAULT '' COMMENT '设备识别ID',
  289. `appMarket` varchar(16) NOT NULL DEFAULT '' COMMENT 'App市场',
  290. `gen_time` date NOT NULL,
  291. `update_time` date NOT NULL,
  292. PRIMARY KEY (`id`),
  293. UNIQUE KEY `userFlag_deviceId_uq` (`deviceId`),
  294. KEY `userFlag_appMarket_idx` (`appMarket`),
  295. KEY `userFlag_update_idx` (`update_time`)
  296. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  297. -- 2019-07-30 laiyinghe DB:shebao
  298. -- 下单时增加提交字段--标识支付平台。
  299. ALTER TABLE `t_sb_buy`
  300. ADD COLUMN `pay_platform` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '第三方支付平台';
  301. -- 2019-07-29 laiyinghe DB:shebao
  302. -- 退款操作表增加补差额退款标识字段
  303. ALTER TABLE `t_sb_buy_order_opt`
  304. ADD COLUMN `added_no` varchar(32) NOT NULL DEFAULT '' COMMENT '补差额退款时需提供';
  305. ----------------------------------- 已同步线上 @ 2019-07-26
  306. -- 2019-07-26 chensenlai DB:shebao
  307. alter table t_sb_info_other add address varchar(128) DEFAULT NULL COMMENT '现居住地址' AFTER `hk_address`;
  308. ----------------------------------- 已同步线上 @ 2018-07-25
  309. -- 2019-07-24 laiyinghe DB:shebao_admin
  310. -- 增加专员用户ID字段,用于限制专员查看的数据
  311. ALTER TABLE `t_sb_employee`
  312. ADD COLUMN `proUserId` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '专员用户ID' AFTER `id_card_desc`;
  313. -- 2019-07-24 laiyinghe DB:shebao_admin
  314. -- 增加用户类型的字段,区分专员
  315. ALTER TABLE `sys_user`
  316. ADD COLUMN `user_type` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '2专员' AFTER `pay_channel`;
  317. ----------------------------------- 已同步线上 @ 2018-07-11
  318. -- 2019-07-10 laiyinghe DB:shebao_admin
  319. -- 增加是否适用于财务的流水字段
  320. ALTER TABLE `t_report_month`
  321. ADD COLUMN `finance` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否是财务数据' AFTER `update_time`;
  322. ----------------------------------- 已同步线上 @ 2018-06-11
  323. =======
  324. -- 2019-07-26 chensenlai DB:shebao
  325. alter table t_sb_info_other add address varchar(128) DEFAULT NULL COMMENT '现居住地址' AFTER `hk_address`;
  326. >>>>>>> 49fbf15d98ac0d2d75cf4cc72d647aff42bc2b0c
  327. -- 2019-06-03 laiyinghe DB:shebao_admin
  328. -- 增加制卡费用的退款
  329. ALTER TABLE `t_sb_buy_order_ext`
  330. ADD COLUMN `card_charge` decimal(6,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '退款制止服务费' AFTER `refund_charge`;
  331. ----------------------------------- 已同步线上 @ 2018-05-31
  332. -- 2019-05-31 laiyinghe DB:shebao
  333. -- 增加字段
  334. ALTER TABLE `t_channel`
  335. ADD COLUMN `key_channel` varchar(16) NOT NULL DEFAULT '' COMMENT '校验key' AFTER `pay_channel`;
  336. ----------------------------------- 已同步线上 @ 2018-05-21
  337. -- 2019-03-12 laiyinghe DB:shebao_admin
  338. -- 增加用户报表表格
  339. CREATE TABLE `t_report_user` (
  340. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  341. `gen_date` date NOT NULL COMMENT '日期',
  342. `reg_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '当天注册数',
  343. `login_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '当天登录数(含注册)',
  344. `sbusers` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '总参保人数',
  345. PRIMARY KEY (`id`),
  346. KEY `report_user_date_idx` (`gen_date`)
  347. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户每天的变动情况';
  348. -- 2019-04-25 laiyinghe DB:shebao
  349. -- 增加是否开放公积金购买字段
  350. ALTER TABLE `t_sb_city`
  351. ADD COLUMN `fund_buy2` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '开放购买公积金' AFTER `fund_buy`;
  352. ----------------------------------- 已同步线上 @ 2018-05-10
  353. -- 2019-05-08 laiyinghe DB:shebao
  354. -- 增加用户手机码字段
  355. ALTER TABLE `t_user`
  356. ADD COLUMN `regIMEI` varchar(36) NOT NULL DEFAULT '' COMMENT '手机的IMEI';
  357. -- 2019-05-08 laiyinghe DB:shebao
  358. -- 增加用户帐号注销表
  359. CREATE TABLE `t_user_logout` (
  360. `u_id` int(10) unsigned NOT NULL,
  361. `phone` varchar(12) NOT NULL DEFAULT '' COMMENT '注销账号',
  362. `reason` varchar(126) NOT NULL DEFAULT '' COMMENT '原因',
  363. `gen_time` datetime NOT NULL COMMENT '注销时间',
  364. PRIMARY KEY (`u_id`)
  365. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户帐号注销';
  366. ----------------------------------- 已同步线上 @ 2018-04-13
  367. -- 2019-04-30 chensenlai DB:shebao_admin
  368. -- 增加增员员工身份证校验字段
  369. ALTER TABLE `t_sb_employee`
  370. ADD COLUMN `id_card_status` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '身份证校验状态';
  371. ALTER TABLE `t_sb_employee`
  372. ADD COLUMN `id_card_desc` varchar(100) DEFAULT NULL COMMENT '身份证校验描述' AFTER `id_card_status`;
  373. UPDATE `t_sb_employee` SET `id_card_status`=5 WHERE `pay_type`<>0 OR `for_month`<201904;
  374. -- 2019-03-12 laiyinghe DB:shebao
  375. -- 增加数据收集表
  376. CREATE TABLE `t_sb_collect_question` (
  377. `u_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户标识',
  378. `answer1` varchar(64) NOT NULL DEFAULT '' COMMENT '第一题答案',
  379. `answer2` varchar(64) NOT NULL DEFAULT '' COMMENT '第二题答案',
  380. `answer3` varchar(64) NOT NULL DEFAULT '' COMMENT '第三题答案',
  381. `gen_time` datetime DEFAULT NULL COMMENT ' 创建时间',
  382. PRIMARY KEY (`u_id`)
  383. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='数据收集表';
  384. -- 2019-03-05 laiyinghe DB:shebao
  385. -- 增加字段
  386. ALTER TABLE `t_sb_buy`
  387. ADD COLUMN `working` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '在职有工资' AFTER `sb_wage`;
  388. ----------------------------------- 已同步线上 @ 2018-03-18
  389. -- 2019-03-12 laiyinghe DB:shebao_admin
  390. -- 增加上传文件的临时表
  391. CREATE TABLE `t_tmp_file` (
  392. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  393. `u_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '操作人id',
  394. `pmodule` varchar(16) NOT NULL DEFAULT '' COMMENT '模块',
  395. `filepath` varchar(64) NOT NULL DEFAULT '' COMMENT '文件路径',
  396. `gen_time` datetime NOT NULL COMMENT '上传时间',
  397. PRIMARY KEY (`id`),
  398. KEY `temp_file_uid_idx` (`u_id`)
  399. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文件上传保存表';
  400. ----------------------------------- 已同步线上 @ 2018-01-23
  401. -- 2019-01-21 laiyinghe DB:shebao
  402. -- 增加不可下单原因字段
  403. ALTER TABLE `t_sb_city_date`
  404. ADD COLUMN `reason` varchar(20) NOT NULL DEFAULT '' COMMENT '不可下单原因' AFTER `end_date`;
  405. -- 2019-01-21 laiyinghe DB:shebao_admin
  406. -- 新增流水周期数据情况表
  407. CREATE TABLE `t_report_wage_cycle` (
  408. `begin_date` date NOT NULL COMMENT '周期开始日期',
  409. `end_date` date NOT NULL COMMENT '周期结束日期',
  410. `totals` varchar(80) NOT NULL DEFAULT '' COMMENT '所有已支付和之后状态的数据情况',
  411. `payed` varchar(80) NOT NULL DEFAULT '' COMMENT '当前处于已支付状态数据的情况',
  412. `hfed` varchar(80) NOT NULL DEFAULT '' COMMENT '当前处于已返还状态数据的情况',
  413. `fail` varchar(80) NOT NULL DEFAULT '' COMMENT '当前处于返还失败状态数据的情况',
  414. `gen_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  415. PRIMARY KEY (`begin_date`)
  416. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='流水周期数据情况';
  417. -- 2019-01-21 laiyinghe DB:shebao_admin
  418. -- 新增流水月汇总表
  419. CREATE TABLE `t_report_wage_month` (
  420. `opt_month` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '操作月份',
  421. `totals` varchar(80) NOT NULL DEFAULT '' COMMENT '所有已支付和之后状态的数据情况',
  422. `payed` varchar(80) NOT NULL DEFAULT '' COMMENT '当前处于已支付状态数据的情况',
  423. `hfed` varchar(80) NOT NULL DEFAULT '' COMMENT '当前处于已返还状态数据的情况',
  424. `fail` varchar(80) NOT NULL DEFAULT '' COMMENT '当前处于返还失败状态数据的情况',
  425. `gen_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  426. PRIMARY KEY (`opt_month`)
  427. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='流水月汇总';
  428. ----------------------------------- 已同步线上 @ 2018-01-15
  429. -- 2019-01-10 laiyinghe DB:shebao
  430. -- 流水表增加返还失败的原因
  431. ALTER TABLE `t_sb_buy_order_wage`
  432. ADD COLUMN `fail_reason` varchar(128) NOT NULL DEFAULT '' COMMENT '返还失败原因' AFTER `refund_time`;
  433. ----------------------------------- 已同步线上 @ 2018-01-10
  434. -- 2019-01-10 laiyinghe DB:shebao
  435. -- 新增减员月份字段
  436. ALTER TABLE `t_sb_stop_hand`
  437. ADD COLUMN `via_month` int UNSIGNED NOT NULL DEFAULT 0 COMMENT '对应减员月份' AFTER `order_no`;
  438. ----------------------------------- 已同步线上 @ 2018-01-05
  439. -- 2018-12-20 laiyinghe DB:shebao
  440. -- 新增手动减员表
  441. CREATE TABLE `t_sb_stop_hand` (
  442. `order_no` varchar(32) NOT NULL,
  443. `opt_month` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '减员核算月',
  444. `urgent` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否加急',
  445. `status` tinyint(4) NOT NULL DEFAULT '0',
  446. `gen_time` datetime NOT NULL,
  447. `opt_user` varchar(16) NOT NULL DEFAULT '' COMMENT '操作人',
  448. `update_time` datetime DEFAULT NULL COMMENT '最新更新时间',
  449. PRIMARY KEY (`order_no`),
  450. KEY `hand_stop_month_idx` (`opt_month`)
  451. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='手动减员表';
  452. -- 2018-12-6 laiyinghe DB:shebao
  453. -- 买单表增加字段
  454. ALTER TABLE `t_sb_buy`
  455. ADD COLUMN `sb_wage` decimal(8,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '社保流水金额';
  456. -- 2018-12-6 laiyinghe DB:shebao
  457. -- 新增表:社保流水表
  458. CREATE TABLE `t_sb_buy_order_wage` (
  459. `order_no` varchar(32) NOT NULL DEFAULT '' COMMENT '单号',
  460. `trade_no` varchar(32) NOT NULL DEFAULT '' COMMENT '支付单号',
  461. `pay_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '帐号ID',
  462. `opt_month` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '核算(操作)月份',
  463. `charge` decimal(6,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '服务费',
  464. `wage` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '流水金额',
  465. `total_fee` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '支付金额',
  466. `pay_date` date NOT NULL COMMENT '最晚支付日期',
  467. `f_channel` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '来自渠道',
  468. `gen_time` datetime NOT NULL,
  469. `pay_channel` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '支付渠道',
  470. `pay_no` varchar(32) NOT NULL DEFAULT '' COMMENT '支付流水号',
  471. `pay_status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '支付状态',
  472. `pay_time` datetime DEFAULT NULL COMMENT '支付时间',
  473. `refund_time` datetime DEFAULT NULL COMMENT '返回时间',
  474. PRIMARY KEY (`order_no`),
  475. UNIQUE KEY `order_wage_tradeno_idx` (`trade_no`),
  476. KEY `order_wage_month_idx` (`opt_month`),
  477. KEY `order_wage_uid_idx` (`pay_uid`)
  478. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='社保流水表';
  479. -- 2018-12-08 laiyinghe DB:shebao
  480. -- 不可下单日期的配置表
  481. CREATE TABLE `t_sb_city_date` (
  482. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  483. `city_code` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '城市代码',
  484. `begin_date` date NOT NULL COMMENT '开始不可下单日期',
  485. `end_date` date NOT NULL COMMENT '结束日期',
  486. `opt_user` varchar(20) NOT NULL COMMENT '生成人',
  487. `gen_time` datetime NOT NULL,
  488. PRIMARY KEY (`id`)
  489. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='不可下单日期的配置';
  490. ----------------------------------- 已同步线上 @ 2018-12-04
  491. -- 2018-12-4 laiyinghe DB:shebao
  492. -- 主配置 表增加字段
  493. ALTER TABLE `t_sb_city`
  494. ADD COLUMN `wage_flow` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否需要流水' AFTER `inc_enabled`;
  495. -- 2018-09-27 laiyinghe DB:shebao
  496. -- 参保人黑名单表
  497. CREATE TABLE `t_sb_user_black` (
  498. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  499. `uname` varchar(20) NOT NULL DEFAULT '' COMMENT '身份证对应姓名',
  500. `idcard` varchar(20) NOT NULL DEFAULT '' COMMENT '身份证号码',
  501. `reason` varchar(64) NOT NULL DEFAULT '' COMMENT '原因',
  502. `opt_user` varchar(20) NOT NULL DEFAULT '' COMMENT '操作人',
  503. `enable` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '有效吗',
  504. `gen_time` datetime NOT NULL,
  505. PRIMARY KEY (`id`),
  506. KEY `sbuser_black_idcard_idx` (`idcard`)
  507. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='参保人黑名单表';
  508. -- 2018-11-10 laiyinghe DB:shebao
  509. -- 新增加销量表
  510. CREATE TABLE `t_sb_buy_volume` (
  511. `city_code` mediumint(8) unsigned NOT NULL,
  512. `sb_vol` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '社保销量',
  513. `fund_vol` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '公积金销量',
  514. `update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '数据更新时间',
  515. `gen_time` datetime DEFAULT NULL COMMENT '重置时间',
  516. PRIMARY KEY (`city_code`)
  517. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='销量表';
  518. -- 2018-11-10 laiyinghe DB:shebao
  519. -- 增加参保人的回访字段
  520. ALTER TABLE `t_sb_user`
  521. ADD COLUMN `education` varchar(32) NOT NULL DEFAULT '' COMMENT '学历' AFTER `update_time`,
  522. ADD COLUMN `need_pay` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否需要发薪' AFTER `education`,
  523. ADD COLUMN `salary` decimal(8,2) UNSIGNED NOT NULL DEFAULT 0 COMMENT '薪资金额' AFTER `need_pay`;
  524. -- 2018-11-24 laiyinghe DB:shebao
  525. -- 参保人增加银行相关字段。
  526. ALTER TABLE `t_sb_user`
  527. ADD COLUMN `bank` varchar(32) NOT NULL DEFAULT '' COMMENT '银行' AFTER `salary`,
  528. ADD COLUMN `bank_branch` varchar(64) NOT NULL DEFAULT '' COMMENT '银行支行' AFTER `bank`,
  529. ADD COLUMN `bank_code` varchar(32) NOT NULL DEFAULT '' COMMENT '银行卡号码' AFTER `bank_branch`;
  530. -- 2018-11-01 laiyinghe DB:shebao
  531. -- 增加广告表
  532. CREATE TABLE `t_sb_ad` (
  533. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  534. `title` varchar(32) NOT NULL DEFAULT '' COMMENT '广告主题',
  535. `notes` varchar(64) NOT NULL DEFAULT '' COMMENT '说明',
  536. `img_path` varchar(64) NOT NULL DEFAULT '' COMMENT '图片链接',
  537. `img_link` varchar(128) NOT NULL DEFAULT '' COMMENT '图片跳转链接',
  538. `position` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '位置',
  539. `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否启用',
  540. `gen_time` datetime NOT NULL,
  541. PRIMARY KEY (`id`),
  542. KEY `ad_enabled_idx` (`enabled`)
  543. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='APP首页图片广告';
  544. ----------------------------------- 已同步线上 @ 2018-10-24
  545. -- 2018-10-22 laiyinghe DB:shebao
  546. -- 社保参数数据配置增加字段
  547. ALTER TABLE `t_sb_city`
  548. ADD COLUMN `inc_enabled` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否启用' AFTER `first_months`;
  549. -- 2018-09-14 laiyinghe DB:shebao
  550. -- 城市参数数据配置增加两个字段
  551. ALTER TABLE `t_sb_city`
  552. ADD COLUMN `hukou_address` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否需要填写户藉地址' AFTER `fund_buy`,
  553. ADD COLUMN `first_months` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '首次购买的月份数' AFTER `hukou_address`;
  554. -- 2018-09-14 laiyinghe DB:shebao
  555. -- 参保人员表增加户藉地址字段
  556. ALTER TABLE `t_sb_user`
  557. ADD COLUMN `hk_address` varchar(126) NOT NULL DEFAULT '' COMMENT '户籍地址' AFTER `reg_channel`;
  558. ----------------------------------- 已同步线上 @ 2018-07-24
  559. -- 2018-07-24 chensenlai DB:shebao
  560. CREATE TABLE `t_tianji_data` (
  561. `tid` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键编号',
  562. `user_id` INT(11) UNSIGNED NOT NULL COMMENT '用户编码',
  563. `id_card` VARCHAR(20) DEFAULT NULL COMMENT '身份证',
  564. `city` VARCHAR(32) DEFAULT NULL COMMENT '城市',
  565. `name` VARCHAR(20) DEFAULT NULL COMMENT '姓名',
  566. `phone` VARCHAR(20) DEFAULT NULL COMMENT '手机号码',
  567. `fund_com_name` VARCHAR(64) DEFAULT NULL COMMENT '公积金单位名',
  568. `fund_com_code` VARCHAR(32) DEFAULT NULL COMMENT '公积金单位机构码',
  569. `fund_base_money` INT(11) NOT NULL DEFAULT 0 COMMENT '公积金月缴基数',
  570. `fund_month_money` INT(11) NOT NULL DEFAULT 0 COMMENT '公积金月缴金额',
  571. `fund_per` INT(11) NOT NULL DEFAULT 0 COMMENT '公积金个人',
  572. `fund_com` INT(11) NOT NULL DEFAULT 0 COMMENT '公积金单位',
  573. `fund_begin_month` VARCHAR(8) DEFAULT NULL COMMENT '公积金开始月份',
  574. `fund_end_month` VARCHAR(8) DEFAULT NULL COMMENT '公积金截止月份',
  575. `fund_lack_month` VARCHAR(2048) DEFAULT NULL COMMENT '公积金断缴月份',
  576. `fund_query_time` DATETIME DEFAULT NULL COMMENT '公积金查询时间',
  577. `insure_com_name` VARCHAR(64) DEFAULT NULL COMMENT '社保单位名',
  578. `insure_com_code` VARCHAR(32) DEFAULT NULL COMMENT '社保单位机构码',
  579. `insure_per` INT(11) NOT NULL DEFAULT 0 COMMENT '社保个人',
  580. `insure_com` INT(11) NOT NULL DEFAULT 0 COMMENT '社保单位',
  581. `insure_begin_month` VARCHAR(8) DEFAULT NULL COMMENT '社保开始月份',
  582. `insure_end_month` VARCHAR(8) DEFAULT NULL COMMENT '社保截止月份',
  583. `insure_pension_lack_month` VARCHAR(2048) DEFAULT NULL COMMENT '社保养老断缴月份',
  584. `insure_medical_lack_month` VARCHAR(2048) DEFAULT NULL COMMENT '社保医疗断缴月份',
  585. `insure_query_time` DATETIME DEFAULT NULL COMMENT '社保查询时间',
  586. PRIMARY KEY (`tid`)
  587. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT '融360天机数据查询表';
  588. ----------------------------------- 已同步线上 @ 2018-06-08
  589. -- 2018-06-08 chensenlai DB:shebao
  590. -- 客服保存常见回复
  591. ALTER TABLE `t_sb_hot_topic` ADD COLUMN `type` INT(11) UNSIGNED NOT NULL DEFAULT 1 COMMENT '类型 1-热门题目 2-客服常见问题' AFTER `id`;
  592. ALTER TABLE `t_sb_hot_topic` ADD COLUMN `opt_user` VARCHAR(64) DEFAULT NULL COMMENT '后台用户(客服)' AFTER `sort`;
  593. ----------------------------------- 已同步线上 @ 2018-06-04
  594. -- 2018-06-01 chensenlai DB:shebao
  595. -- H5购买渠道支持可配置
  596. CREATE TABLE `t_channel` (
  597. `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '渠道编号',
  598. `code` VARCHAR(64) NOT NULL COMMENT '外部编码',
  599. `name` VARCHAR(32) NOT NULL COMMENT '名称',
  600. `domain` VARCHAR(64) DEFAULT NULL COMMENT '绑定域名',
  601. `reg_channel` VARCHAR(32) NOT NULL COMMENT '注册渠道标识',
  602. `pay_channel` INT(11) UNSIGNED NOT NULL COMMENT '支付渠道标识',
  603. `disabled` TINYINT(4) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否禁用 0-非禁用 1-禁用',
  604. `defaulted` TINYINT(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否默认 0-非默认 1-默认',
  605. PRIMARY KEY (`id`)
  606. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT '渠道配置表';
  607. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  608. VALUES ('095061cb906341adb88bae70eb5eb4f9', 'APP微信', NULL, '0', 1, 0, 0);
  609. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  610. VALUES ('29e8dd32d8ed4d77896cff017bc757ac', '五险一金APP', NULL, '0', 2, 0, 0);
  611. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  612. VALUES ('647b5a3879e84439a8f3b6266f1b99b5', 'APP支付宝', NULL, '0', 11, 0, 0);
  613. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  614. VALUES ('00d14db2101640e98a051e20be513a5e', '支付生活号(社保公积金待缴)', 'alipay.shanp.com', 'AN_JU_BAO', 31, 0, 0);
  615. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  616. VALUES ('088663c17e7b47769a56728459cec584', 'E家帮', 'ejbang.shanp.com', 'EJ_BANG', 33, 0, 0);
  617. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  618. VALUES ('14436027b0aa4877b9038ffeee249fda', '我是车主', 'woshichezhu.shanp.com', 'WS_CHEZHU', 35, 0, 0);
  619. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  620. VALUES ('0f3060efe4e64d2294146098b829b9df', '小雨伞', 'xiaoyusan.shanp.com', 'X_YUSAN', 37, 0, 0);
  621. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  622. VALUES ('faf62d2368d24b7a951fe440f6802e30', '银承派', 'yinchengpai.shanp.com', 'Y_CHENGPAI', 39, 0, 0);
  623. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  624. VALUES ('497cc12254fd4b24b3650812875246e9', '师傅帮', '51szg.shanp.com', 'SHI_FU', 41, 0, 0);
  625. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  626. VALUES ('ea0a71a565db4661b88b1a7c85f361bb', '兼职地带', 'jzdd.shanp.com', 'JIAN_ZHI', 43, 0, 0);
  627. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  628. VALUES ('64ca08db0d29429c9d52c017d57e8b60', '掉钱眼儿', 'diaoqianyaner.shanp.com', 'QIAN_YAN', 45, 0, 0);
  629. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  630. VALUES ('43f92e6cd3884fa580b52a0ba0a9233c', '五险一金微信公共号', 'wxyj.shanp.com', 'WECHAT_WXYJ', 47, 0, 0);
  631. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  632. VALUES ('e44db289f8e24cd2a4d8104f697c03de', 'DATALINK', 'datalink.shanp.com', 'DATALINK', 49, 0, 0);
  633. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  634. VALUES ('bf0bc584b3d84abaa0fa131897376312', 'DOUMI', 'doumi.shanp.com', 'DOUMI', 50, 0, 0);
  635. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  636. VALUES ('b7fae004b81445f6bb930c4789ccb1fe', '58', '58.shanp.com', '58', 58, 0, 0);
  637. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  638. VALUES ('2b0c33bea9d54988bd9b7940fd1c8055', '兼职猫', 'jianzhimao.shanp.com', 'JIAN_ZHI_MAO', 60, 0, 0);
  639. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  640. VALUES ('24bd6635085946f6b284d71b69256adf', '公积金生活号', 'gjjshenghuohao.shanp.com', 'GJJ_SHENG_HUO_HAO', 61, 0, 0);
  641. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  642. VALUES ('df7192a91bf243c28e715ec90e53c287', '51社保管家', '51sbgj.shanp.com', '51SBGJ', 62, 0, 0);
  643. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  644. VALUES ('da79b440c5934217b0d29990313e6a60', '中燃气', 'zhongranqi.shanp.com', 'ZHONG_RAN_QI', 63, 0, 0);
  645. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  646. VALUES ('a410e38c4bf74b0899b044abb1a73ec3', '深圳代缴', 'szdaijiao.shanp.com', 'SZ_DAI_JIAO', 64, 0, 0);
  647. INSERT INTO `shebao`.`t_channel` (`code`, `name`, `domain`, `reg_channel`, `pay_channel`, `disabled`, `defaulted`)
  648. VALUES ('22ad685307f544bf8e5fe97923f2bad8', '我的社保默认', NULL, 'DEFAULT', 999, 0, 1);
  649. ----------------------------------- 已同步线上 @ 2018-05-17
  650. -- 2018-05-10 laiyinghe DB:shebao
  651. -- 月份单需要记录支付渠道和支付流水号
  652. ALTER TABLE `t_sb_buy_order`
  653. ADD COLUMN `pay_channel` smallint UNSIGNED NULL DEFAULT 0 COMMENT '支付渠道号' AFTER `manual_type`,
  654. ADD COLUMN `pay_no` varchar(64) NULL DEFAULT '' COMMENT '第三方支付号' AFTER `pay_channel`;
  655. ----------------------------------- 已同步线上 @ 2018-04-19
  656. -- 2018-03-27 laiyinghe DB:shebao
  657. -- 参保用户生成渠道
  658. ALTER TABLE `t_sb_user`
  659. ADD COLUMN `reg_channel` varchar(24) NOT NULL DEFAULT '' COMMENT '来自渠道';
  660. ALTER TABLE `t_sb_user`
  661. ADD COLUMN `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
  662. ----------------------------------- 已同步线上 @ 2018-04-12
  663. -- 2018-04-02 laiyinghe DB:shebao_admin
  664. -- 运营后台的用户增加渠道标识字段
  665. ALTER TABLE `sys_user`
  666. ADD COLUMN `pay_channel` tinyint UNSIGNED NOT NULL DEFAULT 0 COMMENT '渠道标识' AFTER `enabled`;
  667. -- 2018-03-27 chensenlai DB:shebao
  668. -- 资料流程H5资料收集新增字段(测试环境已更新)。
  669. ALTER TABLE `t_sb_info_other`
  670. ADD COLUMN `hk_address` VARCHAR(128) DEFAULT NULL COMMENT '户籍地址' AFTER `marriage_status`;
  671. ALTER TABLE `t_sb_info_other`
  672. ADD COLUMN `graduate_time` VARCHAR(16) DEFAULT NULL COMMENT '毕业时间' AFTER `hk_address`;
  673. ALTER TABLE `t_sb_info_other`
  674. ADD COLUMN `work_time` VARCHAR(16) DEFAULT NULL COMMENT '第一次工作时间' AFTER `graduate_time`;
  675. -- 2018-03-12 laiyinghe DB:shebao
  676. -- 增加热线电话字段.
  677. ALTER TABLE `t_sb_city_site`
  678. ADD COLUMN `shebao_tel` varchar(16) NULL DEFAULT '' COMMENT '社保局热线' AFTER `shebao_wx`,
  679. ADD COLUMN `fund_tel` varchar(16) NULL DEFAULT '' COMMENT '公积金中心热线' AFTER `fund_wx`;
  680. ----------------------------------- 已同步线上 @ 2018-03-22
  681. -- 2018-03-12 laiyinghe DB:shebao
  682. -- 定单的服务费退款。
  683. ALTER TABLE `t_sb_buy_order_ext`
  684. ADD COLUMN `refund_charge` decimal(6,2) NOT NULL DEFAULT 0 COMMENT '服务费退款' AFTER `refund_time`;
  685. -- 2018-03-12 laiyinghe DB:shebao
  686. -- 定单的操作列表。
  687. CREATE TABLE `t_sb_buy_order_opt` (
  688. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  689. `order_no` varchar(32) NOT NULL DEFAULT '',
  690. `opt_type` varchar(16) NOT NULL DEFAULT '' COMMENT '操作类型',
  691. `amount` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '涉及金额',
  692. `opt_user` varchar(32) NOT NULL DEFAULT '' COMMENT '操作人',
  693. `gen_time` datetime NOT NULL COMMENT '生成时间',
  694. `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '说明',
  695. PRIMARY KEY (`id`),
  696. KEY `buy_order_opt_no_idx` (`order_no`)
  697. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='定单的操作列表,包含补缴,退款等信息';
  698. ----------------------------------- 已同步线上 @ 2017-08-29
  699. -- 2017-04-20 laiyinghe DB:shebao
  700. -- 重要的异常通知。
  701. CREATE TABLE `t_log_important_error` (
  702. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  703. `desc` varchar(64) NOT NULL,
  704. `content` varchar(512) NOT NULL,
  705. `gen_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  706. PRIMARY KEY (`id`)
  707. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  708. ----------------------------------- 已同步线上 @ 2017-08-29
  709. -- 2017-08-29 chensenlai DB:shebao
  710. -- H5其它资料收集表。
  711. CREATE TABLE `t_sb_info_other` (
  712. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  713. `u_id` int(10) NOT NULL COMMENT '系统用户标识',
  714. `id_card` varchar(20) NOT NULL COMMENT '参保人身份证号码',
  715. `political_status` varchar(8) DEFAULT NULL COMMENT '政治面貌',
  716. `education_level` varchar(16) DEFAULT NULL COMMENT '受教育程度',
  717. `other_phone` varchar(16) DEFAULT NULL COMMENT '其他联系方式',
  718. `marriage_status` varchar(8) DEFAULT NULL COMMENT '婚姻情况',
  719. PRIMARY KEY (`id`)
  720. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  721. ----------------------------------- 已同步线上 @ 2017-05-24
  722. -- 2017-04-20 laiyinghe DB:shebao_admin
  723. -- 新建用户的权限表、用户角色的权限表。
  724. CREATE TABLE `t_privilege_user` (
  725. `user_id` int UNSIGNED NOT NULL COMMENT '用户ID' ,
  726. `role_id` int UNSIGNED NOT NULL COMMENT '角色ID' ,
  727. `create_uid` int UNSIGNED NOT NULL COMMENT '生成此权限的用户ID' ,
  728. `module_name` varchar(32) NULL DEFAULT '' COMMENT '模块名称PModule.pname' ,
  729. `privilege` varchar(64) NULL DEFAULT '' COMMENT '权限信息' ,
  730. `update_time` datetime NULL COMMENT '更新时间' ,
  731. INDEX `privilege_userid_idx` (`user_id`)
  732. )
  733. ;
  734. -- 2017-04-18 laiyinghe DB:shebao_admin
  735. -- 新建角色的权限表。
  736. CREATE TABLE `t_privilege_role` (
  737. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  738. `role_id` int(10) unsigned NOT NULL COMMENT '角色ID',
  739. `module_name` varchar(32) NOT NULL COMMENT '模块名称PModule.pname',
  740. `privilege` varchar(64) NOT NULL COMMENT '权限信息',
  741. `create_uid` int(10) unsigned NOT NULL,
  742. `update_time` datetime DEFAULT NULL,
  743. PRIMARY KEY (`id`),
  744. KEY `privilege_roleid_idx` (`role_id`)
  745. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  746. CREATE TABLE `t_base_role` (
  747. `role_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  748. `role_name` varchar(32) NOT NULL COMMENT '角色名称',
  749. `role_desc` varchar(255) NOT NULL COMMENT '角色描述',
  750. `create_uid` int(10) unsigned NOT NULL COMMENT '创建用户的id',
  751. `enabled` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '是否可用',
  752. `create_time` datetime DEFAULT NULL,
  753. PRIMARY KEY (`role_id`)
  754. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  755. ----------------------------------- 已同步线上 @ 2017-05-02
  756. -- 2017-05-02 laiyinghe DB:shebao_admin
  757. -- 增加字段退款、补缴的时间字段
  758. ALTER TABLE `t_sb_buy_order_ext`
  759. ADD COLUMN `refund_time` datetime NULL COMMENT '最新退款时间' AFTER `refund_reason`,
  760. ADD COLUMN `repay_time` datetime NULL COMMENT '最近补缴时间' AFTER `repay_reason`;
  761. ----------------------------------- 已同步线上 @ 2017-04-21
  762. -- 2017-04-18 laiyinghe DB:shebao_admin
  763. -- 增加字段gen_desc,方便查看生成增、代理员的依据
  764. ALTER TABLE `t_sb_employee`
  765. ADD COLUMN `gen_desc` varchar(64) NULL DEFAULT '' COMMENT '生成依据的描述' AFTER `new_card`;
  766. ----------------------------------- 已同步线上 @ 2017-04-19
  767. -- 2017-04-18 chensenlai DB:shebao_admin
  768. -- sys_user增加昵称字段。
  769. ALTER TABLE `sys_user`
  770. ADD COLUMN `nick_name` varchar(32) DEFAULT NULL COMMENT '昵称' AFTER `name`;
  771. -- 2017-04-12 laiyinghe DB:shebao
  772. -- t_sb_buy_order增加字段,保存金额值。
  773. ALTER TABLE `t_sb_buy_order`
  774. ADD COLUMN `disabled_price` decimal(8,2) NULL DEFAULT 0 COMMENT '残保金' AFTER `pre_charge`;
  775. -- 2017-04-12 laiyinghe DB:shebao
  776. -- 字段由32改为64的长度
  777. ALTER TABLE `t_ent_sign`
  778. MODIFY COLUMN `demand` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '业务';
  779. ----------------------------------- 已同步线上 @ 2017-04-06
  780. -- 2017-04-06 laiyinghe DB:shebao
  781. -- 增加字段合同附件数量
  782. ALTER TABLE `t_ent_sign`
  783. ADD COLUMN `contract_num` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '合同附件数量' AFTER `email`;
  784. ----------------------------------- 已同步线上 @ 2017-04-06
  785. -- 2017-04-06 laiyinghe DB:shebao_admin
  786. -- 企业用户管理的合同附件管理
  787. CREATE TABLE `t_ent_contract` (
  788. `id` int UNSIGNED NOT NULL AUTO_INCREMENT ,
  789. `entId` int UNSIGNED NOT NULL ,
  790. `fileName` varchar(32) NOT NULL ,
  791. `uploadTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
  792. `wantDelete` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 ,
  793. PRIMARY KEY (`id`),
  794. INDEX `t_ent_contract_entid_idx` (`entId`)
  795. )
  796. COMMENT='合同附件表';
  797. ALTER TABLE `t_ent_contract`
  798. MODIFY COLUMN `fileName` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL AFTER `entId`,
  799. ADD COLUMN `fileType` varchar(32) NULL AFTER `fileName`;
  800. ----------------------------------- 已同步线上 @ 2017-03-27
  801. ALTER TABLE `t_ent_sign`
  802. ADD COLUMN `wechat` varchar(32) DEFAULT NULL,
  803. ADD COLUMN `qq` varchar(16) DEFAULT NULL,
  804. ADD COLUMN `email` varchar(32) DEFAULT NULL;
  805. ----------------------------------- 已同步线上 @ 2017-04-05
  806. -- 2017-04-05 chensenlai DB:shebao
  807. -- 修改企业登记联系号码长度。
  808. ALTER TABLE `t_ent_sign`
  809. CHANGE COLUMN `contact_phone` `contact_phone` VARCHAR(32) NOT NULL COMMENT '联系电话' ;
  810. ----------------------------------- 已同步线上 @ 2017-01-10
  811. -- 2016-11-02 laiyinghe DB:shebao
  812. -- 增加业务员备注的内容表。
  813. CREATE TABLE `t_ent_sign_notes` (
  814. `entId` int(11) NOT NULL,
  815. `notes` varchar(255) NOT NULL COMMENT '说明文本',
  816. `opt_user` varchar(32) DEFAULT NULL COMMENT '操作人',
  817. `gen_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '生成时间',
  818. KEY `ent_notes_entId_idx` (`entId`)
  819. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  820. -- 2016-11-02 laiyinghe DB:shebao_admin
  821. -- 增加业务员负责区域表。
  822. CREATE TABLE `t_ent_user` (
  823. `uname` varchar(32) NOT NULL COMMENT 'sys_user的name字段值',
  824. `areas` varchar(512) NOT NULL COMMENT '负责区域列表',
  825. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  826. PRIMARY KEY (`uname`)
  827. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  828. -- 2016-11-02 laiyinghe DB:shebao
  829. -- 增加一个业务员登记字段。
  830. ALTER TABLE `t_ent_sign`
  831. ADD COLUMN `opt_sign` tinyint(1) NULL DEFAULT 0 COMMENT '1:业务员登记' AFTER `opt_user`;
  832. ----------------------------------- 已同步线上 @ 2017-01-05
  833. -- 2016-11-02 laiyinghe DB:shebao
  834. -- 增加一个业务员字段。
  835. ALTER TABLE `t_ent_sign`
  836. ADD COLUMN `opt_user` varchar(16) NULL COMMENT '业务员' AFTER `phone_time`;
  837. ALTER TABLE `t_ent_sign`
  838. MODIFY COLUMN `phone_result` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '电话回访结果';
  839. ----------------------------------- 已同步线上 @ 2016-12-29
  840. -- 2016-11-02 laiyinghe DB:shebao
  841. -- 增加一个顺序字段。
  842. ALTER TABLE `t_sb_keyvalue`
  843. ADD COLUMN `order_id` smallint NULL DEFAULT 0 FIRST ;
  844. ----------------------------------- 已同步线上 @ 2016-12-15
  845. -- 2016-11-02 chensenlai DB:shebao
  846. -- 热点问题。
  847. CREATE TABLE `t_sb_hot_topic` (
  848. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  849. `topic` varchar(512) NOT NULL COMMENT '问题',
  850. `answer` varchar(1024) NOT NULL COMMENT '答案',
  851. `sort` int(10) NOT NULL DEFAULT 1 COMMENT '排序(降序)',
  852. `create_time` datetime NOT NULL COMMENT '创建时间',
  853. `update_time` datetime NOT NULL COMMENT '更新时间',
  854. `disabled` int(4) NOT NULL DEFAULT 2 COMMENT '禁用 1-启用 2-禁用',
  855. PRIMARY KEY (`id`)
  856. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='热点问题表';
  857. -- 2016-11-02 chensenlai DB:shebao
  858. -- 用户留言。
  859. CREATE TABLE `t_sb_leave_message` (
  860. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  861. `phone` varchar(13) NOT NULL COMMENT '用户手机号',
  862. `status` int(4) NOT NULL DEFAULT 1 COMMENT '状态 1-待回复 2-已回复',
  863. `title` varchar(128) DEFAULT NULL COMMENT '留言标题',
  864. `leave` varchar(512) NOT NULL COMMENT '留言内容',
  865. `leave_time` datetime NOT NULL COMMENT '留言时间',
  866. `feeback` varchar(1024) DEFAULT NULL COMMENT '反馈内容',
  867. `feeback_time` datetime DEFAULT NULL COMMENT '反馈时间',
  868. `feeback_kefu` int(10) DEFAULT NULL COMMENT '反馈时间',
  869. PRIMARY KEY (`id`)
  870. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户留言表';
  871. -- 2016-12-13 laiyinghe DB:shebao
  872. -- 增加字段
  873. ALTER TABLE `t_sb_buy_order`
  874. ADD COLUMN `pre_charge` decimal(8,2) UNSIGNED NULL DEFAULT 0 COMMENT '预收费用' AFTER `new_card`;
  875. ALTER TABLE `t_sb_buy`
  876. ADD COLUMN `pre_charge` decimal(8,2) UNSIGNED NULL DEFAULT 0 COMMENT '预收费用' AFTER `new_card`;
  877. ----------------------------------- 已同步线上 @ 2016-12-06
  878. -- 2016-11-15 laiyinghe DB:shebao
  879. -- 增加手动增员描述的字段
  880. ALTER TABLE `t_sb_buy_order`
  881. ADD COLUMN `manual_type` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '手动类型';
  882. -- 2016-10-31 laiyinghe DB:shebao
  883. -- 增加个预收费用的字段
  884. ALTER TABLE `t_sb_city_data`
  885. ADD COLUMN `pre_charge` decimal(8,2) UNSIGNED NULL DEFAULT 0 COMMENT '预收费用' AFTER `disabled`;
  886. ----------------------------------- 已同步线上 @ 2016-11-02
  887. -- 2016-10-13 laiyinghe DB:shebao
  888. -- 补差额表增加一个支付渠道字段。
  889. ALTER TABLE `t_sb_buy_order_added`
  890. ADD COLUMN `pay_channel` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '支付渠道' AFTER `months`;
  891. -- 2016-10-13 laiyinghe DB:shebao
  892. -- 日志增加一个类别字段,增加订单号为索引。
  893. ALTER TABLE `t_log_order`
  894. ADD COLUMN `opt_type` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '操作类别' AFTER `order_no`;
  895. -- 2016-09-16 laiyinghe DB:shebao
  896. -- 增加一个补缴方案与正常方案关联的字段。
  897. ALTER TABLE `t_sb_city`
  898. MODIFY COLUMN `proxy_type` tinyint(3) UNSIGNED NULL DEFAULT NULL COMMENT '社保的操作规则' AFTER `shebao_type`,
  899. ADD COLUMN `added_cid` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '补缴配置关联的正常配置id' AFTER `city_code`;
  900. ----------------------------------- 已同步线上 @ 2016-10-13
  901. -- 2016-09-21 chensenlai DB:shebao
  902. -- 社保资讯文章表。
  903. CREATE TABLE `t_sb_article` (
  904. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  905. `title` varchar(256) NOT NULL COMMENT '标题',
  906. `title_img` varchar(128) DEFAULT NULL COMMENT '标题图片',
  907. `cont` text NOT NULL COMMENT '内容',
  908. `cont_img` varchar(128) DEFAULT NULL COMMENT '正文图片',
  909. `hot` int(4) NOT NULL DEFAULT 3 COMMENT '热门标记 1-推广(APP首页单独) 2-热门 3-普通',
  910. `sort` int(10) NOT NULL DEFAULT 1 COMMENT '排序(降序)',
  911. `read_count` int(10) NOT NULL DEFAULT 0 COMMENT '阅读次数',
  912. `create_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  913. `update_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  914. `create_by` varchar(64) DEFAULT NULL COMMENT '来源',
  915. `disabled` int(4) NOT NULL DEFAULT 1 COMMENT '禁用 1-启用 2-禁用',
  916. PRIMARY KEY (`id`)
  917. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='社保资讯文章表';
  918. ----------------------------------- 已同步线上 @ 2016-09-22
  919. -- 2016-09-18 chensenlai DB:shebao
  920. -- 流程新增运营备注字段。
  921. ALTER TABLE `t_sb_material_flow`
  922. ADD COLUMN `memo_op` varchar(1024) DEFAULT NULL COMMENT '运营备注(显示在后台管理系统,用于运营人员查看)' AFTER `memo`;
  923. ----------------------------------- 已同步线上 @ 2016-09-10
  924. -- 2016-09-09 chensenlai DB:shebao
  925. -- 河北保定资料收集表。
  926. CREATE TABLE `t_sb_info_baoding` (
  927. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  928. `u_id` int(10) NOT NULL COMMENT '系统用户标识',
  929. `id_card` varchar(20) NOT NULL COMMENT '参保人身份证号码',
  930. `bank_number` varchar(32) DEFAULT NULL COMMENT '银行号码',
  931. `bank_name` varchar(64) DEFAULT NULL COMMENT '银行名称',
  932. `bank_filiale` varchar(64) DEFAULT NULL COMMENT '开户支行',
  933. PRIMARY KEY (`id`)
  934. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  935. ----------------------------------- 已同步线上 @ 2016-09-08
  936. -- 2016-08-29 laiyinghe DB:shebao_admin
  937. -- 统计城市每天产生的金额数
  938. CREATE TABLE `t_report_date_city` (
  939. `id` int(11) NOT NULL AUTO_INCREMENT,
  940. `gen_date` date NOT NULL COMMENT '生成日期',
  941. `city_code` mediumint(9) NOT NULL,
  942. `order_num` mediumint(9) DEFAULT '0' COMMENT '社保公积金支付成功的订单数',
  943. `refund_order_num` mediumint(9) DEFAULT '0' COMMENT '社保公积金退款的订单数',
  944. `shebao_order_num` mediumint(9) DEFAULT NULL COMMENT '社保支付成功订单数',
  945. `shebao_amount` decimal(10,2) DEFAULT '0.00' COMMENT '社保日总额(不含卡,手续)',
  946. `shebao_charge_amount` decimal(8,2) DEFAULT '0.00' COMMENT '社保服务费总额',
  947. `shebao_card_amount` decimal(8,2) DEFAULT '0.00' COMMENT '社保卡服务费总额',
  948. `fund_order_num` mediumint(9) DEFAULT '0' COMMENT '公积金支付成功订单数',
  949. `fund_amount` decimal(10,2) DEFAULT '0.00' COMMENT '公积金总额(不含服务费)',
  950. `fund_charge_amount` decimal(8,2) DEFAULT '0.00' COMMENT '公积金服务费总额',
  951. `move_shebao_order_num` mediumint(9) DEFAULT '0' COMMENT '转移社保支付成功订单数',
  952. `move_fund_order_num` mediumint(9) DEFAULT '0' COMMENT '转移公积金支付成功的订单数',
  953. `move_refund_order_num` mediumint(9) DEFAULT '0' COMMENT '转移全退款订单数',
  954. `move_charge_amount` decimal(8,2) DEFAULT '0.00' COMMENT '转移服务费总额',
  955. `total_amount` decimal(10,2) DEFAULT '0.00' COMMENT '发生的总金额',
  956. `total_actual_amount` decimal(10,2) DEFAULT '0.00' COMMENT '实际有效金额数',
  957. `total_repay_amount` decimal(10,2) DEFAULT '0.00' COMMENT '补差额金额数',
  958. `total_refund_amount` decimal(10,2) DEFAULT '0.00' COMMENT '退款金额数',
  959. `total_discount_amount` decimal(8,2) DEFAULT '0.00' COMMENT '优惠券金额数',
  960. `total_need_repay_amount` decimal(8,2) DEFAULT '0.00' COMMENT '需要用户补差额的总额(应收)',
  961. PRIMARY KEY (`id`),
  962. KEY `report_city_date_idx` (`gen_date`),
  963. KEY `report_city_citycode_idx` (`city_code`)
  964. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='统计城市每天产生的金额数';
  965. -- 2016-08-29 laiyinghe DB:shebao_admin
  966. -- 统计每天产生的金额数
  967. CREATE TABLE `t_report_month` (
  968. `id` int(11) NOT NULL AUTO_INCREMENT,
  969. `for_month` int(6) unsigned NOT NULL COMMENT '月份',
  970. `city_code` smallint(6) unsigned NOT NULL DEFAULT '0' COMMENT '城市代码',
  971. `order_num` mediumint(9) DEFAULT '0' COMMENT '社保公积金支付成功的订单数',
  972. `refund_order_num` mediumint(9) DEFAULT '0' COMMENT '社保公积金退款的订单数',
  973. `shebao_order_num` mediumint(9) DEFAULT NULL COMMENT '社保支付成功订单数',
  974. `shebao_amount` decimal(10,2) DEFAULT '0.00' COMMENT '社保有效总额(不含卡,手续)',
  975. `shebao_charge_amount` decimal(8,2) DEFAULT '0.00' COMMENT '社保服务费总额',
  976. `shebao_card_amount` decimal(8,2) DEFAULT '0.00' COMMENT '社保卡服务费总额',
  977. `fund_order_num` mediumint(9) DEFAULT '0' COMMENT '公积金支付成功订单数',
  978. `fund_amount` decimal(10,2) DEFAULT '0.00' COMMENT '公积金总额(不含服务费)',
  979. `fund_charge_amount` decimal(8,2) DEFAULT '0.00' COMMENT '公积金服务费总额',
  980. `move_shebao_order_num` mediumint(9) DEFAULT '0' COMMENT '转移社保支付成功订单数',
  981. `move_fund_order_num` mediumint(9) DEFAULT '0' COMMENT '转移公积金支付成功的订单数',
  982. `move_refund_order_num` mediumint(9) DEFAULT '0' COMMENT '转移全退款订单数',
  983. `move_charge_amount` decimal(8,2) DEFAULT '0.00' COMMENT '转移服务费总额',
  984. `total_amount` decimal(10,2) DEFAULT '0.00' COMMENT '发生的有效总金额',
  985. `total_actual_amount` decimal(10,2) DEFAULT '0.00' COMMENT '实际有效金额数',
  986. `total_repay_amount` decimal(10,2) DEFAULT '0.00' COMMENT '补差额金额数',
  987. `total_refund_amount` decimal(10,2) DEFAULT '0.00' COMMENT '退款金额数',
  988. `total_discount_amount` decimal(8,2) DEFAULT '0.00' COMMENT '优惠券金额数',
  989. `total_need_repay_amount` decimal(8,2) DEFAULT '0.00' COMMENT '需要用户补差额的总额(应收)',
  990. PRIMARY KEY (`id`),
  991. KEY `report_month_city_idx` (`city_code`)
  992. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='统计每月产生的金额数';
  993. ----------------------------------- 已同步线上 @ 2016-08-18
  994. -- 2016-08-19 laiyinghe DB:shebao
  995. -- 参数配置增加两个描述字段
  996. ALTER TABLE `t_sb_city`
  997. ADD COLUMN `shebao_desc` varchar(128) NULL DEFAULT '' COMMENT '社保描述' AFTER `fund_buy`,
  998. ADD COLUMN `fund_desc` varchar(128) NULL DEFAULT '' COMMENT '公积金描述' AFTER `shebao_desc`;
  999. ----------------------------------- 已同步线上 @ 2016-08-08
  1000. -- 2016-08-03 laiyinghe DB:shebao
  1001. -- 用户申请退款原因。
  1002. ALTER TABLE `t_sb_buy_order`
  1003. ADD COLUMN `refund_reason` varchar(128) NULL COMMENT '用户申请退款原因';
  1004. ----------------------------------- 已同步线上 @ 2016-07-29
  1005. -- 2016-07-29 chensenlai DB:shebao
  1006. -- 天津\上海\北京资料收集表。
  1007. CREATE TABLE `t_sb_info_tianjin` (
  1008. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1009. `u_id` int(10) NOT NULL COMMENT '系统用户标识',
  1010. `id_card` varchar(20) NOT NULL COMMENT '参保人身份证号码',
  1011. `user_name` varchar(12) NOT NULL COMMENT '参保人姓名',
  1012. `gender` varchar(2) DEFAULT NULL COMMENT '性别(男/女)',
  1013. `nation` varchar(16) DEFAULT NULL COMMENT '民族',
  1014. `birthcity` varchar(32) DEFAULT NULL COMMENT '出生城市',
  1015. `birthday` varchar(12) DEFAULT NULL COMMENT '出生年月',
  1016. `political_status` varchar(8) DEFAULT NULL COMMENT '政治面貌',
  1017. `phone` varchar(16) DEFAULT NULL COMMENT '手机号',
  1018. `education_level` varchar(8) DEFAULT NULL COMMENT '文化程度',
  1019. `graduate_school` varchar(32) DEFAULT NULL COMMENT '毕业学校',
  1020. `graduate_time` varchar(12) DEFAULT NULL COMMENT '毕业时间',
  1021. `major` varchar(32) DEFAULT NULL COMMENT '所学专业',
  1022. `hk_type` varchar(8) DEFAULT NULL COMMENT '户口类型',
  1023. `hk_street` varchar(128) DEFAULT NULL COMMENT '户口所在街区',
  1024. `address` varchar(128) DEFAULT NULL COMMENT '常住地址',
  1025. `postcode` varchar(8) DEFAULT NULL COMMENT '邮政编码',
  1026. `hk_address` varchar(128) DEFAULT NULL COMMENT '户口所在地址',
  1027. `hk_time` varchar(12) DEFAULT NULL COMMENT '户口登记日期',
  1028. `work_time` varchar(12) DEFAULT NULL COMMENT '工作时间',
  1029. `professional_post` varchar(32) DEFAULT NULL COMMENT '专业技术职务',
  1030. `qualification_level` varchar(32) DEFAULT NULL COMMENT '职业资格证等级',
  1031. `qualification_Time` varchar(12) DEFAULT NULL COMMENT '取得资格证日期',
  1032. `country_qualification_level` varchar(32) DEFAULT NULL COMMENT '国家职业资格等级',
  1033. `email` varchar(32) DEFAULT NULL COMMENT '邮件地址',
  1034. PRIMARY KEY (`id`)
  1035. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1036. CREATE TABLE `t_sb_info_shanghai` (
  1037. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1038. `u_id` int(10) NOT NULL COMMENT '系统用户标识',
  1039. `id_card` varchar(20) NOT NULL COMMENT '参保人身份证号码',
  1040. `user_name` varchar(12) NOT NULL COMMENT '参保人姓名',
  1041. `gender` varchar(2) DEFAULT NULL COMMENT '性别(男/女)',
  1042. `nation` varchar(16) DEFAULT NULL COMMENT '民族',
  1043. `phone` varchar(16) DEFAULT NULL COMMENT '手机号',
  1044. `used_name` varchar(12) DEFAULT NULL COMMENT '曾用名',
  1045. `political_status` varchar(8) DEFAULT NULL COMMENT '政治面貌',
  1046. `education_level` varchar(16) DEFAULT NULL COMMENT '受教育程度',
  1047. `other_phone` varchar(16) DEFAULT NULL COMMENT '其他联系方式',
  1048. `marriage_status` varchar(8) DEFAULT NULL COMMENT '婚姻情况',
  1049. `spause_name` varchar(12) DEFAULT NULL COMMENT '配偶姓名',
  1050. `spause_id_card` varchar(20) DEFAULT NULL COMMENT '配偶身份证',
  1051. `is_spause_local_hk` varchar(2) DEFAULT NULL COMMENT '配偶是否本地户籍',
  1052. `children_num` varchar(2) DEFAULT NULL COMMENT '子女数目',
  1053. `health_status` varchar(32) DEFAULT NULL COMMENT '个人健康状况',
  1054. `hk_type` varchar(8) DEFAULT NULL COMMENT '户籍类别',
  1055. `hk_address` varchar(128) DEFAULT NULL COMMENT '户籍地址',
  1056. `address` varchar(128) DEFAULT NULL COMMENT '居住地址',
  1057. `address_street` varchar(128) DEFAULT NULL COMMENT '居住地街道',
  1058. `postcode` varchar(8) DEFAULT NULL COMMENT '邮政编码',
  1059. `is_have_residence` varchar(8) DEFAULT NULL COMMENT '是否领居住证',
  1060. `residence_code` varchar(32) DEFAULT NULL COMMENT '居住证号码',
  1061. `residence_type` varchar(8) DEFAULT NULL COMMENT '居住证类型',
  1062. `email` varchar(32) DEFAULT NULL COMMENT '电子邮箱',
  1063. PRIMARY KEY (`id`)
  1064. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1065. CREATE TABLE `t_sb_info_beijing` (
  1066. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1067. `u_id` int(10) NOT NULL COMMENT '系统用户标识',
  1068. `id_card` varchar(20) NOT NULL COMMENT '参保人身份证号码',
  1069. `img_path` varchar(64) NOT NULL COMMENT '上传图片路径',
  1070. `bank_number` varchar(32) DEFAULT NULL COMMENT '银行号码',
  1071. `bank_name` varchar(64) DEFAULT NULL COMMENT '银行名称',
  1072. `bank_filiale` varchar(64) DEFAULT NULL COMMENT '开户支行',
  1073. PRIMARY KEY (`id`)
  1074. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1075. ----------------------------------- 已同步线上 @ 2016-07-18
  1076. -- 2016-07-12 laiyinghe DB:shebao
  1077. -- 转移表增加运营备注的字段。
  1078. ALTER TABLE `t_sb_move`
  1079. ADD COLUMN `notes` varchar(128) NULL COMMENT '运营备注';
  1080. -- 2016-07-05 chensenlai DB:shebao
  1081. -- 流程新增备注字段,显示在app上。
  1082. ALTER TABLE `t_sb_material_flow`
  1083. ADD COLUMN `memo` varchar(1024) DEFAULT NULL COMMENT '备注信息' AFTER `todo_flag`;
  1084. ----------------------------------- 已同步线上 @ 2016-06-27
  1085. -- 2016-06-23 laiyinghe DB:shebao
  1086. -- 修改备注字段长度到128,增加标记的状态字段。
  1087. ALTER TABLE `t_sb_buy_order`
  1088. MODIFY COLUMN `app_remark` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机端补缴退款提示' AFTER `gen_time`,
  1089. ADD COLUMN `sign_status` smallint UNSIGNED NULL DEFAULT 0 COMMENT '标记的状态' AFTER `first_buy`;
  1090. ----------------------------------- 已同步线上 @ 2016-06-20
  1091. -- 2016-06-02 laiyinghe DB:shebao
  1092. -- 已购买记录表增加参数配置的标识字段(保存购买过的档位)
  1093. ALTER TABLE `t_sb_buyed`
  1094. ADD COLUMN `cid` mediumint UNSIGNED NULL COMMENT '参数配置的标识' AFTER `city_code`;
  1095. UPDATE t_sb_buyed a SET a.cid=(
  1096. SELECT b.id FROM t_sb_city b WHERE b.city_code=a.city_code
  1097. );
  1098. -- 2016-05-31 laiyinghe DB:shebao
  1099. -- 收件地址表设计
  1100. CREATE TABLE `t_user_address` (
  1101. `u_id` int(10) unsigned NOT NULL,
  1102. `u_name` varchar(20) DEFAULT '姓名',
  1103. `phone` varchar(16) DEFAULT '' COMMENT '电话',
  1104. `area` varchar(64) DEFAULT NULL COMMENT '区域',
  1105. `address` varchar(256) DEFAULT NULL COMMENT '地址',
  1106. `update_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  1107. KEY `user_address_uid_idx` (`u_id`)
  1108. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1109. ----------------------------------- 已同步线上 @ 2016-05-26
  1110. -- 2016-05-26 chensenlai DB:shebao
  1111. -- 修改短信长度
  1112. alter table t_sb_city_ext modify column shebao_inc_sms varchar(512) DEFAULT NULL COMMENT '短信内容';
  1113. alter table t_sb_city_ext modify column shebao_inc_sms_next varchar(512) DEFAULT NULL COMMENT '短信内容';
  1114. alter table t_sb_city_ext modify column fund_inc_sms varchar(512) DEFAULT NULL COMMENT '短信内容';
  1115. alter table t_sb_city_ext modify column fund_inc_sms_next varchar(512) DEFAULT NULL COMMENT '短信内容';
  1116. alter table t_sb_city_ext modify column shebao_card_sms varchar(512) DEFAULT NULL COMMENT '短信内容';
  1117. ----------------------------------- 已同步线上 @ 2016-05-18
  1118. -- 2016-05-05 chensenlai DB:shebao
  1119. -- 城市资料跟踪配置表,增加续保配置(原配置当成首次配置)。
  1120. -- 修改原来备注信息
  1121. ALTER TABLE `t_sb_city_ext`
  1122. MODIFY COLUMN `shebao_inc_info` tinyint(4) unsigned NOT NULL COMMENT '首次增员资料提交方式';
  1123. ALTER TABLE `t_sb_city_ext`
  1124. MODIFY COLUMN `fund_inc_info` tinyint(3) unsigned DEFAULT NULL COMMENT '首次公积金增员资料';
  1125. ALTER TABLE `t_sb_city_ext`
  1126. MODIFY COLUMN `fund_inc_sms` varchar(128) DEFAULT NULL COMMENT '短信内容';
  1127. -- 新增续保配置信息
  1128. ALTER TABLE `t_sb_city_ext`
  1129. ADD COLUMN `shebao_inc_info_next` tinyint(4) unsigned NOT NULL COMMENT '续保增员资料提交方式' AFTER `shebao_inc_sms`;
  1130. ALTER TABLE `t_sb_city_ext`
  1131. ADD COLUMN `shebao_inc_sms_next` varchar(128) DEFAULT NULL COMMENT '短信内容' AFTER `shebao_inc_info_next`;
  1132. ALTER TABLE `t_sb_city_ext`
  1133. ADD COLUMN `fund_inc_info_next` tinyint(3) unsigned DEFAULT NULL COMMENT '续保公积金增员资料' AFTER `fund_inc_sms`;
  1134. ALTER TABLE `t_sb_city_ext`
  1135. ADD COLUMN `fund_inc_sms_next` varchar(128) DEFAULT NULL COMMENT '短信内容' AFTER `fund_inc_info_next`;
  1136. -- 更新数据
  1137. -- 运营人员自己配置 by chensenlai 2016-05-20
  1138. -- UPDATE t_sb_city_ext SET shebao_inc_info_next = shebao_inc_info, shebao_inc_sms_next = shebao_inc_sms, fund_inc_info_next = fund_inc_info, fund_inc_sms_next = fund_inc_sms;
  1139. -- 2016-04-27 lyh DB:shebao
  1140. -- 首次购买表字字段
  1141. ALTER TABLE `t_sb_buy`
  1142. ADD COLUMN `first_sb` tinyint UNSIGNED DEFAULT '0' COMMENT '此城市首次参保',
  1143. ADD COLUMN `first_fund` tinyint UNSIGNED DEFAULT '0' COMMENT '此城市首次缴公积金';
  1144. ALTER TABLE `t_sb_buy_order`
  1145. ADD COLUMN `first_buy` tinyint UNSIGNED DEFAULT '0' COMMENT '此城市首次购买';
  1146. -- 2016-04-21 lyh DB:shebao
  1147. -- 增加转移的配置表
  1148. CREATE TABLE `t_sb_city_move` (
  1149. `city_code` int(10) unsigned NOT NULL COMMENT '城市代码',
  1150. `is_out` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '能否转出',
  1151. `shebao_out_sms` varchar(128) DEFAULT NULL COMMENT '社保转出配置短信内容',
  1152. `fund_out_sms` varchar(128) DEFAULT NULL COMMENT '公积金转出配置短信内容',
  1153. `is_in` tinyint(3) unsigned NOT NULL COMMENT '能否转入',
  1154. `shebao_in_sms` varchar(128) DEFAULT NULL COMMENT '社保转入配置短信内容',
  1155. `fund_in_sms` varchar(128) DEFAULT NULL COMMENT '公积金转入配置短信内容',
  1156. `charge` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '手续费',
  1157. `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  1158. PRIMARY KEY (`city_code`)
  1159. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='转入转出配置';
  1160. -- 2016-04-21 lyh DB:shebao
  1161. -- 增加转移表
  1162. CREATE TABLE `t_sb_move` (
  1163. `move_no` varchar(32) NOT NULL COMMENT '转移订单号',
  1164. `pay_uid` int(10) unsigned NOT NULL COMMENT '转移帐号标识',
  1165. `id_card` varchar(20) DEFAULT NULL COMMENT '身份证',
  1166. `user_name` varchar(20) NOT NULL COMMENT '转移人姓名',
  1167. `move_type` tinyint(3) unsigned NOT NULL COMMENT '转移类型:1社保 2公积金',
  1168. `out_city` mediumint(8) unsigned DEFAULT NULL COMMENT '转出城市',
  1169. `into_city` mediumint(8) unsigned DEFAULT NULL COMMENT '转入城市',
  1170. `couponuser_id` varchar(20) DEFAULT NULL COMMENT '用户现金券标识',
  1171. `couponuser_price` decimal(6,2) unsigned DEFAULT NULL COMMENT '用户折扣掉金额',
  1172. `total_charge` decimal(8,2) unsigned NOT NULL COMMENT '总金额',
  1173. `actual_charge` decimal(8,2) unsigned NOT NULL COMMENT '优惠后金额',
  1174. `status` tinyint(3) unsigned NOT NULL COMMENT '状态',
  1175. `gen_time` datetime NOT NULL,
  1176. `pay_channel` varchar(16) NOT NULL COMMENT '支付渠道标识',
  1177. `pay_no` varchar(128) DEFAULT NULL COMMENT '第三方支付流水号',
  1178. `remark` varchar(128) DEFAULT NULL,
  1179. PRIMARY KEY (`move_no`)
  1180. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='转移';
  1181. ALTER TABLE `t_sb_move`
  1182. ADD INDEX `move_uid_idx` (`pay_uid`) ;
  1183. -- 2016-04-21 lyh DB:shebao
  1184. -- 城市配置表增加转移标志字段。
  1185. ALTER TABLE `t_city`
  1186. ADD COLUMN `move_disabled` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '转移禁用' AFTER `disabled`;
  1187. -- 2016-04-21 lyh DB:shebao
  1188. -- 已支付成功时,也保存户籍
  1189. ALTER TABLE `t_sb_buyed`
  1190. ADD COLUMN `hukou` tinyint UNSIGNED NULL COMMENT '购买的户籍';
  1191. -- 2016-04-20 lyh DB:shebao
  1192. -- 补缴增加字段
  1193. ALTER TABLE `t_sb_city_added`
  1194. ADD COLUMN `added_charge` decimal(6,2) UNSIGNED NULL COMMENT '补缴服务费',
  1195. ADD COLUMN `shebao_num` tinyint UNSIGNED NULL COMMENT '社保可补缴月数',
  1196. ADD COLUMN `fund_num` tinyint UNSIGNED NULL COMMENT '公积金补缴月份数';
  1197. ----------------------------------- 已同步线上 @ 2016-04-20
  1198. -- 2016-04-12 lyh DB:shebao
  1199. -- 企业用户备注字段更改类型。
  1200. ALTER TABLE `t_ent_sign`
  1201. MODIFY COLUMN `phone_result` varchar(64) NULL DEFAULT '' COMMENT '电话回访结果';
  1202. ----------------------------------- 已同步线上 @ 2016-04-18
  1203. -- 2016-04-12 lyh DB:shebao
  1204. -- 增加订单变动日志表。
  1205. CREATE TABLE `t_log_order` (
  1206. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  1207. `order_no` varchar(32) NOT NULL,
  1208. `opt_user` varchar(16) NOT NULL,
  1209. `opt_content` varchar(256) NOT NULL,
  1210. `gen_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  1211. PRIMARY KEY (`id`)
  1212. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='订单变动日志';
  1213. -- 2016-04-12 lyh DB:shebao
  1214. -- 增加登录日志表。
  1215. CREATE TABLE `t_log_login` (
  1216. `u_id` int(10) unsigned NOT NULL,
  1217. `app_version` varchar(12) DEFAULT NULL,
  1218. `login_ip` varchar(32) DEFAULT NULL,
  1219. `login_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  1220. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1221. -- 2016-04-14 chensenlai DB:shebao_admin
  1222. -- 新增临时卡登记表,登记社保号和公积金号
  1223. CREATE TABLE `t_tmp_card` (
  1224. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1225. `batch_no` varchar(32) COMMENT '导入批次号',
  1226. `id_card` varchar(20) COMMENT '参保人身份证',
  1227. `shebao_card` varchar(32) COMMENT '社保号',
  1228. `fund_card` varchar(32) COMMENT '公积金号',
  1229. `status` int(4) unsigned NOT NULL DEFAULT '1' COMMENT '处理状态标识:1-未处理/2-处理成功/3-处理失败',
  1230. `memo` varchar(255) COMMENT '备注',
  1231. `create_time` datetime NOT NULL COMMENT '导入时间',
  1232. PRIMARY KEY (`id`),
  1233. KEY `uid_idx` (`batch_no`)
  1234. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='参保人员社保号公积金号批量导入临时登记表';
  1235. -- 2016-04-14 chensenlai DB:shebao
  1236. -- 参保人表新增公积金号
  1237. ALTER TABLE `t_sb_user`
  1238. ADD COLUMN `fund_card` varchar(32) NULL COMMENT '公积金号' AFTER `shebao_card`;
  1239. -- 2016-04-14 lyh DB:shebao-admin
  1240. -- 减员表增加一个参考月份字段,减员就是对这个月份检查有无购买。
  1241. ALTER TABLE `t_sb_stop`
  1242. ADD COLUMN `via_month` mediumint UNSIGNED NULL DEFAULT 0 COMMENT '参考月份' AFTER `stop_month`;
  1243. -- 2016-04-13 lyh DB:shebao-admin
  1244. -- 原因字段改成20个长度。
  1245. ALTER TABLE `t_sb_employee`
  1246. MODIFY COLUMN `any_reason` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '失败原因';
  1247. -- 2016-04-12 lyh DB:shebao
  1248. -- 消息表增加手机字段,用于支持参保人联系的手机号收短信。
  1249. ALTER TABLE `t_sb_msg`
  1250. ADD COLUMN `phone` varchar(16) NULL COMMENT '手机号' AFTER `channel`;
  1251. ----------------------------------- 已同步线上 @ 2016-04-07
  1252. -- 2016-04-07 lyh DB:shebao
  1253. -- 企业登记表--增加回访结果
  1254. ALTER TABLE `t_ent_sign`
  1255. ADD COLUMN `phone_result` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '电话回访结果',
  1256. ADD COLUMN `phone_time` datetime NULL COMMENT '回访时间';
  1257. -- 2016-04-01 lyh DB:shebao
  1258. -- 增加表--补缴配置
  1259. CREATE TABLE `t_sb_city_added` (
  1260. `cid` int(10) unsigned NOT NULL,
  1261. `shebao_note` varchar(252) DEFAULT NULL COMMENT '社保补缴说明',
  1262. `fund_note` varchar(252) DEFAULT NULL COMMENT '公积金补缴说明',
  1263. PRIMARY KEY (`cid`)
  1264. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1265. -- 2016-03-31 lyh DB:shebao
  1266. -- 原手动标识改为手动增员月份
  1267. ALTER TABLE `t_sb_buy_order`
  1268. MODIFY COLUMN `manual` mediumint UNSIGNED NOT NULL DEFAULT 0 COMMENT '手动增员月份' AFTER `added`;
  1269. -- ----begin 资料跟踪需求
  1270. -- 20160322 chensenlai DB:shebao
  1271. -- 资料跟踪流程登记表
  1272. CREATE TABLE `t_sb_material_flow` (
  1273. `f_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1274. `source` int(4) unsigned NOT NULL COMMENT '1-社保/2-公积金/3-社保卡',
  1275. `source_op` int(4) unsigned NOT NULL COMMENT '0-无/1-电子/2-邮寄',
  1276. `source_type` int(4) unsigned NOT NULL DEFAULT '1' COMMENT '1-系统/2-人工',
  1277. `u_id` int(10) NOT NULL COMMENT '系统用户标识(流程所属用户)',
  1278. `city_code` int(10) COMMENT '参保城市',
  1279. `user_name` varchar(12) COMMENT '参保人姓名',
  1280. `id_card` varchar(20) COMMENT '参保人身份证',
  1281. `buy_no` varchar(32) COMMENT '资料关联买单编号',
  1282. `flow_status` int(4) unsigned NOT NULL DEFAULT '1' COMMENT '跟踪流程状态标识:1-办理中/2-已完成/3-已关闭/4-APP隐藏(超过30天隐藏)/5-已删除',
  1283. `cur_node_type` int(4) unsigned NOT NULL DEFAULT '1000' COMMENT '跟踪流程当前节点类型,默认开始节点',
  1284. `todo_flag` int(4) unsigned NOT NULL DEFAULT '2' COMMENT '标识当前流程应该由谁处理(当前节点配置决定)。1-APP标识红点 2-APP不标识红点',
  1285. `create_time` datetime NOT NULL COMMENT '资料流程创建时间',
  1286. `update_time` datetime NOT NULL COMMENT '资料流程更新时间',
  1287. PRIMARY KEY (`f_id`),
  1288. KEY `uid_idx` (`u_id`)
  1289. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='资料跟踪流程登记表';
  1290. -- 资料跟踪流程节点登记表
  1291. CREATE TABLE `t_sb_material_node` (
  1292. `n_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1293. `f_id` int(10) unsigned NOT NULL COMMENT '节点关联流程id',
  1294. `node_type` int(4) unsigned NOT NULL COMMENT '节点类型,见枚举值定义',
  1295. `memo` varchar(1024) COMMENT '备注信息',
  1296. `create_time` datetime NOT NULL COMMENT '节点创建时间',
  1297. `update_time` datetime NOT NULL COMMENT '节点更新时间',
  1298. PRIMARY KEY (`n_id`),
  1299. KEY `fid_idx` (`f_id`)
  1300. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='资料跟踪流程节点登记表';
  1301. -- 资料信息登记表
  1302. CREATE TABLE `t_sb_material` (
  1303. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1304. `f_id` int(10) unsigned NOT NULL COMMENT '资料关联流程id',
  1305. `n_id` int(10) unsigned NOT NULL COMMENT '资料关联节点id',
  1306. `file_index` int(10) unsigned NOT NULL COMMENT '资料文件索引下标',
  1307. `file_path` varchar(512) NOT NULL COMMENT '资料上传路径',
  1308. `material_status` int(4) unsigned NOT NULL DEFAULT '1' COMMENT '材料状态标识:1-有效/2-已删除',
  1309. `create_time` datetime NOT NULL COMMENT '资料创建时间',
  1310. PRIMARY KEY (`id`),
  1311. KEY `fid_idx` (`f_id`)
  1312. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='资料信息登记表';
  1313. -- 资料消息提醒登记表
  1314. CREATE TABLE `t_sb_material_msg` (
  1315. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1316. `f_id` int(10) unsigned NOT NULL COMMENT '资料关联流程id',
  1317. `n_id` int(10) unsigned NOT NULL COMMENT '资料关联节点id',
  1318. `msg_type` int(10) unsigned COMMENT 'msg_type异步发送消息',
  1319. `title` varchar(255) NOT NULL COMMENT '消息标题',
  1320. `content` varchar(1024) NOT NULL COMMENT '消息内容',
  1321. `create_time` datetime NOT NULL COMMENT '资料创建时间',
  1322. PRIMARY KEY (`id`),
  1323. KEY `fid_idx` (`f_id`)
  1324. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='资料消息提醒登记表';
  1325. -- ---- end 资料跟踪需求
  1326. ----------------------------------- 已同步线上 @ 2016-03-25
  1327. --2016-03-23 lyh DB:shebao
  1328. --- 记录公积金购买的金额、月份
  1329. ALTER TABLE `t_sb_buyed`
  1330. ADD COLUMN `fund_price` double(8,2) UNSIGNED NOT NULL DEFAULT 0.0 COMMENT '公积金购买金额',
  1331. ADD COLUMN `mfund` mediumint UNSIGNED NOT NULL DEFAULT 0 COMMENT '公积金购买月份' AFTER `fund_price`;
  1332. ----------------------------------- 已同步线上 @ 2016-03-23
  1333. --2016-03-23 lyh DB:shebao
  1334. --- 增加短信发送标注字段、增加消息发送方式字段
  1335. ALTER TABLE `t_sb_msg`
  1336. ADD COLUMN `channel` varchar(4) DEFAULT 'p' COMMENT 'p推送、s短信、ps推送+短信' AFTER `content`;
  1337. ALTER TABLE `t_sb_msg`
  1338. ADD COLUMN `smsed` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '短信是否发送' AFTER `sended`;
  1339. --2016-03-21 lyh DB:shebao
  1340. --- 城市配置扩展表
  1341. CREATE TABLE `t_sb_city_ext` (
  1342. `cid` int(10) unsigned NOT NULL,
  1343. `shebao_inc_info` tinyint(4) unsigned NOT NULL COMMENT '增员资料提交方式',
  1344. `shebao_inc_sms` varchar(128) DEFAULT NULL COMMENT '短信内容',
  1345. `fund_inc_info` tinyint(3) unsigned DEFAULT NULL COMMENT '公积金增员资料',
  1346. `fund_inc_sms` varchar(128) DEFAULT NULL,
  1347. `shebao_card_info` tinyint(4) unsigned NOT NULL COMMENT '新办卡资料投递方式',
  1348. `shebao_card_sms` varchar(128) DEFAULT NULL COMMENT '短信内容',
  1349. PRIMARY KEY (`cid`)
  1350. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='城市资料、补缴等配置';
  1351. ----------------------------------- 已同步线上 @ 2016-03-18
  1352. --2016-03-15 lyh DB:shebao
  1353. --- 消息按类型发送
  1354. CREATE TABLE `t_sb_msg_type` (
  1355. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1356. `channel` varchar(12) NOT NULL COMMENT '消息发送方式',
  1357. `receive` varchar(12) NOT NULL COMMENT '接收人类型',
  1358. `conditions` text COMMENT '接收人条件',
  1359. `title` varchar(128) NOT NULL COMMENT '消息标题',
  1360. `content` varchar(256) NOT NULL DEFAULT '内容',
  1361. `sizes` int(10) unsigned NOT NULL COMMENT '人数',
  1362. `counts` int(10) unsigned DEFAULT '0' COMMENT '已发送数',
  1363. `gen_sec` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间-秒',
  1364. PRIMARY KEY (`id`)
  1365. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1366. --2016-03-15 lyh DB:shebao
  1367. --- 消息增加注解,用于显示消息来源等
  1368. ALTER TABLE `t_sb_msg`
  1369. ADD COLUMN `type_msg_id` int(10) NULL;
  1370. ALTER TABLE `t_sb_msg`
  1371. ADD INDEX `msg_uid_idx` (`u_id`) ,
  1372. ADD INDEX `msg_tid_idx` (`type_msg_id`) ;
  1373. --------------------------- 已同步线上@2016-03-10
  1374. --20160309 lyh DB:shebao
  1375. --- 公积金是否能够单独购买
  1376. ALTER TABLE `t_sb_city`
  1377. ADD COLUMN `fund_buy` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT '单独购买' AFTER `fund_opt`;
  1378. --------------------------- 以下是 V1.2.3 已同步线上@2016-02-24
  1379. --20160218 lyh DB:shebao_admin
  1380. ---是否进行了开卡标志
  1381. ALTER TABLE `t_sb_employee`
  1382. ADD COLUMN `new_card` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否进行了开卡' AFTER `gen_time`;
  1383. --20160218 lyh DB:shebao_admin
  1384. ---是否进行了开卡标志
  1385. ALTER TABLE `t_sb_buy_order_ext`
  1386. ADD COLUMN `new_card` tinyint(1) UNSIGNED NULL DEFAULT 0 COMMENT '是否进行了开卡' AFTER `repay_reason`;
  1387. --20160126 侯庆营 DB:shebao
  1388. ---订单表添加字段是否已手动增员
  1389. ALTER TABLE `shebao`.`t_sb_buy_order`
  1390. ADD COLUMN `manual` TINYINT(1) UNSIGNED DEFAULT 0 NOT NULL COMMENT '是否已手动增员' AFTER `added`;
  1391. --20160118 赖应和 DB:shebao
  1392. ---城市显示顺序
  1393. ALTER TABLE `t_city`
  1394. ADD COLUMN `seque` tinyint UNSIGNED NULL COMMENT '显示顺序';
  1395. --20160118 侯庆营 DB:shebao
  1396. ---增员表添加补缴增员月份
  1397. ALTER TABLE `t_sb_employee`
  1398. ADD COLUMN `added_month` mediumint(8) UNSIGNED NULL COMMENT '补缴增员月份';
  1399. --20160118 侯庆营 DB:shebao
  1400. ---订单是否补缴单的标识
  1401. ALTER TABLE `t_sb_buy_order`
  1402. ADD COLUMN `added` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否补缴单';
  1403. --20160118 赖应和 DB:shebao
  1404. ---购买表增是否补缴单的标识
  1405. ALTER TABLE `t_sb_buy`
  1406. ADD COLUMN `added` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '是否补缴单' AFTER `audit`;
  1407. --------------------------- 以下是 V1.2.2 已同步线上@2016-01-13
  1408. --20160113 侯庆营 DB:shebao
  1409. ---更改数据类型。
  1410. ALTER TABLE `shebao`.`t_sb_coupon_user`
  1411. CHANGE `phone` `phone` VARCHAR(11) NULL COMMENT '绑定手机号';
  1412. --20160113 侯庆营 DB:shebao
  1413. ---添加分享使用上限。
  1414. ALTER TABLE `shebao`.`t_sb_link`
  1415. ADD COLUMN `share_limit` INT(10) NULL COMMENT '分享使用上限';
  1416. --20160113 侯庆营 DB:shebao
  1417. ---添加买单审核状态。
  1418. ALTER TABLE `shebao`.`t_sb_buy`
  1419. ADD COLUMN `audit` TINYINT(1) DEFAULT 0 NULL COMMENT '审核状态(0,未审核;1,已审核)';
  1420. --20160112 侯庆营 DB:shebao
  1421. ---添加链接点击次数。
  1422. ALTER TABLE `shebao`.`t_sb_link`
  1423. ADD COLUMN `count` INT(10) DEFAULT 0 NULL COMMENT '点击次数' AFTER `comment`;
  1424. --20160108 侯庆营 DB:shebao
  1425. ---添加链接备注。
  1426. ALTER TABLE `shebao`.`t_sb_link`
  1427. ADD COLUMN `comment` VARCHAR(200) NULL COMMENT '备注';
  1428. --20160107 侯庆营 DB:shebao
  1429. ---本单实际支付金额。
  1430. ALTER TABLE `shebao`.`t_sb_buy`
  1431. ADD COLUMN `total_fee_actual` DECIMAL(8,2) DEFAULT 0.00 NULL COMMENT '本单实际支付金额';
  1432. --20160106 侯庆营 DB:shebao
  1433. ---添加字段链接分享来源标识。
  1434. ALTER TABLE `shebao`.`t_sb_link`
  1435. ADD COLUMN `share_id` VARCHAR(11) NULL COMMENT '分享来源标识';
  1436. --20160105 侯庆营 DB:shebao
  1437. ---添加字段链接代码。
  1438. ALTER TABLE `shebao`.`t_sb_coupon_user`
  1439. ADD COLUMN `recommend_code` VARCHAR(50) NULL COMMENT '链接代码';
  1440. --20160104 侯庆营 DB:shebao
  1441. ---现金券相关。
  1442. CREATE TABLE `shebao`.`t_sb_coupon`(
  1443. `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID标识',
  1444. `name` VARCHAR(255) NOT NULL COMMENT '现金券名称',
  1445. `status` TINYINT(1) NOT NULL COMMENT '现金券状态',
  1446. `start_date` DATETIME COMMENT '开始时间',
  1447. `end_date` DATETIME COMMENT '结束时间',
  1448. `type` TINYINT(2) COMMENT '现金券类型',
  1449. `create_time` DATETIME COMMENT '创建时间',
  1450. `description` VARCHAR(255) COMMENT '描述(使用规则等)',
  1451. `price` DOUBLE(10,2) COMMENT '现金券金额',
  1452. `init_number` INT(11) COMMENT '初始化数量(运营操作)',
  1453. `bind_number` INT(11) COMMENT '已绑定数量(手机绑定)',
  1454. `used_number` INT(11) COMMENT '已消费数量(订单使用)',
  1455. `send_number` INT(11) COMMENT '已发放数量(预留占用)',
  1456. `person_limit` TINYINT(2) COMMENT '单个用户领取限额',
  1457. `month_limit` TINYINT(2) DEFAULT 0 NULL COMMENT '有效月数',
  1458. PRIMARY KEY (`id`)
  1459. )
  1460. COMMENT='现金券表';
  1461. CREATE TABLE `shebao`.`t_sb_coupon_user`(
  1462. `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID标识',
  1463. `coupon_id` INT(11) COMMENT '现金券ID',
  1464. `phone` INT(11) COMMENT '绑定手机号',
  1465. `coupon_code` VARCHAR(50) COMMENT '现金券编号',
  1466. `coupon_price` DOUBLE(10,2) COMMENT '现金券金额',
  1467. `user_id` INT(10) COMMENT '绑定用户ID',
  1468. `user_name` VARCHAR(32) COMMENT '绑定用户名',
  1469. `create_time` DATETIME COMMENT '创建时间',
  1470. `end_time` DATETIME NULL COMMENT '截止时间',
  1471. `consume_time` DATETIME COMMENT '消费时间',
  1472. `order_no` VARCHAR(32) COMMENT '订单号',
  1473. `order_price` DOUBLE(15,2) COMMENT '订单总金额',
  1474. `create_from` INT(2) NULL COMMENT '领券来源(1,后台运营绑定;2,注册用户分享;3,广告投放)',
  1475. `status` INT(2) COMMENT '使用状态(1,未使用;2,已使用;3,已过期)',
  1476. PRIMARY KEY (`id`)
  1477. )
  1478. COMMENT='现金券用户关联表';
  1479. ALTER TABLE `shebao`.`t_sb_coupon_user`
  1480. ADD COLUMN `recommend_phone` VARCHAR(11) NULL COMMENT '推荐人手机号' AFTER `status`,
  1481. ADD COLUMN `recommend_code` VARCHAR(50) NULL COMMENT '链接代码' AFTER `recommend_phone`;
  1482. ALTER TABLE `shebao`.`t_sb_coupon`
  1483. ADD COLUMN `channels` VARCHAR(255) NULL COMMENT '领券渠道限制' AFTER `month_limit`;
  1484. CREATE TABLE `shebao`.`t_sb_coupon_channel`(
  1485. `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '领券来源ID标识',
  1486. `name` VARCHAR(100) COMMENT '领券来源名称',
  1487. PRIMARY KEY (`id`)
  1488. )
  1489. COMMENT='领券来源定义';
  1490. ALTER TABLE `shebao`.`t_sb_buy`
  1491. ADD COLUMN `couponuser_id` VARCHAR(255) NULL COMMENT '用户现金券逗号分ID' AFTER `gen_time`;
  1492. ALTER TABLE `shebao`.`t_sb_buy`
  1493. ADD COLUMN `couponuser_price` INT(10) NULL COMMENT '用户现金券金额' AFTER `couponuser_id`;
  1494. CREATE TABLE `shebao`.`t_sb_link`(
  1495. `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '标识ID',
  1496. `url` VARCHAR(200) NOT NULL COMMENT '链接URL',
  1497. `code` VARCHAR(50) NOT NULL COMMENT '链接码',
  1498. `end_date` DATETIME COMMENT '失效时间',
  1499. `type` TINYINT(2) NOT NULL COMMENT '链接类型',
  1500. `create_time` DATETIME NOT NULL COMMENT '创建时间',
  1501. `purpose` TINYINT(2) NOT NULL COMMENT '链接用途',
  1502. `month_limit` TINYINT(2) unsigned DEFAULT '0' COMMENT '有效月数',
  1503. PRIMARY KEY (`id`)
  1504. );
  1505. --20151216 赖应和 DB:shebao
  1506. ---企业资料登记。
  1507. CREATE TABLE `t_ent_sign` (
  1508. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1509. `enName` varchar(64) NOT NULL COMMENT '企业名称',
  1510. `contact_name` varchar(32) NOT NULL COMMENT '联系人',
  1511. `contact_phone` varchar(16) NOT NULL COMMENT '联系电话',
  1512. `demand` varchar(32) NOT NULL COMMENT '业务',
  1513. `employees` varchar(12) NOT NULL COMMENT '员工数',
  1514. `city` varchar(32) NOT NULL,
  1515. `remark` varchar(256) DEFAULT NULL COMMENT '备注',
  1516. `gen_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  1517. PRIMARY KEY (`id`)
  1518. ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
  1519. --20151216 赖应和 DB:shebao_admin
  1520. --- 记录参数配置改动
  1521. CREATE TABLE `t_log_city_param` (
  1522. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1523. `cid` int(10) unsigned NOT NULL COMMENT '参数标识',
  1524. `city_name` varchar(32) DEFAULT NULL,
  1525. `modify_type` tinyint(3) unsigned NOT NULL COMMENT '0主数据,1~4对应户籍',
  1526. `pre_content` mediumtext COMMENT '修改前内容',
  1527. `curr_content` mediumtext NOT NULL COMMENT '当前内容',
  1528. `admin_user` varchar(32) NOT NULL COMMENT '修改人',
  1529. `modify_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  1530. PRIMARY KEY (`id`)
  1531. ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
  1532. --20151216 赖应和 DB:shebao
  1533. ---用户查询社保、公积金的依赖数据。
  1534. CREATE TABLE `t_sb_city_site` (
  1535. `cid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1536. `city_name` varchar(32) NOT NULL COMMENT '城市名称',
  1537. `shebao_site` varchar(256) DEFAULT NULL COMMENT '社保网站',
  1538. `shebao_wx` varchar(256) DEFAULT NULL,
  1539. `fund_site` varchar(256) DEFAULT NULL COMMENT '公积金网站',
  1540. `fund_wx` varchar(256) DEFAULT NULL COMMENT '微信公众号',
  1541. `notice` varchar(256) DEFAULT NULL COMMENT '提示',
  1542. `hot` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否热闹城市',
  1543. PRIMARY KEY (`cid`)
  1544. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='城市社保、公积金供查询信息';
  1545. --------------------------- 以下是 V1.1.2 已同步线上@20151215
  1546. --20151109 赖应和 DB:shebao_admin
  1547. ---日志记录。
  1548. CREATE TABLE `t_log_sys` (
  1549. `task_id` varchar(16) NOT NULL COMMENT '日志标识',
  1550. `task_type` varchar(16) DEFAULT NULL,
  1551. `content` mediumtext COMMENT '内容',
  1552. `exec_result` varchar(16) DEFAULT NULL COMMENT '任务结果',
  1553. `u_id` int(10) unsigned DEFAULT NULL,
  1554. `exec_time` datetime DEFAULT NULL COMMENT '执行时间',
  1555. PRIMARY KEY (`task_id`)
  1556. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='运行日志';
  1557. --20151109 赖应和 DB:shebao
  1558. ---增加用于支付的订单号字段,为支持同一buy_no,不同金额。唯一约束。
  1559. ALTER TABLE `t_sb_buy`
  1560. ADD COLUMN `trade_no` varchar(64) NULL COMMENT '用于支付的单号' AFTER `buy_no`,
  1561. ADD UNIQUE INDEX `buy_trade_no` (`trade_no`) ;
  1562. --20151109 赖应和 DB:shebao
  1563. ---补缴表格
  1564. CREATE TABLE `t_sb_buy_order_added` (
  1565. `added_no` varchar(32) NOT NULL COMMENT '补缴订单号(BJ开头)',
  1566. `title` varchar(64) NOT NULL COMMENT '标题',
  1567. `pay_uid` int(10) unsigned NOT NULL,
  1568. `id_card` varchar(20) NOT NULL,
  1569. `city_code` int(10) unsigned NOT NULL,
  1570. `reason` varchar(32) NOT NULL COMMENT '原因',
  1571. `amount` decimal(8,2) unsigned NOT NULL COMMENT '金额',
  1572. `orders` varchar(300) NOT NULL COMMENT '订单号用英文逗号间隔',
  1573. `months` varchar(128) NOT NULL COMMENT '月份用英文逗号间隔',
  1574. PRIMARY KEY (`added_no`),
  1575. KEY `t_order_added_uid_idx` (`pay_uid`)
  1576. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1577. ALTER TABLE `t_sb_buy_order_added`
  1578. ADD COLUMN `pay_no` varchar(128) NULL DEFAULT '' COMMENT '支付流水号' AFTER `months`,
  1579. ADD COLUMN `status` tinyint(1) UNSIGNED NULL DEFAULT 1 COMMENT '状态1待支付 2已支付' AFTER `pay_no`;
  1580. ALTER TABLE `t_sb_buy_order_added`
  1581. ADD COLUMN `gen_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP AFTER `status`;
  1582. --------------------------- 以下是 V1.1.1 已同步线上@20151120
  1583. --20151109 赖应和 DB:shebao
  1584. ---记录社保的增、减员截止日期
  1585. ALTER TABLE `t_sb_city`
  1586. ADD COLUMN `fund_opt` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '公积金操作规则' AFTER `dec_date`;
  1587. ALTER TABLE `t_sb_city`
  1588. CHANGE COLUMN `end_date` `dec_date` tinyint UNSIGNED NULL DEFAULT 15 COMMENT '减员截止日期' AFTER `package_charge`,
  1589. ADD COLUMN `inc_date` tinyint UNSIGNED NULL DEFAULT 0 COMMENT '增员截止日期' AFTER `package_charge`;
  1590. --20151107 赖应和 DB:shebao
  1591. ---创建表记录参保人购买过的城市的社保年或月份
  1592. CREATE TABLE `t_sb_buyed` (
  1593. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1594. `sbu_id` int(10) unsigned NOT NULL COMMENT '参保人标识',
  1595. `city_code` mediumint(8) unsigned NOT NULL COMMENT '城市代码',
  1596. `mshebao` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '购买年或月份',
  1597. `update_time` datetime NOT NULL,
  1598. PRIMARY KEY (`id`),
  1599. KEY `t_sb_u_buyed_uid` (`sbu_id`)
  1600. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1601. --20151030 侯庆营 DB:shebao-admin
  1602. -- 添加退款理由字段:
  1603. ALTER TABLE `shebao_admin`.`t_sb_buy_order_ext`
  1604. ADD COLUMN `refund_reason` VARCHAR(200) NULL COMMENT '退款理由' AFTER `refund_amount`;
  1605. --20151026 赖应和 DB:shebao
  1606. --- 增加配置字段
  1607. ALTER TABLE `t_sb_city_data`
  1608. MODIFY COLUMN `supplement` varchar(64) NULL DEFAULT NULL COMMENT '补充医疗' AFTER `village`,
  1609. ADD COLUMN `large_major` varchar(64) NULL COMMENT '大病(额)医疗' AFTER `major`,
  1610. ADD COLUMN `education` varchar(64) NULL COMMENT '教育统筹经费' AFTER `village`,
  1611. ADD COLUMN `warm` varchar(64) NULL COMMENT '采暖费' AFTER `education`,
  1612. ADD COLUMN `archives` varchar(64) NULL COMMENT '档案费' AFTER `warm`,
  1613. ADD COLUMN `big_major` varchar(64) NULL COMMENT '大病(额)医疗' AFTER `supplement`;
  1614. ALTER TABLE `t_sb_city_data`
  1615. ADD COLUMN `hospital` varchar(64) NULL DEFAULT '' COMMENT '住院医疗' AFTER `injury`,
  1616. ADD COLUMN `added` varchar(64) NULL DEFAULT '' COMMENT '补充医疗' AFTER `archives`;
  1617. --- 增加索引
  1618. ALTER TABLE `t_sb_city_data` ADD INDEX `t_cityd_cid_idx` (`cid`) ;
  1619. ------------------ 以下脚本已线上处理!
  1620. --20151020 侯庆营 DB:shebao-admin
  1621. -- 添加退款字段:
  1622. ALTER TABLE `shebao_admin`.`t_sb_buy_order_ext`
  1623. ADD COLUMN `refund_type` TINYINT(3) NULL COMMENT '退款类型' AFTER `note`,
  1624. ADD COLUMN `refund_amount` DECIMAL(8,2) NULL COMMENT '退款金额' AFTER `refund_type`;
  1625. --20151020 侯庆营 DB:shebao-admin
  1626. -- 添加补缴字段:
  1627. ALTER TABLE `shebao_admin`.`t_sb_buy_order_ext`
  1628. ADD COLUMN `repay_type` TINYINT(3) NULL COMMENT '补缴类型' AFTER `refund_amount`,
  1629. ADD COLUMN `repay_amount` DECIMAL(8,2) NULL COMMENT '补缴金额' AFTER `repay_type`,
  1630. ADD COLUMN `repay_reason` VARCHAR(200) NULL COMMENT '补缴理由' AFTER `repay_amount`;
  1631. --20151020 侯庆营 DB:shebao
  1632. -- 添加手机端补缴退款提示字段:
  1633. ALTER TABLE `shebao`.`t_sb_buy_order`
  1634. ADD COLUMN `app_remark` VARCHAR(20) NULL COMMENT '手机端补缴退款提示' AFTER `gen_time`;
  1635. --20151022 赖应和 DB:shebao
  1636. CREATE TABLE `t_city` (
  1637. `city_code` int(10) unsigned NOT NULL,
  1638. `parent_code` int(10) unsigned NOT NULL DEFAULT '0',
  1639. `city_name` varchar(64) NOT NULL,
  1640. `is_city` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否城市',
  1641. `disabled` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0有效、1无效',
  1642. `is_hot` tinyint(1) unsigned NOT NULL DEFAULT '0',
  1643. PRIMARY KEY (`city_code`)
  1644. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1645. --^^^^^^^^^^^^^^^^^^^^^^^^^^^ done at 2015-10-15
  1646. --20151013 赖应和 DB:shebao
  1647. -- 添加登录ip字段
  1648. ALTER TABLE `t_user_flag`
  1649. ADD COLUMN `login_ip` varchar(16) NULL COMMENT '登录ip' AFTER `login_time`;
  1650. --20151012 侯庆营 DB:shebao-admin
  1651. -- 添加字段核对结果
  1652. ALTER TABLE `t_sb_employee`
  1653. ADD COLUMN `recon_result` TINYINT(4) DEFAULT 0 NULL COMMENT '核对结果';
  1654. ----------------------------------------------------------- TEST -----------------------------------
  1655. -- 增当月减当月(当月可买当月)
  1656. ------ 增员:1月买1月份,1月(依据1月份订单、上一月份是否购买)生成增员在1月
  1657. ------ 代理员工:1月份有增员在,1月(依据1月份订单)生成代理员工不产生数据记录; 2月接着买2月份,2月(依据2月份订单)生成代理员工在2月
  1658. ------ 减员:3月份没买,3月(依据2月份增~代理员工名单、3月份没买)生成减员在3月
  1659. -- 增下月减下月 (当月只能买下月或下下月)
  1660. ------ 增员:在1月买2月份,1月(依据2月份订单、上一月份是否购买)生成增员在1月
  1661. ------ 代理员工:1月份有增员在,1月(依据2月份订单)生成代理员工不产生数据记录; 在1或2月段内买了3月份,2月(依据3月份订单)生成代理员工在2月。
  1662. ------ 减员:4月份没买,3月(依据2月份增~代理员工名单、4月份没买)生成减员在3月
  1663. -- 增当月减下月(当月可买当月、一次需要买2个月或以上)
  1664. ------ 增员:1月买了1、2月份,1月(依据1月份订单、上一月份是否购买)生成增员在1月
  1665. ------ 代理员工:1月份有增员在,1月(依据1月份订单)生成代理员工不产生数据记录; 2月(依据2月份订单)生成代理员工于2月
  1666. ------ 减员:3月份没买,2月(依据1月份增~代理员工名单、3月份没买)生成减员在2月 (生成前需要检查是否已存在减员)
  1667. --------------------------------- 440682198503083561
  1668. --- 广州(1001) 社保 6月 440682198503083561
  1669. insert into t_sb_buy set buy_no='B0110010000000134201606', pay_for=1, start_month=201606, month_num=2,
  1670. pay_uid=1000004,pay_channel=1,id_card='440682198503083561', cid=1, hukou=1,
  1671. total_fee=0.01,shebaos=0,shebao_charge=59,funds=0,fund_charge=0,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-01 12:15:12';
  1672. --- 广州(1001) 公积金 8 440682198503083561
  1673. insert into t_sb_buy set buy_no='B0210010000000134201608', pay_for=2, start_month=201608,month_num=1,
  1674. pay_uid=1000004,pay_channel=1,id_card='440682198503083561', cid=1,hukou=1,
  1675. total_fee=0.01,shebaos=0,shebao_charge=0,funds=500,fund_charge=59,pay_no='',status=1,gen_date=20160601,gen_time='2016-08-01 12:15:12';
  1676. --- 阳江(1010) 社保 6月 440682198503083561
  1677. insert into t_sb_buy set buy_no='B0110100000000134201606', pay_for=1, start_month=201606, month_num=2,
  1678. pay_uid=1000004,pay_channel=1,id_card='440682198503083561', cid=13, hukou=1,
  1679. total_fee=0.01,shebaos=0,shebao_charge=59,funds=0,fund_charge=0,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-10 12:15:12';
  1680. --- 阳江(1010) 公积金 8 440682198503083561
  1681. insert into t_sb_buy set buy_no='B0210100000000134201608', pay_for=2, start_month=201608,month_num=1,
  1682. pay_uid=1000004,pay_channel=1,id_card='440682198503083561', cid=13,hukou=1,
  1683. total_fee=0.01,shebaos=0,shebao_charge=0,funds=600,fund_charge=59,pay_no='',status=1,gen_date=20160601,gen_time='2016-08-10 12:15:12';
  1684. --- 江门(1005) 社保 6月 440682198503083561
  1685. insert into t_sb_buy set buy_no='B0110050000000134201606', pay_for=1, start_month=201606, month_num=2,
  1686. pay_uid=1000004,pay_channel=1,id_card='440682198503083561', cid=9, hukou=1,
  1687. total_fee=0.01,shebaos=0,shebao_charge=59,funds=0,fund_charge=0,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-05 12:15:12';
  1688. --- 江门(1005) 公积金 8 440682198503083561
  1689. insert into t_sb_buy set buy_no='B0210050000000134201608', pay_for=2, start_month=201608,month_num=2,
  1690. pay_uid=1000004,pay_channel=1,id_card='440682198503083561', cid=9,hukou=1,
  1691. total_fee=0.01,shebaos=0,shebao_charge=0,funds=600,fund_charge=59,pay_no='',status=1,gen_date=20160601,gen_time='2016-08-05 12:15:12';
  1692. ------------------------------------------- 440682198503083561 end.
  1693. --------------------------------- 440682198503083522
  1694. --- 广州(1001) 社保+公积金 6月 440682198503083522
  1695. insert into t_sb_buy set buy_no='B0310010000000135201606', pay_for=3, start_month=201606, month_num=2,
  1696. pay_uid=1000004,pay_channel=1,id_card='440682198503083522', cid=1, hukou=1,
  1697. total_fee=0.01,shebaos=0,shebao_charge=59,funds=500,fund_charge=40,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-11 12:15:12';
  1698. --- 阳江(1010) 社保+公积金 6月 440682198503083522
  1699. insert into t_sb_buy set buy_no='B0310100000000135201606', pay_for=3, start_month=201606, month_num=2,
  1700. pay_uid=1000004,pay_channel=1,id_card='440682198503083522', cid=13, hukou=1,
  1701. total_fee=0.01,shebaos=0,shebao_charge=59,funds=600,fund_charge=40,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-11 12:15:12';
  1702. --- 江门(1005) 社保+公积金 6月 440682198503083522
  1703. insert into t_sb_buy set buy_no='B0310050000000135201606', pay_for=3, start_month=201606, month_num=2,
  1704. pay_uid=1000004,pay_channel=1,id_card='440682198503083522', cid=9, hukou=1,
  1705. total_fee=0.01,shebaos=0,shebao_charge=59,funds=700,fund_charge=40,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-11 12:15:12';
  1706. ------------------------------------------- 440682198503083522 end.
  1707. -----------------------------------------------------------------
  1708. --- 广州(1001) 社保+公积金 6月 440682198503083555
  1709. insert into t_sb_buy set buy_no='B0310010000000136201606', pay_for=3, start_month=201606, month_num=2,
  1710. pay_uid=1000004,pay_channel=1,id_card='440682198503083555', cid=1, hukou=1,
  1711. total_fee=0.01,shebaos=0,shebao_charge=59,funds=500,fund_charge=40,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-12 12:15:12';
  1712. --- 广州(1001) 公积金 8 440682198503083555
  1713. insert into t_sb_buy set buy_no='B0210010000000136201608', pay_for=2, start_month=201608,month_num=1,
  1714. pay_uid=1000004,pay_channel=1,id_card='440682198503083555', cid=1,hukou=1,
  1715. total_fee=0.01,shebaos=0,shebao_charge=0,funds=500,fund_charge=59,pay_no='',status=1,gen_date=20160601,gen_time='2016-08-12 12:15:12';
  1716. --- 阳江(1010) 社保+公积金 6月 440682198503083555
  1717. insert into t_sb_buy set buy_no='B0310100000000136201606', pay_for=3, start_month=201606, month_num=2,
  1718. pay_uid=1000004,pay_channel=1,id_card='440682198503083555', cid=13, hukou=1,
  1719. total_fee=0.01,shebaos=0,shebao_charge=59,funds=600,fund_charge=40,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-12 12:15:12';
  1720. --- 阳江(1010) 公积金 8 440682198503083555
  1721. insert into t_sb_buy set buy_no='B0210100000000136201608', pay_for=2, start_month=201608,month_num=1,
  1722. pay_uid=1000004,pay_channel=1,id_card='440682198503083555', cid=13,hukou=1,
  1723. total_fee=0.01,shebaos=0,shebao_charge=0,funds=600,fund_charge=59,pay_no='',status=1,gen_date=20160601,gen_time='2016-08-12 12:15:12';
  1724. --- 江门(1005) 社保+公积金 6月 440682198503083555
  1725. insert into t_sb_buy set buy_no='B0310050000000136201606', pay_for=3, start_month=201606, month_num=2,
  1726. pay_uid=1000004,pay_channel=1,id_card='440682198503083555', cid=9, hukou=1,
  1727. total_fee=0.01,shebaos=0,shebao_charge=59,funds=700,fund_charge=40,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-12 12:15:12';
  1728. --- 江门(1005) 公积金 8 440682198503083555
  1729. insert into t_sb_buy set buy_no='B0210050000000136201608', pay_for=2, start_month=201608,month_num=2,
  1730. pay_uid=1000004,pay_channel=1,id_card='440682198503083555', cid=9,hukou=1,
  1731. total_fee=0.01,shebaos=0,shebao_charge=0,funds=600,fund_charge=59,pay_no='',status=1,gen_date=20160601,gen_time='2016-08-12 12:15:12';
  1732. ---------------------------------------------------------------
  1733. --- 广州(1001) 社保+公积金 6月 440682198503083566
  1734. insert into t_sb_buy set buy_no='B0310010000000137201606', pay_for=3, start_month=201606, month_num=2,
  1735. pay_uid=1000004,pay_channel=1,id_card='440682198503083566', cid=1, hukou=1,
  1736. total_fee=0.01,shebaos=0,shebao_charge=40,funds=500,fund_charge=59,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-11 12:15:12';
  1737. --- 广州(1001) 社保 8月 440682198503083566
  1738. insert into t_sb_buy set buy_no='B0110010000000134201608', pay_for=1, start_month=201608, month_num=1,
  1739. pay_uid=1000004,pay_channel=1,id_card='440682198503083566', cid=1, hukou=1,
  1740. total_fee=0.01,shebaos=0,shebao_charge=59,funds=0,fund_charge=0,pay_no='',status=1,gen_date=20160601,gen_time='2016-08-06 12:15:12';
  1741. --- 阳江(1010) 社保+公积金 6月 440682198503083566
  1742. insert into t_sb_buy set buy_no='B0310100000000137201606', pay_for=3, start_month=201606, month_num=2,
  1743. pay_uid=1000004,pay_channel=1,id_card='440682198503083566', cid=13, hukou=1,
  1744. total_fee=0.01,shebaos=0,shebao_charge=40,funds=600,fund_charge=59,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-06 12:15:12';
  1745. --- 阳江(1010) 社保 8月 440682198503083566
  1746. insert into t_sb_buy set buy_no='B0110100000000137201608', pay_for=1, start_month=201608, month_num=1,
  1747. pay_uid=1000004,pay_channel=1,id_card='440682198503083566', cid=13, hukou=1,
  1748. total_fee=0.01,shebaos=0,shebao_charge=59,funds=0,fund_charge=0,pay_no='',status=1,gen_date=20160601,gen_time='2016-08-06 12:15:12';
  1749. --- 江门(1005) 社保+公积金 6月 440682198503083566
  1750. insert into t_sb_buy set buy_no='B0310050000000137201606', pay_for=3, start_month=201606, month_num=2,
  1751. pay_uid=1000004,pay_channel=1,id_card='440682198503083566', cid=9, hukou=1,
  1752. total_fee=0.01,shebaos=0,shebao_charge=40,funds=700,fund_charge=59,pay_no='',status=1,gen_date=20160601,gen_time='2016-06-06 12:15:12';
  1753. --- 江门(1005) 社保 8月 440682198503083566
  1754. insert into t_sb_buy set buy_no='B0110050000000137201608', pay_for=1, start_month=201608, month_num=2,
  1755. pay_uid=1000004,pay_channel=1,id_card='440682198503083566', cid=9, hukou=1,
  1756. total_fee=0.01,shebaos=0,shebao_charge=59,funds=0,fund_charge=0,pay_no='',status=1,gen_date=20160601,gen_time='2016-08-06 12:15:12';
  1757. --- 2021年3月18日 已同步线上
  1758. ALTER TABLE `shebao`.`t_sb_buy_order_added`
  1759. MODIFY COLUMN `reason` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '原因' AFTER `city_code`;
  1760. -------------------------------------------------------------------------------
  1761. --- 2021年3月25日 用户回访表
  1762. CREATE TABLE `shebao_admin`.`pay_a_return_visit` (
  1763. `id` int(10) NOT NULL AUTO_INCREMENT,
  1764. `id_card` varchar(20) NOT NULL COMMENT '身份证',
  1765. `phone` varchar(20) NOT NULL COMMENT '手机号',
  1766. `user_name` varchar(12) NOT NULL COMMENT '用户姓名',
  1767. `city_code` smallint(6) NOT NULL COMMENT '城市',
  1768. `pay_a_return_visit_time` timestamp(0) NULL COMMENT '回访时间',
  1769. `pay_a_return_visit_emp` varchar(20) NULL COMMENT '回访人',
  1770. `pay_a_return_visit_record` varchar(10) NULL COMMENT '回访记录',
  1771. `pay_a_return_visit_situation` varchar(55) NULL COMMENT '回访情况',
  1772. `gen_time` timestamp(0) NULL COMMENT '创建时间',
  1773. PRIMARY KEY (`id`)
  1774. ) COMMENT = '用户回访表';
  1775. --- 2021年3月30日 t_sb_user增加开户城市cid字段
  1776. ALTER TABLE `shebao`.`t_sb_user`
  1777. ADD COLUMN `bank_cid` int(10) NULL COMMENT '开户城市cid' AFTER `bank_code`;
  1778. ----------------------------------------------------------------------
  1779. ALTER TABLE `shebao_admin`.`t_report_month`
  1780. ADD COLUMN `shebao_repay_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '社保已补差额' AFTER `total_need_repay_amount`,
  1781. ADD COLUMN `fund_repay_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '公积金已补差额' AFTER `shebao_repay_amount`,
  1782. ADD COLUMN `shebao_need_repay_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '社保需补差额' AFTER `fund_repay_amount`,
  1783. ADD COLUMN `fund_need_repay_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '公积金需补差额' AFTER `shebao_need_repay_amount`;
  1784. ALTER TABLE `shebao_admin`.`t_report_month`
  1785. ADD COLUMN `shebao_partial_refund` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '社保部分退款' AFTER `shebao_need_repay_amount`,
  1786. MODIFY COLUMN `fund_repay_amount` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '公积金已补差额' AFTER `shebao_partial_refund`,
  1787. ADD COLUMN `fund_partial_refund` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '公积金部分退款' AFTER `fund_need_repay_amount`;
  1788. ALTER TABLE `shebao_admin`.`t_report_month`
  1789. ADD COLUMN `shebao_disabled_price` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '社保残保金总额' AFTER `total_need_repay_amount`;
  1790. CREATE TABLE `shebao`.`t_sb_info_hangzhou` (
  1791. `id` int(10) NOT NULL AUTO_INCREMENT,
  1792. `u_id` int(10) NOT NULL COMMENT '系统用户标识',
  1793. `id_card` varchar(20) NOT NULL COMMENT '身份证号',
  1794. `user_name` varchar(20) NOT NULL COMMENT '用户姓名',
  1795. `political_status` varchar(8) NULL COMMENT '政治面貌',
  1796. `education_level` varchar(16) NULL COMMENT '受教育程度',
  1797. `other_phone` varchar(16) NULL COMMENT '其他联系方式',
  1798. `marriage_status` varchar(8) NULL COMMENT '婚姻情况',
  1799. `hk_address` varchar(128) NULL COMMENT '户籍地址',
  1800. `address` varchar(128) NULL COMMENT '现居住地址',
  1801. `graduate_time` varchar(16) NULL COMMENT '毕业时间',
  1802. `graduate_school` varchar(32) NULL COMMENT '毕业学校',
  1803. `major` varchar(32) NULL COMMENT '专业',
  1804. `work_time` varchar(16) NULL COMMENT '第一次工作时间',
  1805. `profession` varchar(32) NULL COMMENT '职业',
  1806. PRIMARY KEY (`id`)
  1807. );
  1808. ALTER TABLE `shebao_admin`.`t_report_month`
  1809. ADD COLUMN `shebao_pre_charge` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '社保预收费总额' AFTER `shebao_disabled_price`;
  1810. ----------------------------------------------------------------------------------------------
  1811. ALTER TABLE `shebao_admin`.`t_report_month`
  1812. ADD COLUMN `shebao_charge_refund` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '社保服务费退费' AFTER `shebao_partial_refund`,
  1813. ADD COLUMN `shebao_card_charge` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '社保制卡费退费' AFTER `shebao_charge_refund`,
  1814. ADD COLUMN `fund_charge_refund` decimal(10, 2) NULL DEFAULT 0.00 COMMENT '公积金服务费退费' AFTER `fund_partial_refund`;
  1815. ----------------------------------------------------------------------------------------------
  1816. CREATE TABLE `shebao`.`t_sb_buy_order_wage_opt` (
  1817. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  1818. `order_no` varchar(32) NOT NULL DEFAULT '',
  1819. `opt_type` varchar(16) NOT NULL DEFAULT '' COMMENT '操作类型',
  1820. `amount` decimal(8,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '涉及金额',
  1821. `opt_user` varchar(32) NOT NULL DEFAULT '' COMMENT '操作人',
  1822. `gen_time` datetime NOT NULL COMMENT '生成时间',
  1823. `remark` varchar(255) NOT NULL DEFAULT '' COMMENT '说明',
  1824. PRIMARY KEY (`id`),
  1825. KEY `buy_order_opt_no_idx` (`order_no`)
  1826. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订单流水退款操作列表';
  1827. ALTER TABLE `shebao`.`t_sb_buy_order_wage_opt`
  1828. ADD COLUMN `opt_api` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '退款方式' AFTER `remark`,
  1829. ADD COLUMN `charge_k6` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '千分之六的手续费(分)' AFTER `opt_api`,
  1830. ADD COLUMN `opt_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 COMMENT '退款状态,同订单' AFTER `charge_k6`,
  1831. ADD COLUMN `opt_time` datetime(0) NULL DEFAULT NULL COMMENT '退款操作时间' AFTER `opt_status`,
  1832. ADD COLUMN `opt_remark` varchar(255) NOT NULL DEFAULT '' COMMENT '退款操作备注' AFTER `opt_time`,
  1833. ADD COLUMN `batchNo` varchar(20) NOT NULL DEFAULT '' COMMENT '批次号' AFTER `opt_remark`,
  1834. ADD COLUMN `refundNo` varchar(32) NOT NULL DEFAULT '' COMMENT '支付平台的本次退款标识' AFTER `batchNo`;
  1835. ---------------------------------------------------------------------------------------------------------
  1836. ALTER TABLE `shebao`.`t_sb_buy_order_wage_opt`
  1837. ADD COLUMN `trade_no` varchar(32) NOT NULL DEFAULT 0 COMMENT '支付单号' AFTER `order_no`;
  1838. ALTER TABLE `shebao`.`t_sb_buy_order_wage_opt`
  1839. ADD COLUMN `return_type` tinyint(4) NULL COMMENT '流水退款类型 11:全额退款 12:只退回流水金额' AFTER `opt_status`;
  1840. ----------------------------------------------------------------------------------------------------------
  1841. CREATE TABLE `shebao`.`return_visit_sms` (
  1842. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  1843. `send_status` tinyint(3) NULL DEFAULT 0 COMMENT '发送状态',
  1844. `send_uid` int(0) NULL COMMENT '短信目标用户id',
  1845. `phone` varchar(20) NULL COMMENT '手机号',
  1846. `t_msg_type_id` int(20) NULL COMMENT 't_msg_type_id',
  1847. `create_time` timestamp(0) NULL COMMENT '创建时间',
  1848. `update_time` timestamp(0) NULL COMMENT '更新时间',
  1849. PRIMARY KEY (`id`)
  1850. ) COMMENT = '增员回访短信状态表';
  1851. ----------------------------------------------------------------------------------------------------------
  1852. ALTER TABLE `shebao`.`t_sb_wage_flow_setting`
  1853. ADD COLUMN `flow_force` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否强制缴纳流水0否,1是' AFTER `flow_flag`;
  1854. ALTER TABLE `shebao`.`t_sb_buy`
  1855. ADD COLUMN `flow_force` tinyint(2) NOT NULL DEFAULT 0 COMMENT '是否强制缴纳流水0:否,1:是' AFTER `working`,
  1856. ADD COLUMN `flow_charge` decimal(8, 2) NOT NULL DEFAULT 0.00 COMMENT '社保流水服务费' AFTER `flow_force`;
  1857. ALTER TABLE `shebao`.`t_sb_buy_order_wage`
  1858. DROP INDEX `order_wage_tradeno_idx`,
  1859. ADD INDEX `order_wage_tradeno_idx`(`trade_no`) USING BTREE;
  1860. ----------------------------------------------------------------------------------------------------------
  1861. CREATE TABLE `shebao_oa`.`roster` (
  1862. `roster_id` bigint(20) NOT NULL AUTO_INCREMENT,
  1863. `serial_number` int(10) NULL COMMENT '序号',
  1864. `cooperatively` varchar(128) NULL COMMENT '合作地',
  1865. `employing_unit` varchar(128) NOT NULL COMMENT '用人单位',
  1866. `contract_subject` varchar(128) NULL COMMENT '合同主体',
  1867. `contract_no` varchar(64) NULL COMMENT '合同编号',
  1868. `insured_region` varchar(64) NULL COMMENT '参保地',
  1869. `insured_name` varchar(32) NOT NULL COMMENT '参保人姓名',
  1870. `insured_idcard` varchar(20) NOT NULL COMMENT '参保人身份证',
  1871. `insured_gender` tinyint(3) NULL COMMENT '性别',
  1872. `insured_age` int(10) NULL COMMENT '年龄',
  1873. `insured_ethnicity` varchar(20) NULL COMMENT '民族',
  1874. `insured_education` varchar(20) NULL COMMENT '学历',
  1875. `insured_phone` varchar(20) NULL COMMENT '联系电话',
  1876. `insured_hukou` varchar(128) NULL COMMENT '户籍地址',
  1877. `insured_hukou_type` tinyint(3) NULL COMMENT '户籍性质',
  1878. `insured_jobs` varchar(64) NULL COMMENT ' 工作岗位',
  1879. `insured_idcard_expiration_time` timestamp(0) NULL COMMENT '身份证过期时间',
  1880. `employee_type` tinyint(3) NULL COMMENT '员工类型',
  1881. `contract_start_time` timestamp(0) NULL COMMENT '合同开始时间',
  1882. `expiration_of_contract` timestamp(0) NULL COMMENT '合同过期时间',
  1883. `probation_period` varchar(10) NULL COMMENT '试用期',
  1884. `departure_time` timestamp(0) NULL COMMENT '离职时间',
  1885. `status` tinyint(3) NULL DEFAULT NULL COMMENT '状态0初始状态;1:在保,2不在保',
  1886. `labor_contract` tinyint(3) NULL DEFAULT NULL COMMENT '劳动合同1:有;2:无',
  1887. `entry_requirements` tinyint(3) NULL COMMENT '入职需知1:有;2:无',
  1888. `employee_info` tinyint(3) NULL COMMENT '员工信息表1:有;2无',
  1889. `copy_of_idcard` tinyint(3) NULL COMMENT '身份证复印件1:有2:无',
  1890. `certificate_of_dissolution` tinyint(3) NULL COMMENT '劳动关系解除证明书1:有,2无',
  1891. `bank_card_number` varchar(64) NULL COMMENT '银行卡号',
  1892. `bank` varchar(64) NULL COMMENT '开户行',
  1893. `kefu_user` varchar(32) NULL COMMENT '操作客服',
  1894. `create_time` timestamp(0) NULL COMMENT '创建时间',
  1895. `update_time` timestamp(0) NULL COMMENT '更新时间',
  1896. PRIMARY KEY (`roster_id`),
  1897. UNIQUE INDEX `unit_name_idcard_index`(`employing_unit`, `insured_name`, `insured_idcard`) COMMENT '用工单位,身份证号码,姓名组成的唯一索引'
  1898. ) COMMENT = '员工花名册';
  1899. ALTER TABLE `shebao_oa`.`roster`
  1900. ADD COLUMN `type` int(10) NULL COMMENT '合同类型 ContractTypeEnum' AFTER `roster_id`;
  1901. ALTER TABLE `shebao_oa`.`roster`
  1902. MODIFY COLUMN `kefu_user` int(10) NULL DEFAULT NULL COMMENT '操作客服' AFTER `bank`;
  1903. ALTER TABLE `shebao_oa`.`roster`
  1904. DROP INDEX `unit_name_idcard_index`,
  1905. ADD UNIQUE INDEX `unit_name_idcard_index`(`employing_unit`, `insured_name`, `insured_idcard`, `type`) USING BTREE COMMENT '用工单位,姓名,身份证号码,,合同类型组成的唯一索引';
  1906. ALTER TABLE `shebao_oa`.`roster`
  1907. DROP COLUMN `serial_number`;
  1908. ------------------------------------------------------------------------------------------------------------------------------------------------------
  1909. ALTER TABLE `shebao_oa`.`roster`
  1910. MODIFY COLUMN `insured_hukou_type` varchar(32) NULL DEFAULT NULL COMMENT '户籍性质' AFTER `insured_hukou`;
  1911. ------------------------------------------------------------------------------------------------------------------------------------------------------
  1912. CREATE TABLE `shebao_oa`.`talent_pool` (
  1913. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  1914. `company_name` varchar(128) NOT NULL COMMENT '需求企业名称',
  1915. `job` varchar(32) NULL COMMENT '岗位',
  1916. `job_type` varchar(32) NULL COMMENT '岗位类型',
  1917. `job_hunter` varchar(32) NOT NULL COMMENT '求职者',
  1918. `qualification` varchar(32) NOT NULL COMMENT '学历',
  1919. `phone` varchar(32) NOT NULL COMMENT '电话',
  1920. `gender` varchar(10) NULL COMMENT '性别',
  1921. `age` int(10) NULL COMMENT '年龄',
  1922. `intention_job` varchar(32) NULL COMMENT '意向岗位',
  1923. `job_search_area` varchar(32) NULL COMMENT '求职区域',
  1924. `status` varchar(32) NULL COMMENT '求职状态',
  1925. `kefu_user` int(10) NULL COMMENT '操作客服',
  1926. `create_time` timestamp(0) NULL COMMENT '创建时间',
  1927. `update_time` timestamp(0) NULL COMMENT '修改时间',
  1928. PRIMARY KEY (`id`)
  1929. );
  1930. ALTER TABLE `shebao_oa`.`talent_pool`
  1931. ADD UNIQUE INDEX `job_hunter_phone_index`(`job_hunter`, `phone`) USING BTREE COMMENT '求职者 电话 唯一索引';
  1932. -------------------------------------------------
  1933. ALTER TABLE `shebao_oa`.`roster`
  1934. ADD COLUMN `remark` varchar(255) NULL COMMENT '备注' AFTER `bank`;
  1935. -----------------------------------------------------------------------------------------------------------------------
  1936. CREATE TABLE `t_sb_buy_channel_notify` (
  1937. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  1938. `buy_no` varchar(32) NOT NULL COMMENT '买单号',
  1939. `notify_url` varchar(512) DEFAULT NULL COMMENT '渠道第三方回调地址',
  1940. `channel_out_trade_no` varchar(255) DEFAULT NULL COMMENT '渠道外部订单号',
  1941. `status` tinyint(3) DEFAULT NULL COMMENT '状态0未调用,1成功,2失败',
  1942. `create_time` timestamp NULL DEFAULT NULL,
  1943. PRIMARY KEY (`id`)
  1944. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  1945. ALTER TABLE `shebao`.`t_sb_buy_channel_notify`
  1946. ADD UNIQUE INDEX `buy_no_index`(`buy_no`) COMMENT 'buy_no唯一索引';
  1947. -----------------------------------------------------------------------------------------------------------------------
  1948. ALTER TABLE `shebao`.`t_sb_city`
  1949. ADD COLUMN `max_age` int(5) NOT NULL DEFAULT 48 COMMENT '可参保的最大年龄' AFTER `sb_alone`,
  1950. ADD COLUMN `min_age` int(5) NOT NULL DEFAULT 18 COMMENT '可参保的最小年龄' AFTER `max_age`;
  1951. ALTER TABLE `shebao`.`t_sb_city`
  1952. CHANGE COLUMN `max_age` `girl_max_age` int(5) NOT NULL DEFAULT 48 COMMENT '女性可参保的最大年龄' AFTER `sb_alone`,
  1953. CHANGE COLUMN `min_age` `girl_min_age` int(5) NOT NULL DEFAULT 18 COMMENT '女性可参保的最小年龄' AFTER `girl_max_age`,
  1954. ADD COLUMN `man_max_age` int(5) NOT NULL DEFAULT 58 COMMENT '男性可参保的最大年龄' AFTER `girl_min_age`,
  1955. ADD COLUMN `man_min_age` int(5) NOT NULL DEFAULT 18 COMMENT '男性可参保的最大年龄' AFTER `man_max_age`;