当前位置: 首页 > news >正文

公众号主要是干嘛的台州seo网站排名优化

公众号主要是干嘛的,台州seo网站排名优化,com网站免费注册,快递物流网站建设开发具备哪些功能if标签 用于判断条件是否成立。使用test属性进行条件判断&#xff0c;如果条件为true&#xff0c;则拼接sql。 <where>标签用于识别语句是否需要连接词and&#xff0c;识别sql语句。 package com.t0.maybatisc.mapper;import com.t0.maybatisc.pojo.Emp; import org.a…

if标签

用于判断条件是否成立。使用test属性进行条件判断,如果条件为true,则拼接sql。

<where>标签用于识别语句是否需要连接词and,识别sql语句。

package com.t0.maybatisc.mapper;import com.t0.maybatisc.pojo.Emp;
import org.apache.ibatis.annotations.*;import java.time.LocalDate;
import java.util.List;@Mapper
public interface EmpMapper {
//    条件查询public List<Emp> list( String name,  Short gender,  LocalDate begin,  LocalDate end);}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.t0.maybatisc.mapper.EmpMapper"><select id="list" resultType="com.t0.maybatisc.pojo.Emp">select * from emp<where><if test="name != null">name like concat('%',#{name},'%')</if><if test="gender != null">and gender = #{gender}</if><if test="begin != null and end != null">and entrydate between #{begin} and #{end}</if></where>order by update_time desc</select>
</mapper>
//    根据条件查询@Testpublic void list(){
//        List<Emp> empList =empMapper.list("张",(short) 1,LocalDate.of(2010,01,01),LocalDate.of(2020,01,01));List<Emp> empList =empMapper.list(null,(short)1,null,null);System.out.println(empList);}
}

用于select、upgrade。

foreach标签

package com.t0.maybatisc.mapper;import com.t0.maybatisc.pojo.Emp;
import org.apache.ibatis.annotations.*;import java.time.LocalDate;
import java.util.List;@Mapper
public interface EmpMapper {
//    多条删除public  void deleteByids(List<Integer> ids);}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.t0.maybatisc.mapper.EmpMapper"><select id="deleteByids" resultType="com.t0.maybatisc.pojo.Emp">delete from emp where id in<foreach collection="ids" item="id" separator="," open="(" close=")">#{id}</foreach></select></mapper>

collection="ids" item="id" separator="," open="(" close=")"

    @Testpublic void TestdeleteByids(){List<Integer> ids = Arrays.asList(19,18,16);empMapper.deleteByids(ids);}

sql和include

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapperPUBLIC "-//mybatis.org//DTD Mapper 3.0//EN""https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.t0.maybatisc.mapper.EmpMapper"><sql id="commonS">select id,username,password,name,gender,image,job,entrydate,dept_id,create_time,update_timefrom emp</sql><select id="list" resultType="com.t0.maybatisc.pojo.Emp"><include refid="commonS"></include><where><if test="name != null">name like concat('%',#{name},'%')</if><if test="gender != null">and gender = #{gender}</if><if test="begin != null and end != null">and entrydate between #{begin} and #{end}</if></where>order by update_time desc</select>
</mapper>

 

http://www.yayakq.cn/news/268321/

相关文章:

  • 公司电商网站建设费用怎么记账wordpress 房产模板
  • 网站底部版权信息模板龙岗 网站建设
  • 青岛东橙网站建设2022最新永久地域网名
  • 乌市网站建设为郑东新区网站开发
  • dede电影网站模板网页动态效果
  • 揭阳专业的网站建设价格wordpress mu常见问题解答
  • 贵阳市 网站建设网站栏目建设评活动
  • html5响应式网站开发专业做网站+上海
  • 如何建设个人网站凡科怎么样wordpress 悬停遮罩
  • 淘客的手机网站wordpress 加迅雷地址
  • 公司网站怎么做教程网站建设基础教学设计
  • dw怎么做鲜花网站厦门学网站建设
  • 电子商务网站开发与管理实验报告自己搭建充值平台
  • 武隆网站建设费用wordpress 插马
  • 气球网站建设wordpress主题2019
  • 绍兴网站建设报价电商具体是做什么的
  • 装修网站建设方案书网站备案及管理的授权书
  • 厦门外贸网站北京做网站的人
  • 自动做网页的网站wordpress只换域名
  • 网站目录做301招聘类网站该怎么做
  • 博客建站程序wordpress建站百科
  • 大型网站建设地址网站建设哪个公司好
  • 集团网站群建设方案营销型网站建设设计6
  • 网站备案授权码长春市城乡建设部网站
  • 做网站的用多少钱帝国cms做企业网站
  • 学校网站如何做3d建模软件免费下载
  • 贵州省住房与城乡建设厅门户网站做网站一年能赚多少钱
  • 调用别人网站的数据库自己做网站赚钱案例
  • 购物网站建设公司网站建设j基本步骤
  • 周至做网站的公司三台县城乡建设网网站