1
zj
2024-08-19 2bb6d396b9e9a8d58ba47504591b71e48d6d6bfb
src/main/resources/mapper/UserPositionMapper.xml
@@ -454,9 +454,9 @@
      <if test="stockSpell != null and stockSpell != '' ">
        and stock_spell like CONCAT('%','${stockSpell}','%')
      </if>
      <if test="stockType != null and stockType!= ''">
        and stock_gid = #{stockType}
      </if>
<!--      <if test="stockType != null and stockType!= ''">-->
<!--        and stock_gid = #{stockType}-->
<!--      </if>-->
    </where>
@@ -485,31 +485,40 @@
    <include refid="Base_Column_List"/>
    FROM user_position
    <where>
      <if test="searchId != null  ">
        and agent_id = #{searchId}
      1=1
      <if test="ids != null and ids.size > 0">
        AND agent_id IN
        <foreach item="id" collection="ids" open="(" separator="," close=")">
          #{id}
        </foreach>
      </if>
      <if test="state != null  ">
        <if test="state == 0">
          and sell_order_id is null
        </if>
        <if test="state == 1">
          and sell_order_id is not null
        </if>
      <if test="state != null">
        <choose>
          <when test="state == 0">
            AND sell_order_id IS NULL
          </when>
          <when test="state == 1">
            AND sell_order_id IS NOT NULL
          </when>
        </choose>
      </if>
      <if test="userId != null and userId != '' ">
        and user_id = #{userId}
      <if test="userId != null and userId != ''">
        AND user_id = #{userId}
      </if>
      <if test="positionSn != null and positionSn != '' ">
        and position_sn like CONCAT('%','${positionSn}','%')
      <if test="positionSn != null and positionSn != ''">
        AND position_sn LIKE CONCAT('%', #{positionSn}, '%')
      </if>
      <if test="positionType != null ">
        and position_type = #{positionType}
      <if test="positionType != null and positionType != ''">
        AND position_type = #{positionType}
      </if>
      <if test="beginTime != null ">
        and sell_order_time <![CDATA[>=]]> #{beginTime}
      <if test="beginTime != null and beginTime != ''">
        AND sell_order_time <![CDATA[>=]]> #{beginTime}
      </if>
      <if test="endTime != null ">
        and sell_order_time <![CDATA[<=]]> #{endTime}
      <if test="endTime != null and endTime != ''">
        AND sell_order_time <![CDATA[<=]]> #{endTime}
      </if>
      <if test="phone != null and phone != ''">
        AND user_id = (SELECT id FROM user WHERE phone = #{phone})
      </if>
    </where>
    ORDER BY id DESC
@@ -603,5 +612,7 @@
    limit 1
  </select>
</mapper>