| | |
| | | |
| | | <select id="myCollect" resultType="com.mzl.flower.dto.response.flower.FlowerShowListDTO"> |
| | | SELECT f.*, s.name supplierName, st.name supplierType, fc.name categoryStr |
| | | , (select sum(num) from t_cart ccc |
| | | where ccc.flower_id = f.id |
| | | and ccc.create_by = #{condition.userId} |
| | | ) shopnum |
| | | FROM t_collect_flower c |
| | | left join t_flower f on c.flower_id = f.id |
| | | left join t_supplier_info s on s.id = f.supplier_id |
| | |
| | | |
| | | <select id="myBrowseHistory" resultType="com.mzl.flower.dto.response.flower.FlowerShowListDTO"> |
| | | SELECT f.*, s.name supplierName, st.name supplierType, fc.name categoryStr |
| | | , (select sum(num) from t_cart ccc |
| | | where ccc.flower_id = f.id |
| | | and ccc.create_by = #{condition.userId} |
| | | ) shopnum |
| | | FROM t_browse_his c |
| | | left join t_flower f on c.flower_id = f.id |
| | | left join t_supplier_info s on s.id = f.supplier_id |
| | |
| | | </choose> |
| | | </when> |
| | | <otherwise> |
| | | order by c.create_time desc |
| | | order by c.update_time desc |
| | | </otherwise> |
| | | </choose> |
| | | </select> |
| | |
| | | </if> |
| | | ORDER BY fzp.rank asc |
| | | </select> |
| | | <select id="searchInvalidHistory" resultType="java.lang.Long"> |
| | | SELECT c.id |
| | | FROM t_browse_his c left join t_flower f on c.flower_id = f.id |
| | | WHERE f.deleted = 0 and c.deleted = 0 and f.status != 'UP' and c.user_id = #{userId} |
| | | </select> |
| | | |
| | | <update id="updateFlowerCategoryInfo"> |
| | | update t_flower f, t_flower_category fc |
| | | set f.unit = fc.unit, f.color = fc.color |
| | | where f.category = fc.id and fc.id = #{category} |
| | | </update> |
| | | </mapper> |