item.choose=!item.choose不合法吗?

时间: 2024-06-05 19:11:28 浏览: 30
在大多数编程语言中,`!`符号代表逻辑非运算符,用于将布尔值取反。因此,`!item.choose`表示`item.choose`的逻辑反值,即`item.choose`为`false`时为`true`,`item.choose`为`true`时为`false`。 在一些语言中,`!`符号不能直接应用于非布尔类型的值。因此,如果`item.choose`是一个非布尔类型的值,那么`!item.choose`可能不合法。具体情况需要根据编程语言和数据类型来确定。
相关问题

<select id="selectAll" resultMap="tblTicketCardDistributionMap"> select * from TBL_TICKET_CARD_DISTRIBUTION <where> <choose> <when test="query.orderType != null and query.orderType != '' and query.orderType =='03'"> and ORDER_TYPE = #{query.orderType} and ( <if test="query.inStationId != null and query.inStationId != '' "> IN_STATION_ID = #{query.inStationId} </if> <if test="query.outStationId != null and query.outStationId != '' "> or OUT_STATION_ID = #{query.outStationId} </if> ) </when> <otherwise> <if test="query.orderType != null and query.orderType != '' "> and ORDER_TYPE = #{query.orderType} </if> <if test="query.inStationId != null and query.inStationId != '' "> and IN_STATION_ID = #{query.inStationId} </if> <if test="query.outStationId != null and query.outStationId != '' "> or OUT_STATION_ID = #{query.outStationId} </if> </otherwise> </choose> <if test="query.lineId != null and query.lineId != '' "> and LINE_ID = #{query.lineId} </if> <if test="query.stationId != null and query.stationId != '' "> and STATION_ID = #{query.stationId} </if> <if test="query.operatorId != null and query.operatorId != '' "> and OPERATOR_ID = #{query.operatorId} </if> <if test="query.curDay != null and query.curDay != '' "> and CUR_DAY = #{query.curDay} </if> <if test="query.beginTime != null and query.beginTime != '' "> and OPERATE_TIME between #{query.beginTime} and #{query.endTime} </if> </where> </select>报错语法有问题,修改正确的

根据报错信息,需要看一下具体是哪个语法有问题。不过根据代码,有一个语法问题: 在`<when>`标签中,使用了`<if>`标签,应该改为`${}`,例如: ``` <when test="query.orderType != null and query.orderType != '' and query.orderType =='03'"> and ORDER_TYPE = #{query.orderType} and ( ${query.inStationId != null and query.inStationId != '' ? 'IN_STATION_ID = #{query.inStationId}' : ''} ${query.outStationId != null and query.outStationId != '' ? ' or OUT_STATION_ID = #{query.outStationId}' : ''} ) </when> ``` 这样应该就能解决语法问题了。

<view class="answer-list"> <view class="answer" wx:for="{{curQuestion.answerList}}" wx:key="index" bindtap="answerClick" data-index="{{index}}"> <view style="background:{{curQuestion.answerFlag && item.realFlag?'#1CC18D':(curQuestion.answerFlag && !item.realFlag && curQuestion.curIndex == index ? '#FA6C6C':'#fff')}};color:{{curQuestion.answerFlag && (item.realFlag || curQuestion.curIndex == index)?'#fff':'#000'}}" class="answer-item"> {{item.name}}</view> <view class="icon-box" wx:if="{{curQuestion.answerFlag && (item.realFlag || curQuestion.curIndex == index)}}"> <text wx:if="{{curQuestion.answerFlag && !item.realFlag && curQuestion.curIndex == index}}" class="cuIcon-roundclosefill choose-fail"></text> <text wx:if="{{curQuestion.answerFlag && item.realFlag}}" class="cuIcon-roundcheckfill choose-success"></text> </view> </view> </view> 转uniapp写法

