Skip to content

Commit

Permalink
Support chinese pinyin search of mybatis generate template
Browse files Browse the repository at this point in the history
  • Loading branch information
tangllty committed Jun 28, 2024
1 parent 8d9a258 commit 5ba1170
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ package ${packageName}.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Mapper;

import ${packageName}.entity.$ClassName;

Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
#if($column.queryType == "fuzzy")
<if test="$column.javaField != null#if($column.javaType == 'String') and $column.javaField != ''#end">
and ${tableAlias}.$column.columnName like concat('%', #{$column.javaField}, '%')
or to_pinyin(${tableAlias}.$column.columnName) like concat('%', #{$column.javaField}, '%')
</if>
#end
#if($column.queryType == "findInSet")

0 comments on commit 5ba1170

Please sign in to comment.