admin
2019-09-20 db88b87df461820152d68d3d55a28f30c2da83e6
fanli/src/main/java/com/yeshi/fanli/mapping/brand/BrandInfoMapper.xml
@@ -82,14 +82,32 @@
   
  <select id="listBrandInfoVO" resultMap="ResultVOMap">
     SELECT * FROM yeshi_ec_brand_info d
   WHERE d.`bf_state` = 1 <if test="cid != null">AND d.`bf_cid` = #{cid} </if>
   ORDER BY d.`bf_weight` DESC
   WHERE d.`bf_state` = 1 AND d.bf_goods_total <![CDATA[>=]]> 3
       <if test="cid != null">AND d.`bf_cid` = #{cid} </if>
   ORDER BY d.`bf_weight` DESC,d.bf_id
   LIMIT ${start},${count}
  </select>
  
  <select id="countBrandInfo" resultType="Long">
     SELECT IFNULL(COUNT(d.`bf_id`),0) FROM yeshi_ec_brand_info d
   WHERE d.`bf_state` = 1 AND d.bf_goods_total <![CDATA[>=]]> 3
       <if test="cid != null">AND d.`bf_cid` = #{cid} </if>
  </select>
  <select id="listValidByCidToApp" resultMap="BaseResultMap">
     SELECT * FROM yeshi_ec_brand_info d
   WHERE d.`bf_state` = 1 AND d.`bf_cid` = #{cid}  AND d.bf_goods_total <![CDATA[>=]]> 3
  </select>
  <select id="countValidByCid" resultType="Long">
     SELECT IFNULL(COUNT(d.`bf_id`),0) FROM yeshi_ec_brand_info d
   WHERE d.`bf_state` = 1 <if test="cid != null">AND d.`bf_cid` = #{cid} </if>
  </select>
  <select id="countValidByCidToApp" resultType="Long">
     SELECT IFNULL(COUNT(d.`bf_id`),0) FROM yeshi_ec_brand_info d
   WHERE d.`bf_state` = 1  <if test="cid != null">AND d.`bf_cid` = #{cid} </if>
        AND d.bf_goods_total <![CDATA[>=]]> 3
  </select>
  
  <select id="listValidAll" resultMap="BaseResultMap">
@@ -98,4 +116,34 @@
   LIMIT ${start},${count}
  </select>
  
  <select id="listQuery" resultMap="BaseResultMap">
     SELECT * FROM yeshi_ec_brand_info
     WHERE 1=1
        <if test="key != null and key !='' ">
           AND bf_name LIKE '%${key}%'
        </if>
        <if test="state != null">
            AND bf_state = #{state}
        </if>
        <if test="cid != null">
            AND bf_cid = #{cid}
        </if>
     ORDER BY bf_weight DESC
     LIMIT ${start},${count}
  </select>
  <select id="countQuery" resultType="java.lang.Long">
     SELECT IFNULL(COUNT(bf_id),0) FROM yeshi_ec_brand_info
     WHERE 1=1
        <if test="key != null and key !='' ">
           AND bf_name LIKE '%${key}%'
        </if>
        <if test="state != null">
            AND bf_state = #{state}
        </if>
        <if test="cid != null">
            AND bf_cid = #{cid}
        </if>
  </select>
</mapper>