feat(mapper): 增加省份和城市筛选功能并优化模糊查询

- 在 AgentInfoMapper 和 PartnerInfoMapper 中添加省份和城市筛选条件
- 优化 AgentInfoMapper、CustomerInfoMapper 和 PartnerInfoMapper 中的模糊查询逻辑
master
chenhao 2025-05-23 11:33:01 +08:00
parent 0069df1c67
commit a0799df777
3 changed files with 7 additions and 3 deletions

View File

@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectCustomerInfoList" parameterType="CustomerInfo" resultMap="CustomerInfoResult">
<include refid="selectCustomerInfoVo"/>
<where>
<if test="customerCode != null and customerCode != ''">and customer_code = #{customerCode}</if>
<if test="customerCode != null and customerCode != ''">and customer_code like concat( '%',#{customerCode},'%')</if>
<if test="customerCodeList != null and customerCodeList.size>0">and customer_code in
<foreach collection="customerCodeList" item="item" separator="," open="(" close=")">
#{item}

View File

@ -28,13 +28,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectAgentInfoList" parameterType="AgentInfo" resultMap="AgentInfoResult">
<include refid="selectAgentInfoVo"/>
<where>
<if test="agentCode != null and agentCode != ''"> and agent_code = #{agentCode}</if>
<if test="agentCode != null and agentCode != ''"> and agent_code like concat('%', #{agentCode}, '%')</if>
<if test="agentCodeList != null and agentCodeList.size>0"> and agent_code in
<foreach collection="agentCodeList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="agentName != null and agentName != ''"> and agent_name like concat('%', #{agentName}, '%')</if>
<if test="province != null and province != ''">and province = #{province}</if>
<if test="city != null and city != ''">and city = #{city}</if>
</where>
</select>

View File

@ -27,9 +27,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectPartnerInfoList" parameterType="PartnerInfo" resultMap="PartnerInfoResult">
<include refid="selectPartnerInfoVo"/>
<where>
<if test="partnerCode != null and partnerCode != ''"> and partner_code = #{partnerCode}</if>
<if test="partnerCode != null and partnerCode != ''"> and partner_code like concat('%', #{partnerCode}, '%')</if>
<if test="partnerName != null and partnerName != ''"> and partner_name like concat('%', #{partnerName}, '%')</if>
<if test="level != null and level != ''"> and level = #{level}</if>
<if test="province != null and province != ''"> and province = #{province}</if>
<if test="city != null and city != ''"> and city = #{city}</if>
</where>
</select>