peternameyakj
2024-07-14 85037c73f8b16f4258a2af354cd162247700ffde
src/main/resources/mapper/StockMapper.xml
@@ -280,6 +280,9 @@
      <if test="stockType != null and stockType != '' ">
        and stock_type = #{stockType}
      </if>
      <if test="stockGid != null and stockGid != '' ">
        and stock_gid = #{stockGid}
      </if>
    </where>
  </select>
@@ -329,27 +332,26 @@
    </if>
  </select>
  <select id="findStockTypeDz" resultMap="BaseResultMap" parameterType="map">
    select
    <include refid="Base_Column_List"/>
    FROM stock
  <select id="findStockTypeDz" resultType="com.nq.pojo.StockDz" parameterType="map">
    SELECT
    *
    FROM stock_dz
    where stock_type = #{stockType}
    WHERE start_time &lt; #{formatDate} AND end_time &gt; #{formatDate}
    <if test="keyWords != null and keyWords != '' ">
      and (stock_spell like concat('%',#{keyWords},'%')  or stock_name like concat('%',#{keyWords},'%')  )
      AND (stock_spell LIKE #{keyWords} OR stock_name LIKE #{keyWords})
    </if>
    and  stock_code in(select stock_code from stock_dz)
    <if test="orderBy != null and orderBy == 'desc'" >
      order by  increase_ratio desc
    <if test="orderBy != null">
      ORDER BY  increase_ratio
      <if test="orderBy == 'desc'">
        DESC
      </if>
      <if test="orderBy == 'asc'">
        ASC
      </if>
    </if>
    <if test="orderBy != null and orderBy == 'asc'" >
      order by  increase_ratio asc
    </if>
  </select>