Sql Server
删除没备份的痛
厚德载物,得以自度
前后端的代码可以分离,但是!全栈技术绝不能分离!
展开
-
节点CODE相同会导致数据重复
数据原创 2022-06-28 20:35:56 · 95 阅读 · 0 评论 -
SQL追加字段
sql原创 2022-06-27 10:36:58 · 597 阅读 · 0 评论 -
console.log()
使用 console.log()打印参数原创 2022-05-31 16:02:22 · 220 阅读 · 1 评论 -
查看视图信息语句
SELECT object_name( id ) AS 表名 , c.name AS 字段名 , t.name 数据类型 , c.prec AS 长度 FROM syscolumns c INNER JOIN systypes t ON c.xusertype= t.xusertype WHERE objectproperty( id, 'IsView' ) = 1 AND id = object_id( '视图名' ) ...原创 2022-05-20 09:52:50 · 774 阅读 · 0 评论 -
sql自定义数据、字段名
select ‘数据’ 字段名 FROM Damage原创 2022-05-16 15:22:28 · 713 阅读 · 0 评论 -
List<Map>
useResourceLogService.queryUseResourceLogsByPid(id,"equipment") @Transactional(readOnly = true) public List<Map> queryUseResourceLogsByPid(String pid,String type){ if(StringFacs.isEmpty(pid)||StringFacs.isEmpty(type)){ retur原创 2022-05-10 08:57:28 · 159 阅读 · 0 评论 -
smallName完整版
SELECT a.sj completeTime, ad.id, CASE WHEN ad.dScopeId IS NULL THEN '否' WHEN ad.dScopeId = '' THEN '否' ELSE '是' END dScopeId, ad.khbh, ( SELECT area_name FROM T_area WHERE id = ad.sspq ) sspq, kd.smallName smallName, ( SELECT statusname FROM原创 2022-05-09 20:18:29 · 139 阅读 · 0 评论 -
将Entity更改为map
public List<Map> queryAllAreaByPCodePc() { String hql = "select pd.*,t.area_name,t.ProDepartment from ProDepartment pd " + "left join T_area t on t.ProDepartment=pd.name \n" + "where pd.operationStatue=0 and原创 2022-05-09 11:15:53 · 459 阅读 · 0 评论 -
更改hql
public List<ProDepartmentEntity> queryProDepartmentAppSspq(String sspq) { String hql = "select * from ProDepartment pd " + "left join T_area t on t.ProDepartment=pd.name \n" + "where pd.operationStatue=0 ...原创 2022-05-07 18:38:00 · 260 阅读 · 0 评论 -
通过xmb关联sspq
@RequestMapping(value = "getAreaByTypeName.html", method = RequestMethod.GET) @ResponseBody public Map<String, Object> getAreaByTypeName(HttpServletRequest request) { Map<String, Object> map = new HashMap<>(); St..原创 2022-05-07 18:10:42 · 422 阅读 · 0 评论 -
hql改sql
//查询附件信息 public List queryAttaches(String id){ StringBuffer sql = new StringBuffer("select * from ATTACH where id = '"+id+"' "); return jdbcTemplate.queryEntitys(sql.toString(),AttachEntity.class); } //根据pid查询附件信息 public .原创 2022-05-07 17:55:10 · 430 阅读 · 0 评论 -
重复数据 时间筛选
select * from assessData ad LEFT JOIN assessComplete ac ON ac.pid = ad.id AND ac.addTime = ( SELECT MAX ( addTime ) FROM assessComplete ac2 WHERE ac2.pid = ad.id ) left join khDamInfo kd on ac.id=kd.pid where kd.deviceName='莫力庙大街(创业大道-柳荫路)' ...原创 2022-05-07 10:17:01 · 296 阅读 · 0 评论 -
最大时间max
select d.yhdydm, d.id,concat(df1.type_name,'病害') damZy,dtype.damType, d.patrol_type_name damGrade,d.patrol_type_code,d.lsbh,ta.area_name sspq,d.dam_sources,d.add_time,d.user_name, d.node_name statusname,d.fac_name_new fac_name,d.device_type_name,d.fac_dire原创 2022-05-06 19:19:23 · 270 阅读 · 0 评论 -
批量更改damagecomplete维修单位
UPDATE DamageComplete SET DamageComplete.DAMUNITNAME = ( SELECT DAMUNIT.NAME FROM damage d LEFT JOIN DamDaily ON d.DAMCODE = DamDaily.CODE LEFT JOIN DAMUNIT ON DamDaily.UNIT = DAMUNIT.CODE WHERE d.id = DamageComplete.pid ) where DamageComplete.原创 2022-04-26 10:07:56 · 92 阅读 · 0 评论 -
resultMap和resultType
resultType很简单,数据库和实体类自动映射,=类名 resultMap比较复杂,数据库和实体类自定义映射,单独写出一段原创 2022-04-05 21:43:17 · 433 阅读 · 0 评论 -
Sql Server查看表中索引
exec sp_helpindex 表名原创 2022-03-25 10:31:03 · 2284 阅读 · 0 评论