Commit 12369c03 authored by leyboy's avatar leyboy

1.用户记录查询增加模糊查询

parent 0c32f520
This diff is collapsed.
......@@ -151,17 +151,17 @@
<result column="createTime" property="createTime"/>
<result column="telphone" property="telphone"/>
<result column="deviceNum" property="deviceNum"/>
<result column="userId" property="userId"/>
</resultMap>
<select id="listUserVOs" parameterType="object" resultMap="userVOMap">
SELECT u.`create_time` AS createTime,u.`temphone` AS telphone,COUNT(d.`id`) AS deviceNum FROM tb_user u
LEFT JOIN tb_device d ON u.`id` = d.`user_id` GROUP BY u.`id`
LEFT JOIN tb_device d ON u.`id` = d.`user_id`
<where>
<trim suffixOverrides="and">
<if test="userSearch.telphone != null and userSearch.telphone != ''">
u.`temphone` = #{userSearch.telphone} and
<bind name="telphoneLike" value="'%'+userSearch.telphone+'%'"/>
u.`temphone` LIKE #{telphoneLike} and
</if>
<if test="userSearch.createTime1!=null">
u.create_time >= #{userSearch.createTime1} and
......@@ -171,6 +171,7 @@
</if>
</trim>
</where>
GROUP BY u.`id`
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment