陶杰
2025-01-09 1fe9a1c594c40324b64f2822b2381e741fa231fc
src/main/resources/mapper/statisticsAnalysis/FlowerMaterialMapper.xml
@@ -5,7 +5,8 @@
    <select id="getFlowerMaterialPage"
            resultType="com.mzl.flower.dto.response.statisticAnalysis.FlowerMaterialVO">
        <include refid="flowerMaterialSql"></include>
<!--         <include refid="flowerMaterialSql"></include>-->
        <include refid="flowerMaterialSqlWidthDict"></include>
    </select>
    <select id="getFlowerMaterialList"
            resultType="com.mzl.flower.dto.response.statisticAnalysis.FlowerMaterialVO">
@@ -37,6 +38,7 @@
             ,si.contact_tel
             ,s.name as station_name
             ,fc.name as category_name
             ,case when fc_parent.id  is not null then fc_parent.name else fc.name end as parent_category_name
             ,f.name as flower_name
             ,f.`level` as flower_level
             ,f.unit as flower_unit
@@ -52,7 +54,8 @@
        on si.station_id=s.id
        left join t_flower_category fc
        on f.category=fc.id
        left join t_flower_category fc_parent
        on fc.parent_id=fc_parent.id
--           and u.deleted=0 and s.deleted=0 and fc.deleted=0
        <include refid="flowerMaterialSql_where"></include>
        <if test="dto.orderField !=null and dto.orderField !=''">
@@ -68,6 +71,7 @@
             ,si.contact_tel
             ,s.name as station_name
             ,fc.name as category_name
             ,case when fc_parent.id  is not null then fc_parent.name else fc.name end as parent_category_name
             ,f.name as flower_name
             ,f.`level` as flower_level
             ,f.unit as flower_unit
@@ -85,6 +89,8 @@
        on si.station_id=s.id
        left join t_flower_category fc
        on f.category=fc.id
        left join t_flower_category fc_parent
        on fc.parent_id=fc_parent.id
        LEFT JOIN (SELECT ct.label, ct.value from t_code_value ct where type_code = 'FLOWER_STATUS') code ON f.status = code.value
        LEFT JOIN (SELECT ct.label, ct.value from t_code_value ct where type_code = 'FLOWER_LEVEL') code2 ON f.`level` = code2.value
        <include refid="flowerMaterialSql_where"></include>
@@ -119,8 +125,17 @@
            ))
        </if>
        <if test="dto.flowerStatus !=null and dto.flowerStatus !=''">
            AND  f.status = #{dto.flowerStatus}
<!--        <if test="dto.flowerStatus != null and dto.flowerStatus != ''">-->
<!--            <if test="dto.flowerStatus == 'OFF'">-->
<!--                AND f.status IN ('OFF', 'FORCE_OFF')-->
<!--            </if>-->
<!--            <if test="dto.flowerStatus != 'OFF'">-->
<!--                AND f.status = #{dto.flowerStatus}-->
<!--            </if>-->
<!--        </if>-->
        <if test="dto.flowerStatus != null and dto.flowerStatus != ''">
            AND f.status = #{dto.flowerStatus}
        </if>
        <if test="dto.flowerLevel !=null and dto.flowerLevel !=''">
            AND  f.`level` = #{dto.flowerLevel}