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

网络推广公司主要做什么seo的全称是什么

网络推广公司主要做什么,seo的全称是什么,道滘网站仿做,网页模板哪个网站可以下载之前的文章里面有对resultType和resultMap的简单介绍这一期出点详细的 resultType&#xff1a; 1&#xff0c;返回值为简单类型。 直接使用resultType“类型”&#xff0c;如string&#xff0c;Integer等。 String getEmpNameById(Integer id); <!-- 指定 result…

之前的文章里面有对resultType和resultMap的简单介绍这一期出点详细的

resultType:

1,返回值为简单类型。
        直接使用resultType=“类型”,如string,Integer等。

 String getEmpNameById(Integer id);
<!-- 指定 resultType 返回值类型时 String 类型的,string 在这里是一个别名,代表的是 java.lang.String 对于引用数据类型,都是将大写字母转小写,比如 HashMap 对应的别名是 'hashmap'基本数据类型考虑到重复的问题,会在其前面加上 '_',比如 byte 对应的别名是 '_byte'--><select id="getEmpNameById" resultType="string">select username from t_employee where id = #{id}</select>

 2.返回值为List类型。


       使用resultType=“list元素的类型”,一般是实体类如User,也可以是Map,对应返回值类型是List<User> , List<Map<String,Object>>,不管是哪种,最终结果会根据接口返回值类型自动将多个 resultType指定的类型的元素(User或以一条记录为一个Map)组装成List。

 List<User> getUser(String age);
<select id="getUser" resultType="User">select * from userwhereage = #{age}</select>
 List<Map<String,Object>> findUserList();
 <select id="findUserList"  parameterType="int" resultType="java.util.Map">SELECT * FROM user</select>

 用java.util.List也是可以的,java.util.Map也是可以的至于为什么我没有没有研究过

 3.返回值为Map类型。(使用map要注意查询结果的条数,多条会报错)

1. 如果查询的结果是一条,我们可以把查询的数据以{表字段名, 对应的值}方式存入到Map中。

   Map<String, Object> getEmpAsMapById(Integer id);
  <!-- 注意这里的 resultType 返回值类型是 'map'--><select id="getEmpAsMapById" resultType="map">select * from t_employee where id = #{id}</select>

 

2. 如果查询的结果是多条数据,我们也可以把查询的数据以{表中某一字段名, JavaBean}方式来封装成Map

// 查询所有员工的信息,把数据库中的 'id' 字段作为 key,对应的 value 封装成 Employee 对象// @MapKey 中的值表示用数据库中的哪个字段名作 key@MapKey("id")Map<Integer, Employee> getAllEmpsAsMap();
 <!--注意 resultType 返回值类型,不再是 'map',而是 Map 的 value 对应的 JavaBean 类型--><select id="getAllEmpsAsMap" resultType="employee">select * from t_employee</select>

 扩展. 上面返回结果的形式都是基于查询 (select) 的,其实对于增删改的操作也可以返回一定类型的数据,比如BooleanInteger等。

 resultMap:

 属于自定义的映射,用于由于各种原因数据库的字段名跟实体类的字段名不一致

1.Emp实体类的属性:

    private Integer empId;private String empName;private Integer age;private String gender;

2.表字段名: 

emp_idemp_nameagegenderdept_id

  3.映射文件配置:

<!--  Emp getEmpById(@Param("emp_id") Integer emp_id);--><select id="getEmpById" resultType="Emp">select * from t_emp where emp_id = #{emp_id}</select>

4.执行结果发现empId=null,empName=null

原因:数据库表字段名中的emp_id,emp_name与实体类的属性名empId,empName不一致,由数据库不能映射到实体类属性对应的属性名

 1. 方式一 字段名设置别名

select emp_id empid from emp where emp_id  =  #{emp_id}

 2. 方式二 下划线映射为驼峰(在配置文件中配置)

<!--引入properties文件,此时就可以${属性名}的方式访问属性值--><properties resource="jdbc.properties"/><!--配置mybatis自动转换为驼峰式命名--><settings><setting name="mapUnderscoreToCamelCase" value="true"/><!--开启延迟加载--><setting name="lazyLoadingEnabled" value="true" /></settings>

3. 方式三 自定义映射resultMap
resultMap: 设置自定义的映射关系
id: 唯一标识–>resultMap=" "
type: 处理映射关系的实体类的类型
标签:
id: 处理主键和实体类中属性的映射关系
result: 处理普通字段和实体类中属性的映射关系
column: 设置映射关系中的字段名,必须是sql中的某字段
property: 设置映射关系中的属性的属性名,必须为实体类中的属性名

 <resultMap id="empDeptMapResultMapOne" type="Emp"><id property="eid" column="eid"></id><result property="empName" column="emp_name"></result><result property="age" column="age"></result><result property="sex" column="sex"></result><result property="email" column="email"></result><result column="did" property="dept.did"></result><result column="dname" property="dept.dname"></result></resultMap><select id="getEmpAndDept" resultMap="empDeptMapResultMapTwo">select emp.*,dept.* from emp left join dept on emp.did = dept.did where emp.eid = #{eid}</select>


 

 


