Commit c1dfdbe0 authored by EDY's avatar EDY

优化

parent c5069f38
......@@ -33,57 +33,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql>
<select id="selectBaseCustomInfoList" parameterType="BaseCustomInfo" resultMap="BaseCustomInfoResult">
<include refid="selectBaseCustomInfoVo"/>
SELECT
a.*
FROM
base_custom_info a
LEFT JOIN
base_custom_follow_record b ON a.id = b.custom_id
<where>
<if test="khxm != null and khxm != ''"> and khxm = #{khxm}</if>
<if test="khgs != null and khgs != ''"> and khgs = #{khgs}</if>
<if test="khly != null "> and khly = #{khly}</if>
<if test="cplb != null "> and cplb = #{cplb}</if>
<if test="sjh != null and sjh != ''"> and sjh like concat('%', #{sjh}, '%')</if>
<if test="wx != null and wx != ''"> and wx = #{wx}</if>
<if test="khdz != null and khdz != ''"> and khdz = #{khdz}</if>
<if test="khxq != null and khxq != ''"> and khxq like concat('%', #{khxq}, '%')</if>
<if test="khxm != null and khxm != ''"> and a.khxm = #{khxm}</if>
<if test="khgs != null and khgs != ''"> and a.khgs = #{khgs}</if>
<if test="khly != null "> and a.khly = #{khly}</if>
<if test="cplb != null "> and a.cplb = #{cplb}</if>
<if test="sjh != null and sjh != ''"> and a.sjh like concat('%', #{sjh}, '%')</if>
<if test="wx != null and wx != ''"> and a.wx = #{wx}</if>
<if test="khdz != null and khdz != ''"> and a.khdz = #{khdz}</if>
<if test="khxq != null and khxq != ''"> and a.khxq like concat('%', #{khxq}, '%')</if>
<if test="customTrade != null ">
and khhy in
and a.khhy in
<foreach collection="customTrade" item="hy" open="(" separator="," close=")">
#{hy}
</foreach>
</if>
<if test="customStatus != null ">
and khzt in
and a.khzt in
<foreach collection="customStatus" item="khzt" open="(" separator="," close=")">
#{khzt}
</foreach>
</if>
<if test="purposeLevel != null ">
and yxdj in
and a.yxdj in
<foreach collection="purposeLevel" item="yxdj" open="(" separator="," close=")">
#{yxdj}
</foreach>
</if>
<if test="productType != null ">
and cplb in
and a.cplb in
<foreach collection="productType" item="cplb" open="(" separator="," close=")">
#{cplb}
</foreach>
</if>
<if test="customSource != null ">
and khly in
and a.khly in
<foreach collection="customSource" item="khly" open="(" separator="," close=")">
#{khly}
</foreach>
</if>
<if test="yxdj != null "> and yxdj = #{yxdj}</if>
<if test="khzt != null "> and khzt = #{khzt}</if>
<if test="gs != null "> and gs = #{gs}</if>
<if test="fzr != null and fzr != ''"> and fzr = #{fzr}</if>
<if test="bz != null and bz != ''"> and bz = #{bz}</if>
<if test="deleteFlag != null "> and delete_flag = #{deleteFlag}</if>
<if test="startTime != null and endTime != null"> and create_time between #{startTime} and #{endTime}</if>
<if test="rubbishFlag != null and rubbishFlag == 1"> and khzt = 7</if>
<if test="rubbishFlag != null and rubbishFlag == 0"> and khzt not in (7)</if>
<if test="yxdj != null "> and a.yxdj = #{yxdj}</if>
<if test="khzt != null "> and a.khzt = #{khzt}</if>
<if test="gs != null "> and a.gs = #{gs}</if>
<if test="fzr != null and fzr != ''"> and a.fzr = #{fzr}</if>
<if test="bz != null and bz != ''"> and a.bz = #{bz}</if>
<if test="deleteFlag != null "> and a.delete_flag = #{deleteFlag}</if>
<if test="startTime != null and endTime != null"> and a.create_time between #{startTime} and #{endTime}</if>
<if test="rubbishFlag != null and rubbishFlag == 1"> and a.khzt = 7</if>
<if test="rubbishFlag != null and rubbishFlag == 0"> and a.khzt not in (7)</if>
</where>
order by id desc
ORDER BY
CASE WHEN b.id IS NOT NULL THEN 0 ELSE 1 END,
a.yxdj DESC,
a.id DESC
</select>
<select id="selectBaseCustomInfoById" parameterType="Long" resultMap="BaseCustomInfoResult">
......
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