<view class="answer-list"> <view class="answer" v-for="(item, index) in curQuestion.answerList" :key="index" @tap="answerClick" :data-index="index"> <view :style="{background: curQuestion.answerFlag && item.realFlag ? '#1CC18D' : (curQuestion.answerFlag && !item.realFlag && curQuestion.curIndex == index ? '#FA6C6C' : '#fff'), color: curQuestion.answerFlag && (item.realFlag || curQuestion.curIndex == index) ? '#fff' : '#000'}" class="answer-item"> {{item.name}} </view> <view class="icon-box" v-if="curQuestion.answerFlag && (item.realFlag || curQuestion.curIndex == index)"> <text v-if="curQuestion.answerFlag && !item.realFlag && curQuestion.curIndex == index" class="cuIcon-roundclosefill choose-fail"></text> <text v-if="curQuestion.answerFlag && item.realFlag" class="cuIcon-roundcheckfill choose-success"></text> </view> </view> </view>

相关推荐

<select id="findList" resultType="ZdrgkBkyj" > SELECT <include refid="zdrgkBkyjColumns"/> FROM zdrgk_zdrgj a left join zdryk_bkgl b on a.zdrgj_xm = b.bkgl_zdrxm and b.del_flag = #{DEL_FLAG_NORMAL} <where> a.del_flag = #{DEL_FLAG_NORMAL} ${dataScope} <if test="zdrgjXm != null and zdrgjXm != ''"> AND a.zdrgj_xm = #{zdrgjXm} </if> <if test="zdrgjSfzhm != null and zdrgjSfzhm != ''"> AND a.zdrgj_sfzhm = #{zdrgjSfzhm} </if> <if test="zdrgjXsd != null and zdrgjXsd != ''"> AND a.zdrgj_xsd = #{zdrgjXsd} </if> <if test="bkglZdrxm != null and bkglZdrxm != ''"> AND b.bkgl_zdrxm = #{bkglZdrxm} </if> </where> <choose> <when test="page !=null and page.orderBy != null and page.orderBy != ''"> ORDER BY ${page.orderBy} </when> <otherwise> ORDER BY a.update_date DESC </otherwise> </choose> </select>为zdrgkbkyj的xml文件 bkglZdrxm只作为查询没有显示在列表数据中如何在jeeplus中 queryParams : function(params) { var searchParam = $("#searchForm").serializeJSON(); searchParam.zdrgjXm = $("#zdrgjXm").val(); searchParam.bkglZdrxm = $("#bkglZdrxm").val(); if (searchParam.zdrgjXm && searchParam.bkglZdrxm && searchParam.zdrgjXm === searchParam.bkglZdrxm) { searchParam.matchedValue = searchParam.zdrgjXm; } else { searchParam.matchedValue = null; } searchParam.pageNo = params.limit === undefined? "1" :params.offset/params.limit+1; searchParam.pageSize = params.limit === undefined? -1 : params.limit; if(params.sort && params.order){ searchParam.orderBy = params.sort+ " "+ params.order; } return searchParam; }中添加一个查询条件 当前的zdrgjXm字段要和bkglZdrxm字段有一样的值才能显示