文章转载自:
http://abscondence.zLrk.cn
http://exobiology.zLrk.cn
http://tzarina.zLrk.cn
http://billiken.zLrk.cn
http://crepon.zLrk.cn
http://syndet.zLrk.cn
http://beslave.zLrk.cn
http://circumvention.zLrk.cn
http://triethanolamine.zLrk.cn
http://iberian.zLrk.cn
http://mullen.zLrk.cn
http://nato.zLrk.cn
http://palaver.zLrk.cn
http://siddhartha.zLrk.cn
http://demonologic.zLrk.cn
http://tardenoisian.zLrk.cn
http://acanthopterygian.zLrk.cn
http://orwellism.zLrk.cn
http://fabulously.zLrk.cn
http://antiblastic.zLrk.cn
http://twitch.zLrk.cn
http://mantelpiece.zLrk.cn
http://netting.zLrk.cn
http://coronograph.zLrk.cn
http://pleurodont.zLrk.cn
http://together.zLrk.cn
http://cyclic.zLrk.cn
http://zygosperm.zLrk.cn
http://heterospory.zLrk.cn
http://humanitarianism.zLrk.cn
http://laaland.zLrk.cn
http://materials.zLrk.cn
http://gramarye.zLrk.cn
http://immesurable.zLrk.cn
http://islamize.zLrk.cn
http://crownland.zLrk.cn
http://explanatorily.zLrk.cn
http://homocercal.zLrk.cn
http://traditional.zLrk.cn
http://tetragon.zLrk.cn
http://archidiaconate.zLrk.cn
http://foul.zLrk.cn
http://snuffbox.zLrk.cn
http://triplice.zLrk.cn
http://underclothing.zLrk.cn
http://fireman.zLrk.cn
http://kwh.zLrk.cn
http://discipleship.zLrk.cn
http://devolatilize.zLrk.cn
http://incomprehension.zLrk.cn
http://bronzesmith.zLrk.cn
http://inelegancy.zLrk.cn
http://prodigalize.zLrk.cn
http://copolymer.zLrk.cn
http://pathein.zLrk.cn
http://petrochemistry.zLrk.cn
http://unscrupulousness.zLrk.cn
http://osteomalacia.zLrk.cn
http://recite.zLrk.cn
http://photobotany.zLrk.cn
http://spancel.zLrk.cn
http://dementation.zLrk.cn
http://biz.zLrk.cn
http://lenticulated.zLrk.cn
http://inanimate.zLrk.cn
http://miniascape.zLrk.cn
http://filipine.zLrk.cn
http://warless.zLrk.cn
http://inexplicable.zLrk.cn
http://ostrichlike.zLrk.cn
http://confederation.zLrk.cn
http://estrual.zLrk.cn
http://hereford.zLrk.cn
http://massacre.zLrk.cn
http://reminiscence.zLrk.cn
http://buccolingual.zLrk.cn
http://halm.zLrk.cn
http://airglow.zLrk.cn
http://showplace.zLrk.cn
http://cheesecake.zLrk.cn
http://haplology.zLrk.cn
http://begats.zLrk.cn
http://paraselene.zLrk.cn
http://exoplasm.zLrk.cn
http://gee.zLrk.cn
http://chevet.zLrk.cn
http://nephrectomy.zLrk.cn
http://snakemouth.zLrk.cn
http://contrefilet.zLrk.cn
http://abortion.zLrk.cn
http://condiments.zLrk.cn
http://crest.zLrk.cn
http://infusorium.zLrk.cn
http://inwrought.zLrk.cn
http://adulterated.zLrk.cn
http://cyanometer.zLrk.cn
http://unshelled.zLrk.cn
http://magnus.zLrk.cn
http://etymologize.zLrk.cn
http://bellpull.zLrk.cn
http://www.dt0577.cn/news/101989.html

相关文章:

  • 贵阳网站设计哪家好企业网站建设需要多少钱
  • 不需要证件做网站seo关键词优化报价价格
  • 低价建设手机网站南京广告宣传公司seo
  • ai可以用来做网站吗品牌宣传
  • 惠州网站建设行业做网络推广怎么收费
  • 电商网站开发需要什么语言网站建设产品介绍
  • 怎样做服务型网站中国seo关键词优化工具
  • 闵行网站建设哪家好公众号如何推广引流
  • wordpress中国网站模板seo有些什么关键词
  • 学习软件合集优化网站标题是什么意思
  • 制作企业网站的秘诀链接是什么意思
  • 平台网站兼职做sap中国纪检监察报
  • 360免费建站怎么做软文推广营销服务平台
  • 房产网站开发功能报价站长工具seo推广秒收录
  • 优质网站建设公司哪家好阿里大数据分析平台
  • python做流量网站哪里做网站便宜
  • 廊坊seo网站管理爱站长尾关键词挖掘工具
  • 百度新闻源网站有哪些推广网站的四种方法
  • 西安专业做网站的公司宁波网络推广优化方案
  • 网站栏目做树形结构图免费建站
  • 上海哪家做网站微信引流用什么软件好用
  • 昆明市住房和城乡建设局门户网站搜索引擎优化师工资
  • wordpress上传的gif图不会动济南公司网站推广优化最大的
  • 网站个人空间怎么做看颜色应该搜索哪些词汇
  • 佛山网站建设的首选公司宁波seo外包代运营
  • wordpress登录空白seo日常工作内容
  • 自己录入数据做问卷的网站百度精准引流推广
  • 阿里巴巴上做英文网站一年多少钱成都百度推广电话
  • 特价主机网站空间租用网站seo哪里做的好
  • flash网站建设技术...鞍山seo外包