如何快速生成一个全能的表(视图)数据集

楼主
我是社区第162位番薯,欢迎点我头像关注我哦~
数据集
人力资源表_P

  1. SELECT * FROM `t_humanres`
  2. where 1=1
  3. ${if(len(hid)==0,nofilter," and Id = '" + hid + "'")}
  4. ${if(len(login)==0,nofilter," and login = '" + login + "'")}
  5. ${if(len(pwd)==0,nofilter," and pwd = '" + pwd + "'")}
  6. ${if(len(empname)==0,nofilter," and empname = '" + empname + "'")}
  7. ${if(len(area)==0,nofilter," and area = '" + area + "'")}
  8. ${if(len(department)==0,nofilter," and department = '" + department + "'")}
  9. ${if(len(employment)==0,nofilter," and employment = '" + employment + "'")}
  10. ${if(len(professional)==0,nofilter," and professional = '" + professional + "'")}
  11. ${if(len(job)==0,nofilter," and job = '" + job + "'")}
  12. ${if(len(realjob)==0,nofilter," and realjob = '" + realjob + "'")}
  13. ${if(len(Jobseq)==0,nofilter," and Jobseq = '" + Jobseq + "'")}
  14. ${if(len(coefficient)==0,nofilter," and coefficient = '" + coefficient + "'")}
  15. order by ${if(len(t_inter_cname) == 0,"1=1"," "+ t_inter_cname +" ")}${if(len(orderby)==0,""," "+ orderby +" " )}
复制代码

比如这么一个可对每个字段查询,又可支持排序功能的数据集,要怎么才能快速生成呢?
一个个替换又累又容易出错。

方法就是:xls
数据集生成.rar (3.52 KB, 下载次数: 104)
下载后解压,把表字段纵向粘贴在B\D\F列。(表字段纵向可以用excel的转置粘贴实现)
然后复制。粘贴到记事本中,替换tab符为空,即可生成中间红色的部分。
顶部和尾部的代码基本无变化的。

分享扩散:

沙发
发表于 2012-5-17 16:01:19
试过...不得的呢
板凳
发表于 2012-5-28 19:56:33
学习了:lol,感谢
地板
发表于 2012-6-11 15:10:51
顶强呀,好用耐心呀
5楼
发表于 2012-7-29 20:01:27
个人觉得你用存储过程会好点。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

4回帖数 1关注人数 7499浏览人数
最后回复于:2012-7-29 20:01

返回顶部 返回列表