.
1.实体
public class Image extends BaseEntity {
/**
* serialVersionUID.
*/
private static final long serialVersionUID = -9072699651769160951L;
private String userId;
private String title;// 标题
private String sourcePath;// 图片原图路径
private String smallPath;// 缩略图路径
private String description;// 图片描述
private int likes;// 得票数
private String lgt;// 经度
private String lat;// 维度
private boolean isJoinTheme = false;// 不参加主题精选:0 参加s为1
private Date createDate;
private Date modifyDate;
private Comment comment;// 最新留言
private String photoAlbumId;// 相册编号id
private String advertisementId = "1";// 广告活动表 id,默认值为1表示不参加活动
private boolean isAlive = true;// 照片是否被禁止,0或false、禁止;1或true、不禁止
}
2.页面使用
<tr>
<th width="30"><input type="checkbox" id="checkAll"/></th>
<th>序號</th>
<th>照片名稱</th>
<th>照片描述</th>
<th>是否已參加活動</th>
<th>票數</th>
<th>上傳用戶</th>
<th>上傳時間</th>
<th>照片是否有效</th>
<th>操作</th>
</tr>
3.
由于需要用户名,但是对于一个image来说userId是一个数字,所以采用借鸡下蛋,借用未使用的 sourcePath来当做userName
<!-- 根据条件返回照片列表 -->
<select id="selectImageByOffsetAndSizeWithKeyword"
parameterType="map" resultType="image">
SELECT
p.id,p.userId,p.smallPath,u.userName AS
sourcePath,p.likes,p.isJoinTheme,p.modifyDate,p.photoAlbumId,p.title,p.sourcePath,p.createDate,p.description
FROM image p
LEFT JOIN user u ON u.id=p.userId
WHERE p.title LIKE
"%"#{imageName}"%"
<if test="userName !=null">
AND u.userName LIKE "%"#{userName}"%"
</if>
<if test="imageUpDate !=null">
AND p.createDate LIKE "%"#{imageUpDate}"%"
</if>
LIMIT #{offset},#{pageSize};
</select>
.
分享到:
相关推荐
EntityFramework 多关键词联合搜索一个字段。一个关键词数组搜索一个字段。该字段下包含任意一个或多个关键词则被筛选出来。通过动态拼接 Lamdba 表达式实现。
解析entity里面的字段注释,并同步到数据库中的备注信息里面
Entity Framework 使用详解doc
Entity Framework 6 Recipes Entity Framework 6 Recipes
3、如果要使用EntityFramework还需要JetEntityFrameworkProvider,这是第三方github提供的软件,在NuGet上也提供了,不过它仅支持32位的,如果想要使用64位的,可以下载源码重新编译dll。 4、上面说的accessdatabase...
Entity Framework主从表使用
Entity Developer Entity Developer Entity Developer
本教程介绍如何创建使用 Entity Framework (EF) Core 进行数据访问的 ASP.NET Core Razor Pages Web 应用。 Razor 页面是 ASP.NET Core MVC 的一个新特性,它可以使基于页面的编码方式更简单高效。 Entity Framework...
自留demo。springMVC-HttpEntity(ResponseEntity)与jQuery交互的小结demo。
本书是关于Entity framework code first 的详细介绍,在本书中,你可以学到从无到有的创建基于Entity framework code first的项目
Entity Framework Core Cookbook - Second Edition by Ricardo Peres English | 9 Nov. 2016 | ISBN: 1785883305 | 340 Pages | MOBI/EPUB/PDF+Code Files | 6.2 MB Entity Framework is a highly recommended ...
电子书 Entity Framework 4 In Action
ADO.NET Entity ...Entity Data Model (EDM) 为主,将数据逻辑层切分为三块,分别为 Conceptual Schema, Mapping Schema 与 Storage Schema 三层,其上还有 Entity Client,Object Context 以及 LINQ 可以使用。
Data access is an integral part of any ... You'll learn how to retrieve data by querying the Entity Data Model and understand how to use LINQ to Entities and Entity SQL to query the Entity Data Model.
entity framework 基础介绍
entityframework框架源代码,需要深入了解entityframework的同学可以下载深入学习研究
ef entityframework服务端 封装dll
ADO.NET Entity Framework
entity framework 教程下载
AspNet.Identity.EntityFramework.Multitenant, 使用 Entity Framework 对 ASP.NET 身份的多租户支持 ASP.NET 标识 EntityFramework 使用 Entity Framework 对 ASP.NET 身份的多租户支持这个库是为了解决我在堆栈...