chooseGood(event){ console.log(event.currentTarget.dataset.index) let index = event.currentTarget.dataset.index //做非的操作,点击一下就是未选择状态 this.data.cartList[index].choose = !this.data.cartList[index].choose //做数据绑定 this.setData({ cartList: this.data.cartList }) //更新全局里和缓存里的的购物车列表数据 app.globalData.cartList = this.data.cartList wx.setStorageSync('cartList', this.data.cartList) //计算合计 this.total() }, //在购物车点击商品跳入商品详情页面 toGoodDetail(event){ console.log(event.currentTarget.dataset.id) let id = event.currentTarget.dataset.id wx.navigateTo({ url: '/pages/goodDetail/goodDetail?id=' + id , }) }, //全选 chooseAll(){ this.setData({ allChoose:!this.data.allChoose }) if(this.data.allChoose == true){ for(let index in this.data.cartList){ this.data.cartList[index].choose = true } }else{ for(let index in this.data.cartList){ this.data.cartList[index].choose = false } } this.setData({ cartList:this.data.cartList }) //更新全局里和缓存里的的购物车列表数据 app.globalData.cartList = this.data.cartList wx.setStorageSync('cartList', this.data.cartList) //计算合计 this.total() }, //计算合计价格 total(){ let sum = 0; for(let index in this.data.cartList){ if(this.data.cartList[index].choose == true){ sum = sum + this.data.cartList[index].price * this.data.cartList[index].number } } this.setData({ sum: sum.toFixed(2)//合计价格四舍五入 小数点后两位 }) }, //跳入订单页面 toOrder(){ // 把选择的商品放到订单列表 let orderList = [] for(let index in this.data.cartList){ if(this.data.cartList[index].choose == true){ orderList.push(this.data.cartList[index]) } } app.globalData.orderList = orderList //把订单列表放到全局 if(app.globalData.orderList.length == 0){ wx.showToast({ icon:'error', title: '请选择商品', }) return } wx.navigateTo({ url: '/pages/order/order', }) } })解释这段代码

请帮我解释下面这段代码 <select id="listByUser" resultType="com.yj.model.vo.EnrollByUserItemVO"> select cc.*, cc.course_start_time AS courseStartTimeMd, ub.id ubid, info.payment_status as payment_status, info.total_money as totalMoney, ccc.category_name, CASE WHEN cc.course_video is not null and cc.course_video != '' THEN 2 WHEN (SELECT count(1) FROM crs_course_class ccc2 WHERE cc.id = ccc2.course_id AND ccc2.data_flag = 1 AND ccc2.class_video IS NOT NULL and ccc2.class_video != '') > 0 THEN 2 ELSE 1 END AS courseType from user_course_enroll ub INNER JOIN crs_course cc ON ub.course_id = cc.id INNER JOIN crs_course_category ccc ON cc.course_category_id = ccc.id LEFT JOIN order_item item ON item.project_relevancy_id = ub.id LEFT JOIN order_info info ON item.info_id = info.id LEFT JOIN user_browse uu ON uu.user_id = ub.user_id and uu.course_id = ub.course_id and uu.data_flag = 1 where 1 = 1 <if test="(publicId != null and publicId != '' ) or ( userIds != null and userIds.size() != 0)"> and ( <if test="publicId != null and publicId != '' "> ub.public_id = #{publicId} </if> <if test="publicId != null and publicId != '' and userIds != null and userIds.size() != 0"> or ub.user_id IN <foreach collection="userIds" item="item" open="(" separator="," close=")" index="index"> #{item} </foreach> </if> <if test="(publicId == null or publicId == '') and userIds != null and userIds.size() != 0"> ub.user_id IN <foreach collection="userIds" item="item" open="(" separator="," close=")" index="index"> #{item} </foreach> </if> ) </if> <choose> <when test="query.paymentStateList != null and query.paymentStateList.size() != 0"> and ccc.data_flag = 1 </when> <otherwise> and ub.apply_type = 1 and ccc.data_flag = 1 and ub.data_flag = 1 and ub.verify_state = 1 and cc.data_flag = 1 </otherwise> </choose> <if test="query.shelfStatus !=null"> and cc.shelf_status = #{query.shelfStatus} </if> <if test="query.categoryId !=null and query.categoryId != ''"> and ccc.id = #{query.categoryId} </if> <if test="query.learnState !=null"> and uu.learn_state = #{query.learnState} and ccc.prelect_way = 1 </if> <if test="query.paymentStateList != null and query.paymentStateList.size() != 0"> AND ( info.payment_status IN <foreach collection="query.paymentStateList" item="item" open="(" separator="," close=")" index="index"> #{item} </foreach> ) </if> </select>

最新推荐

recommend-type

基于微信小程序的新生报到系统设计与实现.docx

基于微信小程序的新生报到系统设计与实现.docx
recommend-type

基于java的电商平台的设计与实现.docx

基于java的电商平台的设计与实现.docx
recommend-type

十种常见电感线圈电感量计算公式详解

本文档详细介绍了十种常见的电感线圈电感量的计算方法,这对于开关电源电路设计和实验中的参数调整至关重要。计算方法涉及了圆截面直导线、同轴电缆线、双线制传输线、两平行直导线间的互感以及圆环的电感。以下是每种类型的电感计算公式及其适用条件: 1. **圆截面直导线的电感** - 公式:\( L = \frac{\mu_0 l}{2\pi r} \) (在 \( l >> r \) 的条件下) - \( l \) 表示导线长度,\( r \) 表示导线半径,\( \mu_0 \) 是真空导磁率。 2. **同轴电缆线的电感** - 公式:\( L = \frac{\mu_0 l}{2\pi (r1 + r2)} \) (忽略外导体厚度) - \( r1 \) 和 \( r2 \) 分别为内外导体直径。 3. **双线制传输线的电感** - 公式:\( L = \frac{\mu_0 l}{2\pi^2 D \ln(\frac{D+r}{r})} \) (条件:\( l >> D, D >> r \)) - \( D \) 是两导线间距离。 4. **两平行直导线的互感** - 公式:\( M = \frac{\mu_0 l}{2\pi r} \ln(\frac{D}{d}) \) (条件:\( D >> r \)) - \( d \) 是单个导线半径,互感与距离 \( D \) 有关。 5. **圆环的电感** - 公式:\( L = \mu_0 R \ln(\frac{R}{r}) \) - \( R \) 是圆环的外半径,\( r \) 是圆环截面的半径。 在电路设计中,计算这些电感值有助于确保电路性能的准确性和稳定性。值得注意的是,实际应用中还需要考虑线圈的形状、材料(包括磁芯的相对导磁率)和外部因素,如磁珠的影响。此外,这些公式通常是在理想化情况下给出的,实际应用中可能需要考虑非线性效应和频率依赖性。对于复杂线圈,可能需要借助于电磁场仿真软件进行精确计算。
recommend-type

管理建模和仿真的文件

管理Boualem Benatallah引用此版本:布阿利姆·贝纳塔拉。管理建模和仿真。约瑟夫-傅立叶大学-格勒诺布尔第一大学,1996年。法语。NNT:电话:00345357HAL ID:电话:00345357https://theses.hal.science/tel-003453572008年12月9日提交HAL是一个多学科的开放存取档案馆,用于存放和传播科学研究论文,无论它们是否被公开。论文可以来自法国或国外的教学和研究机构,也可以来自公共或私人研究中心。L’archive ouverte pluridisciplinaire
recommend-type

【树结构遍历操作】:JavaScript深度优先与广度优先算法详解

![js+数据结构更改](https://www.freecodecamp.org/news/content/images/2021/04/JavaScript-splice-method.png) # 1. 树结构遍历操作概述 在计算机科学中,树结构是表示数据的一种重要方式,尤其在处理层次化数据时显得尤为重要。树结构遍历操作是树上的核心算法,它允许我们访问树中每一个节点一次。这种操作广泛应用于搜索、排序、以及各种优化问题中。本章将概览树结构遍历的基本概念、方法和实际应用场景。 ## 1.1 树结构的定义与特性 树是由一个集合作为节点和一组连接这些节点的边构成的图。在树结构中,有一个特殊
recommend-type

年份是否为闰年C语言判断

在C语言中,判断一个年份是否为闰年的标准有以下几个规则: 1. **普通闰年**:能被4整除但不能被100整除的年份是普通闰年,如2004年就是闰年。 2. **世纪闰年**:能被400整除的年份也是闰年,但如果是整百数(例如1900年),则需要满足能被400整除才能是闰年。 下面是简单的C语言函数来判断一个年份是否是闰年: ```c #include <stdbool.h> bool is_leap_year(int year) { if (year % 4 != 0) { // 如果不是4的倍数,则直接返回false return false; }
recommend-type

军用车辆:CAN总线的集成与优势

本文探讨了CAN总线在军用车辆中的应用,针对军用车辆电子系统的发展趋势和需求,着重分析了将CAN总线技术引入军用车辆的必要性和可行性。军用车辆的电子化程度日益提高,电子设备的集成和资源共享成为关键,以提升整体性能和作战效能。CAN总线(Controller Area Network)作为一种成功的民用汽车通信技术,因其模块化、标准化、小型化以及高效能的特点,被提出作为军用车辆的潜在解决方案。 首先,文章指出军用车辆的数据通信需求不同于一般计算机网络,它强调实时性、可靠性、短帧信息传输、频繁的信息交换以及高安全性。CAN总线正好满足这些特殊要求,它支持多主机通信模式,允许灵活的数据交换,并且具有固定的报文格式,这在满足军用车辆实时和高效的数据处理中具有优势。 对比了CAN总线与传统的军用通信标准1553B后,文中强调了CAN总线在可靠性方面的明显优势,尤其是在复杂环境和高负载情况下,其容错能力和故障自愈能力使其在军用车辆中的应用更具吸引力。此外,CAN总线的成本效益也是其在军用领域得到广泛应用的一个重要因素。 文章详细介绍了CAN总线的工作原理和特点,比如它的仲裁机制能够有效管理多个节点间的通信,避免冲突,同时其低数据速率适合于军用车辆的实时通信需求。在介绍完CAN总线的优势后,文章还可能探讨了实际应用中的挑战,如如何确保网络的安全性、如何进行有效的系统集成等问题,以及如何通过研发和优化来克服这些挑战。 本文通过对CAN总线特性的深入剖析,证明了将其应用于军用车辆是切实可行且具有重大意义的,为军用车辆电子系统的现代化和成本效益最大化提供了新的思路和技术路径。
recommend-type

"互动学习:行动中的多样性与论文攻读经历"

多样性她- 事实上SCI NCES你的时间表ECOLEDO C Tora SC和NCESPOUR l’Ingén学习互动,互动学习以行动为中心的强化学习学会互动,互动学习,以行动为中心的强化学习计算机科学博士论文于2021年9月28日在Villeneuve d'Asq公开支持马修·瑟林评审团主席法布里斯·勒菲弗尔阿维尼翁大学教授论文指导奥利维尔·皮耶昆谷歌研究教授:智囊团论文联合主任菲利普·普雷教授,大学。里尔/CRISTAL/因里亚报告员奥利维耶·西格德索邦大学报告员卢多维奇·德诺耶教授,Facebook /索邦大学审查员越南圣迈IMT Atlantic高级讲师邀请弗洛里安·斯特鲁布博士,Deepmind对于那些及时看到自己错误的人...3谢谢你首先,我要感谢我的两位博士生导师Olivier和Philippe。奥利维尔,"站在巨人的肩膀上"这句话对你来说完全有意义了。从科学上讲,你知道在这篇论文的(许多)错误中,你是我可以依
recommend-type

【图结构优化】:在JavaScript中实现与提升性能的策略

![【图结构优化】:在JavaScript中实现与提升性能的策略](https://d14b9ctw0m6fid.cloudfront.net/ugblog/wp-content/uploads/2020/10/4.png) # 1. 图结构基础与JavaScript中的应用场景 ## 图结构基础概念 图是一种非线性数据结构,由一系列节点(顶点)和连接节点的边组成。它能够用来模拟复杂的关系网络,比如社交网络、互联网、交通网络等。在图结构中,有无向图和有向图之分,分别用来表示关系是否具有方向性。 ## 图结构的基本操作 图结构的操作包括添加或删除节点和边、寻找两个节点之间的路径、计算顶点的度
recommend-type

qml+ffmpeg编写视频播放器

QML (Qt Markup Language) 和 FFmpeg 的结合可以用于创建功能丰富的视频播放器。QML 是一种声明式的、基于模型视图的用户界面语言,它是 Qt 框架的一部分,非常适合构建跨平台的应用程序。FFmpeg 则是一个强大的多媒体框架,特别擅长处理音频和视频流。 在 QML 中编写视频播放器,通常会用到以下几个步骤: 1. **设置环境**:首先确保你已经在项目中安装了 Qt 开发工具,并配置好 FFmpeg 库,这通常是通过系统库或包含 FFmpeg 源码的 build 配置完成。 2. **引入模块**:在 QML 文件中引入 `QtQuick.Controls`