手机网站怎么做推广,有虚拟主机wordpress,wordpress二维码动态图片大小,手机优化电池充电要开吗项目的各种配置开始出现混乱的现象了 在只有一个人开发的情况下也开始感受到维护一个项目的难度。 之前明明还好用的东西#xff0c;转眼就各种莫名其妙的报错#xff0c;完全不知道为什么。 今天一天的工作基本上就是整理各种配置。 再加上之前数据库设计出现了问题#xf…项目的各种配置开始出现混乱的现象了 在只有一个人开发的情况下也开始感受到维护一个项目的难度。 之前明明还好用的东西转眼就各种莫名其妙的报错完全不知道为什么。 今天一天的工作基本上就是整理各种配置。 再加上之前数据库设计出现了问题要增加一个表改几个名字删几个字段……真是头大 ##1、gradle排除依赖 在打war包的时候出现了spring-boot与dubbo框架自带的spring2.5.6冲突的情况于是学会了这么一招 //仅在本地执行时使用不添加到warprovidedRuntime org.springframework:spring:2.5.6.SEC03//排除依赖compile(project(:client-core)) {exclude group:org.springframework, module:spring:2.5.6.SEC03}
复制代码配置写在gradle的dependencies中将这个包排除在外用新的spring4就好了。 不禁吐槽dubbo是有多古老的框架嘛为啥不支持新一代的spring啊 然而今天配置完后出现了找不到spring-servlet.xml配置文件的问题。明明放在一起的spring-core.xml都能找到的说。此问题留待明天解决。 ##2、spring使用配置文件 在本地环境、测试环境、生产环境的各种切换当真是非常操蛋的一件事情。 为此做的第一件工作是统一数据源redis、mysql等数据源都分别创建唯一的bean用spring注入。算是很基本的做法。 这两天发现就算是每次改spring的xml文件也是个挺操蛋的事情。于是小小的尝试了一下这个标签 context:property-placeholder location/config.properties/
复制代码应该算是新增的标签在网上搜索到的方法要活生生的写一个bean配置这个能省事不少。 这样直接用${prop.name}就可以添加配置咯~ ##3、mybatis联合查询~ 还记得上次说的mybatis联合查询功能么很快就用上了。 为了能利用这个功能我活生生的修改了数据库的结构。其实也是一开始设计的不标准。这次彻底符合2NF的设计就可以愉快的联合查询了。 作为这次修改的教训 不要把mn的关联写到数据表里面 不要把mn的关联写到数据表里面 不要把mn的关联写到数据表里面 多建一个关联表不会死人。 第一个联合查询的代码贴上来留作纪念~ resultMap typecom.xinou.lolttery.server.bean.Team idteamResultMap!-- 属性名和数据库列名映射 --id propertyid columnteam_id /result propertyshortname columnteam_shortname /result propertylogo columnteam_logo //resultMapresultMap typecom.xinou.lolttery.server.bean.MatchTeam idlinkResultMap!-- 属性名和数据库列名映射 --id propertyid columnlink_id /result propertyteamid columnlink_teamid /result propertyplace columnlink_place //resultMapresultMap idappMatchList typecom.xinou.lolttery.server.bean.result.AppMatchListid propertyid columnid /result propertyzone columnzone /result propertywinner columnwinner /result propertyzonename columnzonename /result propertyzonelogo columnzonelogo /result propertymatchdate columnmatchdate /result propertymatchmode columnmatchmode /result propertyresult columnresult /collection propertyteams ofTypecom.xinou.lolttery.server.bean.Team resultMapteamResultMap/collection propertylinks ofTypecom.xinou.lolttery.server.bean.MatchTeam resultMaplinkResultMap//resultMapselect idqueryByTime parameterTypelong resultTypecom.xinou.lolttery.server.bean.result.AppMatchList resultMapappMatchListselect m.*,mt.id link_id,mt.teamid link_teamid,mt.place link_place,t.id team_id,t.shortname team_shortname,t.logo team_logo, z.name zonename,z.logo zonelogo from((lt_match m left join lt_match_team mt on mt.matchid m.id ) left join lt_team t on t.idmt.teamid)left join lt_match_zone z on m.zone z.id where m.matchdate lt; #{0} limit 0,20/select
复制代码