数据库sql、mybatis、堆栈
1、数据库方面
SQLSERVER:
select r.id,'R_'+ltrim(r.id),'R_'+CAST(r.id as VARCHAR(10)) from Role r where rolename is not null and description is not null
exists和notexists
引用
http://www.cnblogs.com/mytechblog/articles/2105785.html
2、js方面
if(typeof(formId)=="undefined"){ alert("值是多少!"); return; }
3、Mybatis方面
<!-- customized #s --> <resultMap id="resultMapId2" type="java.util.HashMap" > <result column="id" property="id" jdbcType="INTEGER" /> <result column="roleId" property="roleId" jdbcType="INTEGER" /> <result column="rolename" property="rolename" jdbcType="VARCHAR" /> </resultMap> <!-- 查询所有的角色信息account --> <select id="selectRoleList" resultMap="resultMapId2"> select r.id,'R_'+ltrim(r.id) as roleId,r.roleName from Role r where rolename is not null and description is not null </select> <!-- customized #e -->
4、堆内存和非堆内存
http://blog.csdn.net/thunder0709/article/details/16855195
5、${}和#{}取值的区别
#{key}取值会自动将值看成是字符串类型,并带上单引号;
而${key}取值就是传的值是啥就是啥。
由此可见#{key}取值可以防止sql注入,而${key}取值可能会引起sql注入情况。
但${}取值有其特殊适用场景,比如变化的表名。
https://www.cnblogs.com/wy697495/p/9752087.html
相关推荐
yangkang 2020-11-09
lbyd0 2020-11-17
sushuanglei 2020-11-12
85477104 2020-11-17
KANSYOUKYOU 2020-11-16
wushengyong 2020-10-28
lizhengjava 2020-11-13
星月情缘 2020-11-13
huangxiaoyun00 2020-11-13
luyong0 2020-11-08
腾讯soso团队 2020-11-06
Apsaravod 2020-11-05
PeterChangyb 2020-11-05
gaobudong 2020-11-04
wwwjun 2020-11-02
gyunwh 2020-11-02
EchoYY 2020-10-31
dingyahui 2020-10-30