forked from kidgrow-microservices-platform

zhaoxiaohao
2020-11-04 8ea75b6f027f18f6daf229e43928f78b49740f79
kidgrow-business/kidgrow-opration-center/kidgrow-opration-center-biz/src/main/resources/mapper/ConsumptionRecordMapper.xml
@@ -12,8 +12,8 @@
        <where>
            <!--查询条件自行添加-->
            1=1
            <if test="p.recordId != null and p.recordId !=''">
                and record_id = #{p.recordId}
            <if test="p.id != null and p.id !=''">
                and id = #{p.id}
            </if>
            <if test="p.lastRecordId != null and p.lastRecordId !=''">
                and last_record_id = #{p.lastRecordId}
@@ -48,7 +48,7 @@
        <include refid="Column_List"/>
        from consumption_record
        <include refid="where"/>
        order by record_id desc
        order by id desc
        limit 1
    </select>
@@ -58,6 +58,19 @@
        <include refid="Column_List"/>
        from consumption_record
        <include refid="where"/>
        order by record_id desc
        order by id desc
    </select>
    <!--定义根据-ConsumptionRecord当作查询条件返回对象集合-->
    <select id="findDetailList" resultType="com.kidgrow.oprationcenter.model.ConsumptionRecord">
        SELECT * FROM `consumption_record`
        where record_type=1
        and update_time is null
            <if test="DetailList!=null and DetailList.size()>0">
                and pro_order_detail_id in
                <foreach item="item" index="index" collection="DetailList" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
        order by id desc
    </select>
</mapper>