Commit ef15bb16 by zhengxj

finish 修正技工管理列表查询sql on 20191113 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@24802 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 618ae036
...@@ -1015,8 +1015,17 @@ ...@@ -1015,8 +1015,17 @@
and u.id = #{id,jdbcType=INTEGER} and u.id = #{id,jdbcType=INTEGER}
</if> </if>
<if test="keyWord != null and keyWord!=''"> <if test="keyWord != null and keyWord!=''">
and( u.name like "%"#{keyWord}"%" or su.name like "%"#{keyWord}"%" or u.phone_number like "%"#{keyWord}"%" ) <choose>
</if> <when test="mechanicId != null ">
and( u.name like "%"#{keyWord}"%" or su.name like "%"#{keyWord}"%"
or u.phone_number like "%"#{keyWord}"%" OR u.id like #{mechanicId} )
</when>
<otherwise>
and( u.name like "%"#{keyWord}"%" or su.name like "%"#{keyWord}"%"
or u.phone_number like "%"#{keyWord}"%" )
</otherwise>
</choose>
</if>
<if test="mechanicId != null "> <if test="mechanicId != null ">
OR u.id like #{mechanicId} OR u.id like #{mechanicId}
...@@ -1107,18 +1116,21 @@ ...@@ -1107,18 +1116,21 @@
WHERE u.user_type = 3 WHERE u.user_type = 3
</otherwise> </otherwise>
</choose> </choose>
<if test="id != null"> <if test="id != null">
and u.id = #{id,jdbcType=INTEGER} and u.id = #{id,jdbcType=INTEGER}
</if> </if>
<if test="keyWord != null and keyWord!=''"> <if test="keyWord != null and keyWord!=''">
and( u.name like "%"#{keyWord}"%" or su.name like "%"#{keyWord}"%" or u.phone_number like "%"#{keyWord}"%" ) <choose>
</if> <when test="mechanicId != null ">
and( u.name like "%"#{keyWord}"%" or su.name like "%"#{keyWord}"%"
<if test="mechanicId != null "> or u.phone_number like "%"#{keyWord}"%" OR u.id like #{mechanicId} )
OR u.id like #{mechanicId} </when>
</if> <otherwise>
and( u.name like "%"#{keyWord}"%" or su.name like "%"#{keyWord}"%"
or u.phone_number like "%"#{keyWord}"%" )
</otherwise>
</choose>
</if>
<if test="serviceType != null and serviceType!=''"> <if test="serviceType != null and serviceType!=''">
and sm.service_type = #{serviceType,jdbcType=VARCHAR} and sm.service_type = #{serviceType,jdbcType=VARCHAR}
</if> </if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!