Skip to content

Commit a2a9f3c

Browse files
committed
Support chinese pinyin search
1 parent bf99d09 commit a2a9f3c

File tree

6 files changed

+6
-1
lines changed

6 files changed

+6
-1
lines changed

tang-system/src/main/resources/mapper/system/SysDeptMapper.xml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
where d.del_flag = '0'
2828
<if test="deptName != null and deptName != ''">
2929
and d.dept_name like concat('%', #{deptName}, '%')
30+
or to_pinyin(d.dept_name) like concat('%', #{deptName}, '%')
3031
</if>
3132
<if test="status != null and status != ''">
3233
and d.status = #{status}

tang-system/src/main/resources/mapper/system/SysMenuMapper.xml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
where m.del_flag = '0'
3535
<if test="menuName != null and menuName != ''">
3636
and m.menu_name like concat('%', #{menuName}, '%')
37+
or to_pinyin(m.menu_name) like concat('%', #{menuName}, '%')
3738
</if>
3839
<if test="status != null and status != ''">
3940
and m.status = #{status}

tang-system/src/main/resources/mapper/system/SysRoleMapper.xml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
where r.del_flag = '0'
2929
<if test="roleName != null and roleName != ''">
3030
and r.role_name like concat('%', #{roleName}, '%')
31+
or to_pinyin(r.role_name) like concat('%', #{roleName}, '%')
3132
</if>
3233
<if test="status != null and status != ''">
3334
and r.status = #{status}

tang-system/src/main/resources/mapper/system/SysUserMapper.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
<include refid="SysUserVo" />
7777
where u.del_flag = '0'
7878
and user_id not in ( select friend_id from app_friend_apply where user_id = #{userId} )
79-
and ( u.username like concat('%', #{keyword}, '%') or u.nickname like concat('%', #{keyword}, '%') )
79+
and ( u.username like concat('%', #{keyword}, '%') or u.nickname like concat('%', #{keyword}, '%') or to_pinyin(u.nickname) like concat('%', #{keyword}, '%') )
8080
and user_id != #{userId}
8181
</select>
8282

tang-system/src/main/resources/mapper/system/dict/SysDictTypeMapper.xml

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
</if>
2828
<if test="typeName != null and typeName != ''">
2929
and dt.type_name like concat('%', #{typeName}, '%')
30+
and to_pinyin(dt.type_name) like concat('%', #{typeName}, '%')
3031
</if>
3132
<if test="status != null and status != ''">
3233
and dt.status = #{status}

tang-tool/tang-generator/src/main/resources/mapper/tool/GenTableMapper.xml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
</if>
3636
<if test="tableComment != null and tableComment != ''">
3737
and gt.table_comment like concat('%', #{tableComment}, '%')
38+
or to_pinyin(gt.table_comment) like concat('%', #{tableComment}, '%')
3839
</if>
3940
</where>
4041
order by gt.create_time desc

0 commit comments

Comments
 (0)