| | |
| | | #foreach($column in $columns) |
| | | #if($column.columnName != $pk.columnName || $pk.extra != 'auto_increment') |
| | | <if test="$column.attrname != null and $column.attrname !=''"> |
| | | and `$column.columnName` = #{$column.attrname} |
| | | and $column.columnName = #{$column.attrname} |
| | | </if> |
| | | #end |
| | | #end |
| | |
| | | </sql> |
| | | |
| | | <!--定义根据-${className}当作查询条件返回对象--> |
| | | <select id="findByObject" parameterMap="parameterMap" resultType="${package}.${moduleName}.model.${className}"> |
| | | <select id="findByObject" resultType="${package}.${moduleName}.model.${className}"> |
| | | select <include refid="Column_List"/> |
| | | from ${tableName} |
| | | <include refid="where"></include> |
| | | <include refid="where"/> |
| | | order by id desc |
| | | </select> |
| | | |
| | | <!--定义根据-${className}当作查询条件返回对象集合--> |
| | | <select id="findList" resultType="${package}.${moduleName}.model.${className}"> |
| | | select <include refid="Column_List"/> |
| | | from ${tableName} |
| | | <include refid="where" /> |
| | | order by id desc |
| | | </select> |
| | | </mapper> |