| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.mzl.flower.mapper.flower.FlowerMapper"> |
| | | <delete id="deleteBatchPhysics"> |
| | | DELETE FROM t_flower |
| | | WHERE id IN |
| | | <foreach collection="list" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="selectFlowerList" resultType="com.mzl.flower.dto.response.flower.FlowerListDTO"> |
| | | SELECT f.*, s.name supplierName, st.name supplierType, fc.name categoryStr |
| | |
| | | </if> |
| | | <if test="condition.recommend != null and !condition.recommend"> |
| | | AND (f.recommend = 0 or f.recommend is null) |
| | | </if> |
| | | <if test="condition.isLimited != null and condition.isLimited"> |
| | | AND f.limited > 0 |
| | | </if> |
| | | <if test="condition.isLimited != null and !condition.isLimited"> |
| | | AND (f.limited = 0 or f.limited is null) |
| | | </if> |
| | | <if test="condition.statusList != null and condition.statusList.size > 0"> |
| | | and f.status in |
| | |
| | | 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> |
| | | <select id="getDeletdFlowByIds" resultType="com.mzl.flower.entity.flower.Flower"> |
| | | select * from t_flower |
| | | WHERE id IN |
| | | <foreach collection="list" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </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> |
| | | <update id="updateBatchTypeRank"> |
| | | <foreach collection="list" item="item" separator=";"> |
| | | UPDATE t_flower |
| | | SET type_rank = #{item.typeRank} |
| | | WHERE id = #{item.id} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <update id="restoreFlowerBatch"> |
| | | update t_flower set deleted = 0 |
| | | WHERE id IN |
| | | <foreach collection="list" item="id" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </update> |
| | | <update id="updateTypeRankNull"> |
| | | update t_flower set type_rank=null where category=#{category} and level=#{level} |
| | | </update> |
| | | </mapper> |