数据库 MySQL 开发环境 SSH 第一段原生态sql语句: select lookum_crop_ids, capture_time, gene_symbol, patch_id, max(case when gene_ids = 23 then gene_real else 0 end) as kw, max(case when gene_ids = 24 then gene_real else 0 end) as ks, max(case when gene_ids = 25 then gene_real else 0 end) as co2, max(case when gene_ids = 26 then gene_real else 0 end) as gz, max(case when gene_ids = 27 then gene_real else 0 end) as tw, max(case when gene_ids = 28 then gene_real else 0 end) as ts from lookum_monitor_hisinfo where 1=1 and lookum_crop_ids = 67 group by patch_id, lookum_crop_ids; 第二段是经过hibernate加工后的hql select lookummoni0_.lookum_crop_ids as col_0_0_, lookummoni0_.capture_time as col_1_0_, lookummoni0_.gene_symbol as col_2_0_, lookummoni0_.patch_id as col_3_0_, max(case when lookummoni0_.cropgene_ids=23 then lookummoni0_.gene_real else 0 end) as col_4_0_, max(case when lookummoni0_.cropgene_ids=24 then lookummoni0_.gene_real else 0 end) as col_5_0_, max(case when lookummoni0_.cropgene_ids=25 then lookummoni0_.gene_real else 0 end) as col_6_0_, max(case when lookummoni0_.cropgene_ids=26 then lookummoni0_.gene_real else 0 end) as col_7_0_, max(case when lookummoni0_.cropgene_ids=27 then lookummoni0_.gene_real else 0 end) as col_8_0_, max(case when lookummoni0_.cropgene_ids=28 then lookummoni0_.gene_real else 0 end) as col_9_0_ from lookum_monitor_hisinfo lookummoni0_ where 1=1 and lookummoni0_.lookum_crop_ids=67 group by lookummoni0_.patch_id , lookummoni0_.lookum_crop_ids
- 2 回答
- 0 关注
- 80 浏览
添加回答
举报
0/150
提交
取消