- 浏览: 7477 次
- 性别:
- 来自: 青岛
最新评论
http://www.iteye.com/topic/393042
最近做了很多动态的查询,尤其是排序,以及一些状态字段,所以就做了一个总的动态查询,以不变应万变,呵呵
ibatis 里面的sql代码:
Xml代码
<select id="getTopics" resultClass="topic" parameterClass="map">
<![CDATA[
select * from p_Topic
]]>
<dynamic prepend=" WHERE ">
<isPropertyAvailable property="authorId">
<isNotNull property="authorId" prepend=" and ">
authorId=#authorId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketId">
<isNotNull property="marketId" prepend=" and ">
marketId=#marketId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isDelete">
<isNotNull property="isDelete" prepend=" and ">
isDelete=#isDelete#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isBest">
<isNotNull property="isBest" prepend=" and ">
isBest=#isBest#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="statusStr">
<isNotNull property="statusStr" prepend=" and ">
$statusStr$
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and marketId in ">
<iterate property="marketIdList" conjunction="," close=")" open="(">
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
</dynamic>
<dynamic prepend=" order by ">
<isPropertyAvailable property="orderStr">
<isNotNull property="orderStr">
$orderStr$
</isNotNull>
</isPropertyAvailable>
</dynamic>
<dynamic>
<isPropertyAvailable property="begin">
<isNotNull property="begin">
limit #begin#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="max" prepend=" , ">
<isNotNull property="max">
#max#
</isNotNull>
</isPropertyAvailable>
</dynamic>
</select>
<select id="getTopicCount" resultClass="java.lang.Long"
parameterClass="map">
<![CDATA[
select count(id) from p_Topic
]]>
<dynamic prepend=" WHERE ">
<isPropertyAvailable property="authorId">
<isNotNull property="authorId" prepend=" and ">
authorId=#authorId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketId">
<isNotNull property="marketId" prepend=" and ">
marketId=#marketId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isDelete">
<isNotNull property="isDelete" prepend=" and ">
isDelete=#isDelete#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isBest">
<isNotNull property="isBest" prepend=" and ">
isBest=#isBest#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="statusStr">
<isNotNull property="statusStr" prepend=" and ">
$statusStr$
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and ">
<iterate property="marketIdList" conjunction="," close=")" open=" marketId in (">
<select id="getTopics" resultClass="topic" parameterClass="map">
<![CDATA[
select * from p_Topic
]]>
<dynamic prepend=" WHERE ">
<isPropertyAvailable property="authorId">
<isNotNull property="authorId" prepend=" and ">
authorId=#authorId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketId">
<isNotNull property="marketId" prepend=" and ">
marketId=#marketId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isDelete">
<isNotNull property="isDelete" prepend=" and ">
isDelete=#isDelete#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isBest">
<isNotNull property="isBest" prepend=" and ">
isBest=#isBest#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="statusStr">
<isNotNull property="statusStr" prepend=" and ">
$statusStr$
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and marketId in ">
<iterate property="marketIdList" conjunction="," close=")" open="(">
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
</dynamic>
<dynamic prepend=" order by ">
<isPropertyAvailable property="orderStr">
<isNotNull property="orderStr">
$orderStr$
</isNotNull>
</isPropertyAvailable>
</dynamic>
<dynamic>
<isPropertyAvailable property="begin">
<isNotNull property="begin">
limit #begin#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="max" prepend=" , ">
<isNotNull property="max">
#max#
</isNotNull>
</isPropertyAvailable>
</dynamic>
</select>
<select id="getTopicCount" resultClass="java.lang.Long"
parameterClass="map">
<![CDATA[
select count(id) from p_Topic
]]>
<dynamic prepend=" WHERE ">
<isPropertyAvailable property="authorId">
<isNotNull property="authorId" prepend=" and ">
authorId=#authorId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketId">
<isNotNull property="marketId" prepend=" and ">
marketId=#marketId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isDelete">
<isNotNull property="isDelete" prepend=" and ">
isDelete=#isDelete#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isBest">
<isNotNull property="isBest" prepend=" and ">
isBest=#isBest#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="statusStr">
<isNotNull property="statusStr" prepend=" and ">
$statusStr$
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and ">
<iterate property="marketIdList" conjunction="," close=")" open=" marketId in (">Xml代码
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
</dynamic>
lt;/select>
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
</dynamic>
</select>
这里需要注意的是:
①#xxx# 代表xxx是属性值,map里面的key或者是你的pojo对象里面的属性,ibatis会自动在它的外面加上引号,表现在sql语句是这样的 where xxx = 'xxx' ;
而$xxxx$ 则是把xxxx作为字符串拼接到你的sql语句中,比如 order by topicId , 如果你不用$来拼接而用#的话,外面就会被加上引号的哦 比如你的语句这样写 ... order by #xxx# (xxx就是你传进来的字符串topicId),ibatis 就会把他翻译成 order by 'topicId' 这样就报错了 ,用$的结果就是这样 order by topicId
②这里的iterate
Java代码
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and marketId in ">
<iterate property="marketIdList" conjunction="," close=")" open="(">
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and marketId in ">
<iterate property="marketIdList" conjunction="," close=")" open="(">
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable> 注意 iterate 的property属性 ,虽然你上面的isNotNull什么的都有这句,但这里一定要写清楚,否则ibatis会找不到你的list的
数据访问层代码:
Java代码
public List<Topic> getTopics(Map<String, Object> map) {
return getSqlMapClientTemplate().queryForList("getTopics", map);
}
public List<Topic> getTopics(Map<String, Object> map) {
return getSqlMapClientTemplate().queryForList("getTopics", map);
} 服务层代码:
Java代码
public List<Topic> getTopicsByMarketIdList(Long authorId,List<Long> marketIdList,
Integer orderby, Integer status, Pagination pagination) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("authorId", authorId);
map.put("isDelete", false);
map.put("marketIdList", marketIdList);
map.put("orderStr", "这里你组装你的order字符串");
map.put("statusStr","这里你组装你的status字符串");
map.put("begin", pagination.getOffset());
map.put("max", pagination.getPageSize());
//这个getTopicCount()方法和getTopics()大体是一致的,所以我的dao里面省略了它
Long total = topicDao.getTopicCount(map);
if (total == 0) {
return new ArrayList<Topic>();
} else {
pagination.setTotal(total);
List<Topic> res = topicDao.getTopics(map);
return res;
}
}
public List<Topic> getTopicsByMarketIdList(Long authorId,List<Long> marketIdList,
Integer orderby, Integer status, Pagination pagination) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("authorId", authorId);
map.put("isDelete", false);
map.put("marketIdList", marketIdList);
map.put("orderStr", "这里你组装你的order字符串");
map.put("statusStr","这里你组装你的status字符串");
map.put("begin", pagination.getOffset());
map.put("max", pagination.getPageSize());
//这个getTopicCount()方法和getTopics()大体是一致的,所以我的dao里面省略了它
Long total = topicDao.getTopicCount(map);
if (total == 0) {
return new ArrayList<Topic>();
} else {
pagination.setTotal(total);
List<Topic> res = topicDao.getTopics(map);
return res;
}
} Java代码
public class Topic extends BaseObject implements Serializable {
/**
*
*/
private static final long serialVersionUID = -851973667810710701L;
private Long id;
private Long authorId;
private String authorName;
private Long marketId;
private String title;
private String tags;
private String content;
private Date pubdate;
private Integer isBest;
private Integer status;
private Integer isDelete;
private Integer clickCount;
private Integer replyCount;
private Date lastReplyTime;
//getter and setter 省略...
}
public class Topic extends BaseObject implements Serializable {
/**
*
*/
private static final long serialVersionUID = -851973667810710701L;
private Long id;
private Long authorId;
private String authorName;
private Long marketId;
private String title;
private String tags;
private String content;
private Date pubdate;
private Integer isBest;
private Integer status;
private Integer isDelete;
private Integer clickCount;
private Integer replyCount;
private Date lastReplyTime;
//getter and setter 省略...
}Pagination代码:
Java代码
public class Pagination {
/**
* 要查看的页码
*/
private int page;
/**
* 每页显示数
*/
private int pageSize;
/**
* 一共有多少页
*/
private int totalPage;
/**
* 一共有多少条记录
*/
private long total;
/**
* 当前页的记录数
*/
private int size;
/**
* 只需要topxx,不需要页数信息了
*/
private boolean topOnly;
/**
*从第几条记录开始
*/
private int offset;
public void setOffset(int offset) {
this.offset = offset;
}
public Pagination(int page, int pageSize) {
this.page = page;
this.pageSize = pageSize;
}
public Pagination() {
}
public boolean require() {
return pageSize > 0 ? true : false;
}
public int from() {
return page * pageSize;
}
public int to() {
return from() + size;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
if (pageSize > 0) {
this.totalPage = (int) Math.ceil(total / (double) pageSize);
} else {
this.totalPage = 1;
}
if (page >= totalPage) {
page = totalPage - 1;
}
if (page < 0)
page = 0;
if (pageSize > 0) {
if (page < totalPage - 1)
this.size = pageSize;
else
this.size = (int) (total % pageSize);
} else {
this.size = (int) total;
}
offset=page * pageSize;
}
public int getOffset() {
return offset;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public boolean isTopOnly() {
return topOnly;
}
public void setTopOnly(boolean topOnly) {
this.topOnly = topOnly;
}
}
最近做了很多动态的查询,尤其是排序,以及一些状态字段,所以就做了一个总的动态查询,以不变应万变,呵呵
ibatis 里面的sql代码:
Xml代码
<select id="getTopics" resultClass="topic" parameterClass="map">
<![CDATA[
select * from p_Topic
]]>
<dynamic prepend=" WHERE ">
<isPropertyAvailable property="authorId">
<isNotNull property="authorId" prepend=" and ">
authorId=#authorId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketId">
<isNotNull property="marketId" prepend=" and ">
marketId=#marketId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isDelete">
<isNotNull property="isDelete" prepend=" and ">
isDelete=#isDelete#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isBest">
<isNotNull property="isBest" prepend=" and ">
isBest=#isBest#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="statusStr">
<isNotNull property="statusStr" prepend=" and ">
$statusStr$
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and marketId in ">
<iterate property="marketIdList" conjunction="," close=")" open="(">
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
</dynamic>
<dynamic prepend=" order by ">
<isPropertyAvailable property="orderStr">
<isNotNull property="orderStr">
$orderStr$
</isNotNull>
</isPropertyAvailable>
</dynamic>
<dynamic>
<isPropertyAvailable property="begin">
<isNotNull property="begin">
limit #begin#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="max" prepend=" , ">
<isNotNull property="max">
#max#
</isNotNull>
</isPropertyAvailable>
</dynamic>
</select>
<select id="getTopicCount" resultClass="java.lang.Long"
parameterClass="map">
<![CDATA[
select count(id) from p_Topic
]]>
<dynamic prepend=" WHERE ">
<isPropertyAvailable property="authorId">
<isNotNull property="authorId" prepend=" and ">
authorId=#authorId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketId">
<isNotNull property="marketId" prepend=" and ">
marketId=#marketId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isDelete">
<isNotNull property="isDelete" prepend=" and ">
isDelete=#isDelete#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isBest">
<isNotNull property="isBest" prepend=" and ">
isBest=#isBest#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="statusStr">
<isNotNull property="statusStr" prepend=" and ">
$statusStr$
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and ">
<iterate property="marketIdList" conjunction="," close=")" open=" marketId in (">
<select id="getTopics" resultClass="topic" parameterClass="map">
<![CDATA[
select * from p_Topic
]]>
<dynamic prepend=" WHERE ">
<isPropertyAvailable property="authorId">
<isNotNull property="authorId" prepend=" and ">
authorId=#authorId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketId">
<isNotNull property="marketId" prepend=" and ">
marketId=#marketId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isDelete">
<isNotNull property="isDelete" prepend=" and ">
isDelete=#isDelete#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isBest">
<isNotNull property="isBest" prepend=" and ">
isBest=#isBest#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="statusStr">
<isNotNull property="statusStr" prepend=" and ">
$statusStr$
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and marketId in ">
<iterate property="marketIdList" conjunction="," close=")" open="(">
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
</dynamic>
<dynamic prepend=" order by ">
<isPropertyAvailable property="orderStr">
<isNotNull property="orderStr">
$orderStr$
</isNotNull>
</isPropertyAvailable>
</dynamic>
<dynamic>
<isPropertyAvailable property="begin">
<isNotNull property="begin">
limit #begin#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="max" prepend=" , ">
<isNotNull property="max">
#max#
</isNotNull>
</isPropertyAvailable>
</dynamic>
</select>
<select id="getTopicCount" resultClass="java.lang.Long"
parameterClass="map">
<![CDATA[
select count(id) from p_Topic
]]>
<dynamic prepend=" WHERE ">
<isPropertyAvailable property="authorId">
<isNotNull property="authorId" prepend=" and ">
authorId=#authorId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketId">
<isNotNull property="marketId" prepend=" and ">
marketId=#marketId#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isDelete">
<isNotNull property="isDelete" prepend=" and ">
isDelete=#isDelete#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="isBest">
<isNotNull property="isBest" prepend=" and ">
isBest=#isBest#
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="statusStr">
<isNotNull property="statusStr" prepend=" and ">
$statusStr$
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and ">
<iterate property="marketIdList" conjunction="," close=")" open=" marketId in (">Xml代码
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
</dynamic>
lt;/select>
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
</dynamic>
</select>
这里需要注意的是:
①#xxx# 代表xxx是属性值,map里面的key或者是你的pojo对象里面的属性,ibatis会自动在它的外面加上引号,表现在sql语句是这样的 where xxx = 'xxx' ;
而$xxxx$ 则是把xxxx作为字符串拼接到你的sql语句中,比如 order by topicId , 如果你不用$来拼接而用#的话,外面就会被加上引号的哦 比如你的语句这样写 ... order by #xxx# (xxx就是你传进来的字符串topicId),ibatis 就会把他翻译成 order by 'topicId' 这样就报错了 ,用$的结果就是这样 order by topicId
②这里的iterate
Java代码
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and marketId in ">
<iterate property="marketIdList" conjunction="," close=")" open="(">
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable>
<isPropertyAvailable property="marketIdList">
<isNotNull property="marketIdList" prepend=" and marketId in ">
<iterate property="marketIdList" conjunction="," close=")" open="(">
#marketIdList[]#
</iterate>
</isNotNull>
</isPropertyAvailable> 注意 iterate 的property属性 ,虽然你上面的isNotNull什么的都有这句,但这里一定要写清楚,否则ibatis会找不到你的list的
数据访问层代码:
Java代码
public List<Topic> getTopics(Map<String, Object> map) {
return getSqlMapClientTemplate().queryForList("getTopics", map);
}
public List<Topic> getTopics(Map<String, Object> map) {
return getSqlMapClientTemplate().queryForList("getTopics", map);
} 服务层代码:
Java代码
public List<Topic> getTopicsByMarketIdList(Long authorId,List<Long> marketIdList,
Integer orderby, Integer status, Pagination pagination) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("authorId", authorId);
map.put("isDelete", false);
map.put("marketIdList", marketIdList);
map.put("orderStr", "这里你组装你的order字符串");
map.put("statusStr","这里你组装你的status字符串");
map.put("begin", pagination.getOffset());
map.put("max", pagination.getPageSize());
//这个getTopicCount()方法和getTopics()大体是一致的,所以我的dao里面省略了它
Long total = topicDao.getTopicCount(map);
if (total == 0) {
return new ArrayList<Topic>();
} else {
pagination.setTotal(total);
List<Topic> res = topicDao.getTopics(map);
return res;
}
}
public List<Topic> getTopicsByMarketIdList(Long authorId,List<Long> marketIdList,
Integer orderby, Integer status, Pagination pagination) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("authorId", authorId);
map.put("isDelete", false);
map.put("marketIdList", marketIdList);
map.put("orderStr", "这里你组装你的order字符串");
map.put("statusStr","这里你组装你的status字符串");
map.put("begin", pagination.getOffset());
map.put("max", pagination.getPageSize());
//这个getTopicCount()方法和getTopics()大体是一致的,所以我的dao里面省略了它
Long total = topicDao.getTopicCount(map);
if (total == 0) {
return new ArrayList<Topic>();
} else {
pagination.setTotal(total);
List<Topic> res = topicDao.getTopics(map);
return res;
}
} Java代码
public class Topic extends BaseObject implements Serializable {
/**
*
*/
private static final long serialVersionUID = -851973667810710701L;
private Long id;
private Long authorId;
private String authorName;
private Long marketId;
private String title;
private String tags;
private String content;
private Date pubdate;
private Integer isBest;
private Integer status;
private Integer isDelete;
private Integer clickCount;
private Integer replyCount;
private Date lastReplyTime;
//getter and setter 省略...
}
public class Topic extends BaseObject implements Serializable {
/**
*
*/
private static final long serialVersionUID = -851973667810710701L;
private Long id;
private Long authorId;
private String authorName;
private Long marketId;
private String title;
private String tags;
private String content;
private Date pubdate;
private Integer isBest;
private Integer status;
private Integer isDelete;
private Integer clickCount;
private Integer replyCount;
private Date lastReplyTime;
//getter and setter 省略...
}Pagination代码:
Java代码
public class Pagination {
/**
* 要查看的页码
*/
private int page;
/**
* 每页显示数
*/
private int pageSize;
/**
* 一共有多少页
*/
private int totalPage;
/**
* 一共有多少条记录
*/
private long total;
/**
* 当前页的记录数
*/
private int size;
/**
* 只需要topxx,不需要页数信息了
*/
private boolean topOnly;
/**
*从第几条记录开始
*/
private int offset;
public void setOffset(int offset) {
this.offset = offset;
}
public Pagination(int page, int pageSize) {
this.page = page;
this.pageSize = pageSize;
}
public Pagination() {
}
public boolean require() {
return pageSize > 0 ? true : false;
}
public int from() {
return page * pageSize;
}
public int to() {
return from() + size;
}
public int getPage() {
return page;
}
public void setPage(int page) {
this.page = page;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public long getTotal() {
return total;
}
public void setTotal(long total) {
this.total = total;
if (pageSize > 0) {
this.totalPage = (int) Math.ceil(total / (double) pageSize);
} else {
this.totalPage = 1;
}
if (page >= totalPage) {
page = totalPage - 1;
}
if (page < 0)
page = 0;
if (pageSize > 0) {
if (page < totalPage - 1)
this.size = pageSize;
else
this.size = (int) (total % pageSize);
} else {
this.size = (int) total;
}
offset=page * pageSize;
}
public int getOffset() {
return offset;
}
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
public boolean isTopOnly() {
return topOnly;
}
public void setTopOnly(boolean topOnly) {
this.topOnly = topOnly;
}
}
相关推荐
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
广东省关于人工智能赋能千行百业的若干措施.docx
湖北省数据条例(草案)(征求意见稿).docx
中软国际IT培训中心的培训教程,属于学习CSS网页设计的基础入门教程,讲一些原理和概念,高深的理论不太多。
Python Data Structures and Algorithms Minimal and clean example implementations of data structures and algorithms in Python 3. Contribute Thank you for your interest in contributing! There are many ways to contribute to the project. Start testing from here Take note when running all tests using unittest $ python3 -m unittest discover tests To run some specific tests you can do the following (e.g. sort) $ python3 -m unittest tests.test_sort Run all tests using pytest Make a note when $ python3 -m
TeamIDE-win-2.6.31Team IDE 集成MySql、Oracle、金仓、达梦、神通等数据库、SSH、FTP、Redis、Zookeeper、Kafka、Elasticsearch、M
内容概要:本文综述了C、C++、Python、Java这四种主流编程语言中,用于实现常见和高级算法的学习资料,覆盖范围广泛,从书籍、在线课程平台到GitHub上的开源代码仓库均有提及。每种语言都详述了推荐的学习资源及其优势,旨在满足不同程度学习者的需要。 适合人群:对算法实现有兴趣的学生、自学爱好者、开发者等。 使用场景及目标:帮助读者挑选合适的语言和资源深入理解算法的理论与实际编码技巧,适用于个人提升、项目实践或教学使用。 其他说明:文章提供了丰富的学习渠道和实战项目,既适合作为基础理论的学习,也适合于实际操作练习,尤其强调通过实做加深理解的重要性。
aiuiphone0000000000000000000
支持多场景回调开箱即用 原生仿百度登录验证.zip
2023 年“泰迪杯”数据分析技能赛B题-企业财务数据分析与造假识别 完整代码
Levenshtein Python C 扩展模块包含用于快速计算 Levenshtein 距离和字符串相似度的函数内容需要维护者介绍文档执照历史源代码作者需要维护者我 (Mikko Ohtamaa) 目前不维护此代码。我只是为了方便起见才将其拉到 Github 上的(之前在公共存储库中不可用)。因此,如果您提交了任何问题,我都不会调查。介绍Levenshtein Python C 扩展模块包含用于快速计算的函数Levenshtein(编辑)距离和编辑操作字符串相似度近似中位数字符串,以及一般字符串平均值字符串序列和集合相似度它同时支持普通字符串和 Unicode 字符串。需要 Python 2.2 或更新版本。StringMatcher.py 是一个基于 Levenshtein 构建的类似 SequenceMatcher 的示例类。它缺少一些 SequenceMatcher 的功能,但又有一些额外的功能。Levenshtein.c 也可以用作纯 C 库。您只需在编译时定义 NO_PYTHON 预处理器符号 (-DNO_PYTH
基于OpenCV像素检测的Onmyoji游戏脚本
Pythonbot高斯网格图射线投射网格图激光雷达至网格地图k-均值对象聚类矩形接头大满贯迭代最近点 (ICP) 匹配FastSLAM 1.0路径规划动态窗口方法基于网格的搜索Dijkstra 算法A* 算法D*算法D* Lite 算法位场算法基于网格的覆盖路径规划国家网格规划偏极采样车道采样概率路线图(PRM)规划快速探索随机树(RRT)回程时间*RRT* 和 reeds-shepp 路径LQR-RRT*五次多项式规划Reeds Shepp 规划基于LQR的路径规划Frenet 框架中的最佳轨迹路径追踪移动到姿势控制斯坦利控制后轮反馈控制线性二次调节器 (LQR) 速度和转向控制模型预测速度和转向控制采用 C-GMRES 的非线性模型预测控制手臂导航N关节臂对点控制带避障功能的手臂导航航空导航无人机三维轨迹跟踪火箭动力着陆双足动物倒立摆双
可信任的企业4.0生态系统.pptx
学生信息包括:学号,姓名,年龄,性别,出生年月,地址,电话,E-mail等。试设计一学生信息管理系统,系统提供菜单方式作为人机界面并具有如下功能: 学生信息录入功能 学生信息浏览功能 按学号、姓名等进行查询、排序功能 2、要求界面简单明了;对输入的数据具有有效性检查能力,比如输入的成绩不在0~100之间,要求重新输入;
原生js谷歌网页电吉他弹奏源码.rar
原生js微信分享到朋友圈浮动层代码.zip
第7章 聚类算法 - 作业 - 副本.ipynb
AICon 2024全球人工智能开发与应用大会(脱敏)PPT合集,共30份。 AI辅助编程测评与企业实践 SmartEV和AI 蔚来的思考与实践 下一代 RAG 引擎的技术挑战与实现 书生万象大模型的技术演进与应用探索 人工智能行业数据集构建及模型训练方法实践周华 全方位评测神经网络模型的基础能力 千亿参数 LLM 的训练效率优化 向量化与文档解析技术加速大模型RAG应用落地 基于大模型的缺陷静态检查 多环境下的 LLM Agent 应用与增强 大模型在华为推荐场景中的探索和应用 大模型在推荐系统中的落地实践 大模型的异构计算和加速 大模型辅助需求代码开发 大语言模型在法律领域的应用探索 大语言模型在计算机视觉领域的应用 大语言模型的幻觉检测 小米大模型端侧部署落地探索 快手可图大模型的技术演进与应用探索 提升大模型知识密度,做高效的终端智能 电商大模型及搜索应用实践 百度大模型 原生安全构建之路 硅基流动高性能低成本的大模型推理云实践 语言模型驱动的软件工具思考:可解释与可溯源 长文本大模型推理实践:以 KVCache 为中心的分离式推理架构 阿里云 AI 搜索 RAG 大模型优