蔡香满屋
站在牛顿头上吃苹果

今天才发现oracle中通过查询过程使用的别名是否使用双引号引起来的区别。

第一种:

<!-- 查询学年学期下拉框 -->
    <select id="findAcadyeartermNames" resultType="map">
	SELECT t.XNXQ_ID as "semesterId", t.XNXQ as "semester", t.XN as "semesterYear" 
      FROM T_SJZY_XNXQXX t ORDER BY t.XNXQ ASC </select>

  上面是有引号的情况下通过接口请求到的结果是对象的属性是小写字母:

{"code":200,"data":[{"semester":"2017-2018-1","semesterId":"1039820725681954816","semesterYear":"2017-2018"},{"semester":"2017-2018-2","semesterId":"1039820823275020288","semesterYear":"2017-2018"}]}

 第二种情况:

<!-- 查询学年学期下拉框 -->
    <select id="findAcadyeartermNames" resultType="map">
	SELECT t.XNXQ_ID as semesterId, t.XNXQ as semester, t.XN as semesterYear
      FROM T_SJZY_XNXQXX t  
	  ORDER BY t.XNXQ ASC
    </select>

  没有引号的情况下通过请求到的结果是对象的属性是大写字母:

{"code":200,"data":[{"SEMETER":"2017-2018-1","SEMETERID":"1039820725681954816","SEMESTERYEAR":"2017-2018"},{"SEMETER":"2017-2018-2","SEMETERID":"1039820823275020288","SEMESTERYEAR":"2017-2018"}]}

  

 

posted on 2018-09-13 11:14  蔡香满屋  阅读(6745)  评论(0)    收藏  举报