44323
2023-10-07 e6ee956618b3c1a6371a6c22dfbb70868dbd3f17
cloud-server-activity/src/main/resources/mapper/PointsMerchandiseMapper.xml
@@ -35,4 +35,50 @@
        </if>
        order by insertTime desc
    </select>
    <select id="ticketList" resultType="java.util.Map">
        SELECT id,
        `name`,
        cardType,
        `cover`,
        date_format(startTime ,'%Y-%m-%d') as startTime,
        date_format(endTime ,'%Y-%m-%d') as endTime,
        `type`,
        useScope,
        userPopulation,
        quantityIssued,
        pickUpQuantity,
        `sort`,
        shelves
        from t_points_merchandise
        where 1 = 1
        <if test="query.name != null">
            and `name` like concat('%', #{query.name}, '%')
        </if>
        <if test="query.type != null">
            and cardType = #{query.type}
        </if>
        <if test="query.redemptionMethod != null">
            and redemptionMethod = #{query.redemptionMethod}
        </if>
        <if test="query.userPopulation != null">
            and userPopulation = #{query.userPopulation}
        </if>
        <if test="query.state != null">
            and `state` = #{query.state}
        </if>
        and `type` = 3
        order by sort desc
    </select>
    <select id="changeState" resultType="java.lang.Integer">
        update t_points_merchandise set
        shelves = #{query.state}
        <where>
            <if test="query.ids != null and query.ids.size()>0">
                AND t_points_merchandise.id IN
                <foreach collection="query.ids" separator="," item="id" open="(" close=")">
                    #{id}
                </foreach>
            </if>
        </where>
    </select>
</mapper>