oohave / rapid-framework

Automatically exported from code.google.com/p/rapid-framework
0 stars 0 forks source link

ibatis3 ${className}Mapper.xml 中 update sql 多了一个逗号问题及select by unique 的问题 #41

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

1.update中:源程序如下: <#if !column.pk>
            ${column.sqlName} = <@mapperEl
column.columnNameFirstLower+',jdbcType='+column.jdbcSqlTypeName/> <#if
column_has_next>,</#if>
            </#if>

若 主键在最后面的话,会多出一个逗号。

2.select by unique column 中:源程序如下:
 <select id="getBy${column.columnName}" resultMap="${className}Result"
parameterType="${column.javaType}">
        select <include refid="${classNameFirstLower}Columns"/>
        <![CDATA[
            from ${table.sqlName} where ${column.sqlName} =
#${column.columnNameLower}#
        ]]>
    </select>

是不是应将#${column.columnNameLower}# --》<@mapperEl 
column.columnNameLower/>

因为:例如:  from T_P_USER_LOGIN_SESSION where USERID = #userid#
而不是:from T_P_USER_LOGIN_SESSION where USERID =  #{userid}

Original issue reported on code.google.com by zgw06...@gmail.com on 26 Feb 2010 at 7:58

GoogleCodeExporter commented 8 years ago
感谢,已经修正上面的两个问题.

修改完的模板可以在这里查看:
http://rapid-framework.googlecode.com/svn/trunk/rapid-
framework/plugins/ibatis3/template/java_src/$%7Bbasepackage_dir%7D/model/mapper/
$%7Bcla
ssName%7DMapper.xml

Original comment by bad...@gmail.com on 26 Feb 2010 at 1:57

GoogleCodeExporter commented 8 years ago
修改完成

Original comment by bad...@gmail.com on 26 Feb 2010 at 2:04