Commit abdf9bc0 by zhengxj

finish 修正sql on 20191108 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@24715 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent b994a9b8
......@@ -1424,11 +1424,7 @@
resultType="com.glsx.usercenter.pojo.user.SysMechanic">
<if test="queryContent != null and queryContent != ''">
<bind name="queryContent" value="'%' + queryContent + '%'"/>
</if>
select
*
from
(
</if>
select
u.id as id, u.username, u.name, u.phone_number as phoneNumber,
m.district, m.address, m.work_status AS workStatus,
......@@ -1437,21 +1433,16 @@
LEFT JOIN sys_user u on sm.mechanic_id = u.id
LEFT JOIN sys_mechanic m on sm.mechanic_id = m.user_id
LEFT JOIN sys_user_services us on u.id = us.user_id
LEFT JOIN sys_dict_data sdd on us.service_key = sdd.data_key
<where>
and sm.service_id = #{userId}
and u.user_status = 'sys_user_status_normal'
<!-- and m.mechanic_status = 'sys_user_status_pass_check' -->
</where>
GROUP BY u.id
ORDER BY m.work_status ASC, u.create_time DESC, u.id DESC
) d
LEFT JOIN sys_dict_data sdd on us.service_key = sdd.data_key
<where>
<if test="queryContent != null and queryContent != ''">
and (d.name like #{queryContent} or d.phoneNumber like #{queryContent} or d.serviceItems like
#{queryContent})
u.user_status = 'sys_user_status_normal'
and sm.service_id = #{userId}
<if test="queryContent != null and queryContent != ''">
and u.name like #{queryContent}
</if>
</where>
</where>
GROUP BY u.id
ORDER BY m.work_status ASC, u.create_time DESC, u.id DESC
</select>
<select id="selectByMechanicId" resultMap="BaseResultMap">
SELECT su.* FROM sys_user su INNER JOIN sys_mechanic sm ON su.id=sm.user_id AND sm.id=#{id}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!