Brand New Day

本文分享了美剧《LieToMe》的片首曲RyanStar-BrandNewDay.mp3,作者认为这首歌曲非常动听,值得一听。

Ryan Star - Brand New Day.mp3, 美剧"Lie To Me" 的片首曲, 没什么说的, 就是觉得好听.

 

Br.

public class ParseXmlToObject { //xml文档转化成java的对象 //定义一个document属性 private Document document; //获取Document对象,解析读取phoneInfo.xml文件 //创建对象时,把xml数据封装到document属性中 public ParseXmlToObject() { //1. 创建DocumentBuilderFactory对象,解析器工厂对象 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); try { //2. 创建DocumentBuilder对象,解析器对象 DocumentBuilder documentBuilder = dbf.newDocumentBuilder(); //3. 通过解析器对象解析XML文档,创建Document对象 document = documentBuilder.parse("src/Day26/Demo02/phoneInfo.xml"); } catch (ParserConfigurationException | SAXException | IOException e) { throw new RuntimeException(e); } } public List<Phone> getAllPhones() { List<Phone> list = new ArrayList<>(); //根据标签名来获取所有的Brand节点,这里获取的两个Brand节点 NodeList brandList = document.getElementsByTagName("Brand"); //遍历brandlist集合,获取每一个Brand节点,封装成一个Phone对象,并添加到List集合中 for (int i = 0; i < brandList.getLength(); i++) { //遍历品牌集合,item(index) 获取集合中的节点。 Node brandNode = brandList.item(i); //拿品牌的子节点 NodeList childNodes = brandNode.getChildNodes(); //型号,判断是否是元素节点 for (int j = 0; j < childNodes.getLength(); j++) { Node childNode = childNodes.item(j); //Node.ELEMENT_NODE才是拿到的是type的元素节点 int type = childNode.getNodeType(); if (childNode.getNodeType() == Node.ELEMENT_NODE) { //向下转型获取元素内容 String typeName = ((Element) childNode).getAttribute("name"); String brandName = ((Element) brandNode).getAttribute("name"); //封装对象--装到List集合中 Phone phone = new Phone(brandName, typeName); list.add(phone); } } } return list; } //将document对象里面的数据转换成xml文件 public void parseObjectToXml(String path) { //1.创建转换器工厂 TransformerFactory factory = TransformerFactory.newInstance(); //设置缩进 factory.setAttribute("indent-number", 4); //2.转换器工厂创建转换器 Transformer transformer = null; try { transformer = factory.newTransformer(); transformer.setOutputProperty(OutputKeys.INDENT, "yes"); transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); } catch (TransformerConfigurationException e) { throw new RuntimeException(e); } //3.创建源:根据document对象获取源DomSource DOMSource domSource = new DOMSource(document); //4.创建目标:目标流包含写出去的目标文件 try { //StreamResult是流式xml、纯文本、HTML转换结果的持有者。 StreamResult streamResult = new StreamResult(new OutputStreamWriter(new FileOutputStream(path), "utf-8")); //5.转换器调用转换方法,将domsource转换成目标流,将目标流写入到目标文件 transformer.transform(domSource, streamResult); } catch (FileNotFoundException | UnsupportedEncodingException | TransformerException e) { throw new RuntimeException(e); } } //添加数据到document里 public void addPhone(String brand, String type) { //创建一个brand元素 Element brandElement = document.createElement("Brand"); brandElement.setAttribute("name", brand); //创建一个type元素 Element typeElement = document.createElement("Type"); typeElement.setAttribute("name", type); //添加type元素到brand元素中 brandElement.appendChild(typeElement); //添加brand元素到document document.getElementsByTagName("PhoneInfo").item(0).appendChild(brandElement); } //删除节点 public void deleteNode(String brandName) { //根据标签名来获取所有的Brand节点,这里获取的两个Brand节点 NodeList brandList = document.getElementsByTagName("Brand"); //遍历brandlist集合,获取每一个Brand节点,封装成一个Phone对象,并添加到List集合中 for (int i = 0; i < brandList.getLength(); i++) { //遍历品牌集合,item(index) 获取集合中的节点。 Node brandNode = brandList.item(i); Element brandElement = (Element) brandNode; //找到我要删除的节点,删除该节点需要找到父节点,调用父节点的removeChild方法进行删除 if (brandElement.getAttribute("name").equals(brandName)) { brandElement.getParentNode().removeChild(brandNode); } } } //修改节点 public void modifyBrandName(String oldName, String newName) { //根据标签名来获取所有的Brand节点,这里获取的两个Brand节点 NodeList brandList = document.getElementsByTagName("Brand"); //遍历brandlist集合,获取每一个Brand节点,封装成一个Phone对象,并添加到List集合中 for (int i = 0; i < brandList.getLength(); i++) { //遍历品牌集合,item(index) 获取集合中的节点。 Node brandNode = brandList.item(i); Element brandElement = (Element) brandNode; //判断是否是要修改的节点 if (brandElement.getAttribute("name").equals(oldName)) { brandElement.setAttribute("name", newName); } } } public static void main(String[] args) { ParseXmlToObject pxo = new ParseXmlToObject(); List<Phone> phoneList = pxo.getAllPhones(); for (Phone phone : phoneList) { System.out.println(phone); } pxo.addPhone("三星", "Note11"); //pxo.deleteNode("华为"); pxo.modifyBrandName("华为", "小米"); pxo.parseObjectToXml("src/Day26/Demo02/phoneInfo2.xml"); // List<Phone> allPhones = pxo.getAllPhones(); // for (Phone phone : allPhones) { // System.out.println(phone); // } } } 代码解析,帮我分析一下每一步的代码步骤都再干嘛,帮我加上注释,我刚学xml解析还不太理解
05-19
StatementCallback; bad SQL grammar [-- 用户工号 W8012827/报表id 180677/取数id null/数据集id 8281/数据源id 953 SELECT `voc_label2` , (count(IF(T.`new_cust_model`='realme 14 Pro+ 5G', T.`voc_label1`, null))/tb_nLMYphd78Oz2KQUp_1.`agg_custom_1`) AS 'nLMYphd78Oz2KQUp',(count(IF(T.`new_cust_model`='realme 15 Pro 5G', T.`voc_label1`, null))/tb_lKe8yW4gBQufDWcW_1.`agg_custom_1`) AS 'lKe8yW4gBQufDWcW' FROM (select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T left join (select T.`voc_label2` as "voc_label2_0_fix" ,(tb_lKe8yW4gBQufDWcW_1.`agg_custom_1`) as 'agg_custom_1' from (select T.`voc_label2` from (select * from(select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T WHERE (`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30) T group by T.`voc_label2` ) T cross join (select COUNT(IF(T.`new_cust_model`='realme 15 Pro 5G', T.`voc_label1`, null)) as "agg_custom_1" from (select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T WHERE (`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30 ) tb_lKe8yW4gBQufDWcW_1 group by T.`voc_label2` ) tb_lKe8yW4gBQufDWcW_1 on T.`voc_label2`=tb_lKe8yW4gBQufDWcW_1.`voc_label2_0_fix` left join (select T.`voc_label2` as "voc_label2_0_fix" ,(tb_nLMYphd78Oz2KQUp_1.`agg_custom_1`) as 'agg_custom_1' from (select T.`voc_label2` from (select * from(select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T WHERE (`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30) T group by T.`voc_label2` ) T cross join (select COUNT(IF(T.`new_cust_model`='realme 14 Pro+ 5G', T.`voc_label1`, null)) as "agg_custom_1" from (select vocid, singleid, case when syscode=12 and sysname='CC' then 'GCSM' when code=17 and sysname='WCSM' then 'GCSM_IDN' else sysname end as data_source, feedback_channel, feedback_channel1, feedback_channel2, feedback_channel3, dayno, concat(YEAR(dayno),'-',WEEK(dayno)+1) as t_week, date_format(dayno,'%Y-%m') as t_month, calltime, area, theater_name, voc_province, voc_city, new_cust_model, original_model, voc_series, category_type, voc_brand, on_time, date(on_time) as ontime, on_time_day, voc_brands, category_types, voc_seriess, new_cust_models, original_models, title, user_content, translate_title, translate_text, voc_label_path, voc_label1, voc_label2, voc_label3, voc_label4, voc_label5, feedback, situations, source_label_path, voc_label_emotion_attribute, view_point, voc_label_emotion, new_sessionid, new_handle_result, new_solve, new_satisfaction, type, new_solution, serve_mode, order_stage, repair_complete_time, serve_orderno, fag_name, full_path_name, shop_name, url, escore, case when datalevel='1' then '原文' when datalevel='2' then '评论' when datalevel='3' then '转发' when datalevel='4' then '回复' else datalevel end as datalevel, comments, likes, shares, views, push_time, factor_other from voc.ads_voc_original_label_detail_all d where exists( select 1 from voc.t_voc_self_analysis_perms_new p where p.tenant_id='realme_voc' and p.valid=1 and array_contains(p.user_id,'W8012827') and p.business_type=d.business_type and p.theater=d.area and p.code=d.code ) and feedback_channel3 is not null and code in (3001,3002,3003,3004,3005,3006,3007,3008,3009,3010,3011,3012,3013,3014,3015,3016,3017,3018,3019,3020,3021,3022,3023,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48) and isshow = 1) T WHERE (`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30 ) tb_nLMYphd78Oz2KQUp_1 group by T.`voc_label2` ) tb_nLMYphd78Oz2KQUp_1 on T.`voc_label2`=tb_nLMYphd78Oz2KQUp_1.`voc_label2_0_fix` WHERE (`feedback_channel1` in ('退维修')) AND (`theater_name` in ('印度')) AND `on_time_day` >= 0 AND `on_time_day` <= 30 GROUP BY `voc_label2` ORDER BY `voc_label2` asc LIMIT 0,3000]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: '`tb_lKe8yW4gBQufDWcW_1`.`agg_custom_1`' must be an aggregate expression or appear in GROUP BY clause 这个报错的原因是什么?
最新发布
09-18
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值