两表联查的JSON取值
来源:互联网 发布:靠网络如何挣钱 编辑:程序博客网 时间:2024/06/06 17:39
//关联对象private CameraVO camera;publicJSONObject toJSON() { DateFormatUtildateFormatUtil =new DateFormatUtil() ; JSONObject resultJSON = newJSONObject(); resultJSON.put("id",this.getId()); resultJSON.put("camera_id",this.getCamera_id()); resultJSON.put("camera_no",this.getCamera().getNo()); /*resultJSON.put("capture_time", this.getCapture_time());*/ resultJSON.put("capture_time",dateFormatUtil.dateTimeStr(this.getCapture_time())); resultJSON.put("current_distinguish_num",this.getCurrent_distinguish_num()); resultJSON.put("front_distinguish_num",this.getFront_distinguish_num()); resultJSON.put("capture_num",this.getCapture_num()); resultJSON.put("current_address",this.getCurrent_address()); resultJSON.put("front_address",this.getFront_address()); resultJSON.put("description",this.getDescription()); // resultJSON.put("no", this.no); returnresultJSON; }<!-- 查询多条捕获信息 --><resultMap type="com.sbd.vo.CaptureInfoVO"id="captureInfo"autoMapping="true"> <idproperty="id"column="id"/> <associationproperty="camera"javaType="com.sbd.vo.CameraVO"autoMapping="true"> <idproperty="id"column="cid"/> <idproperty="no"column="no"/> </association></resultMap>//两表联查时,同名字段位置靠后的必须改名,比如:第一张表的主键为id,第二张表的主键也为id,两表有关联,做查询时,第二张表的主键要起别名,否则会默认第一章标的主键 <select id="findCaptureInfo" parameterType="map" resultMap="captureInfo"> select c.*,camera.no,camera.idcid from capture_info c left join camera on c.camera_id = camera.id; <where> //主键和外键模糊查询条件 <iftest="capture_time != null and capture_time != '' "> andcapture_time like #{capture_time} </if> </where> </select>
阅读全文
0 0
- 两表联查的JSON取值
- json的取值方式
- 38、JS取json的值
- GetJsonNodeValue , GetJsonNodeValueFromFirstArrayItem 取JSON节点的值
- Java的JSON取值工具类
- C#Json的解析与取值
- json中MorphDynaBean的取值
- json类型的字符串取值
- json取值
- JSON 前端取值
- json取值方法
- 嵌套json取值
- Json字符串取值
- json取值
- Java处理json 取json值
- JSON如何取键名不固定的值
- 后台返回的json对象,前台取值
- Newtonsoft.Json 复杂结构类型的取值
- 存储过程的输入输出参数在 sql串 中的拼写
- 数字字母文本超出长度显示...
- PAT乙级题1016.部分A+B
- 负载均衡----文件服务策略
- 基于flowplayer的视频缩略图的视频预览
- 两表联查的JSON取值
- C/C++:fscanf()
- jsoup教程008-从元素抽取属性,文本和HTML
- 2017.10.29 LeetCode
- CV论文笔记(二) Large-scale Video Classification with Convolutional Neural Networks
- Unable to fence NameNode at 问题
- hbase维护操作命令
- Keras Tutorial: Deep Learning in Python
- 机器学习(九):k-means与聚类