oracle的mapper小结

模糊查询:
like ‘%|| #{ name } ||%’

in范围结合循环:
and name in ('XXX','YYY')

and name in 

<foreach collection ="list"  item ="item" open="(" close=")" >

#{item}

</foreach>

 

不为空

字段 is not null

 

批量插入:batchInsert

bigDecimal金融常用。toString()就是string类型

拼接字符串:

StringBuffer str=new StringBuffer(string)

BigDecimal  total=new BigDecimal(str。append(“0000”)。toString)

重命名类名“name” echarts中,如果不要求就用sum_total下划线

 

 

rownum<1    和 sql中的 limit 0,1

 

 

 

求无向图邻接矩阵的度

int degreel(Graph & ga)
{//根据无向图的邻接矩阵求出序号为num的顶点的度数
int j=0int d[ga.vexnum];
for(numb=0;numb<ga.vexnum;numb++)
{
d[numb]=0
for(j=0;j<ga.vexnum;j++)
{
  if(ga.cost[numb][j]!=0&&ga.cost[numb][j]!=MAXINT)
{
   d[numb]++;
}

}
}
return d;
}

 

批量插入

<insert id ="batchInsert" parameterType="java.utilList">
  <selectKey keyProperty="allocateId" resultMap="java.lang.string"order="BEFORE">
select table .nextval as allocated from dual
</selectKey >
insert into table
(
字段
)
select table.nextval,t.* from (
<foreach collection ="list" item ="item" index ="index" separator ="union all">
select
#{}
>>>>>>
from dual
</foreach>


)t
</insert>

 

posted @ 2019-09-04 11:08  枫糖浆  阅读(1054)  评论(0编辑  收藏  举报