Mybatis mapper.xml need query return list<string>

Source: Internet
Author: User

<?xml version= "1.0" encoding= "UTF-8"? ><! DOCTYPE Mapper Public "-//mybatis.org//dtd mapper 3.0//en" "Http://mybatis.org/dtd/mybatis-3-mapper.dtd" >< Mapper namespace= "Com.xinwei.process.dao.RoleServiceTypeMapper" > <resultmap id= "baseresultmap" type= " Com.xinwei.process.entity.RoleServiceType "> <id column=" id "property=" id "jdbctype=" BIGINT "/> <result Column= "role_id" property= "Roleid" jdbctype= "INTEGER"/> <result column= "Service_type" property= "ServiceType" Jdbctype= "VARCHAR"/> </resultMap> <delete id= "Deletebyprimarykey" parametertype= "Java.lang.Long" >Delete from Tb_role_service_type where ID= #{id,jdbctype=BIGINT}</delete> <insert id= "Insert" parametertype= "Com.xinwei.process.entity.RoleServiceType" >INSERT into Tb_role_service_type (ID, role_id, service_type) VALUES (#{id,jdbctype=bigint}, #{roleid,jdbctype=integer}, #{servicetype,jdbctype=VARCHAR}) </insert> <update id= "Updatebyprimarykey" parametertype= "Com.xinwei.process.entity.RoleServiceType" >Update Tb_role_service_type Set role_id= #{roleid,jdbctype=INTEGER}, Service_type= #{servicetype,jdbctype=VARCHAR} where ID= #{id,jdbctype=BIGINT}</update> <select id= "Selectbyprimarykey" resultmap= "Baseresultmap" parametertype= "Java.lang.Long" >Select ID, role_id, service_type from Tb_role_service_type where ID= #{id,jdbctype=BIGINT}</select> <select id= "SelectAll" resultmap= "Baseresultmap" >Select ID, role_id, service_type from Tb_role_service_type</select>


<select id= "Selectservicetypelistbyrole" resulttype= "java.lang.String" >
Select Service_type
From Tb_role_service_type
where role_id = #{roleid,jdbctype=integer}
</select>


</mapper>


Mybatis mapper.xml need query return list<string>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.