首页 > 代码库 > Mybatis Mapper.xml 需要查询返回List<String>
Mybatis Mapper.xml 需要查询返回List<String>
<?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 需要查询返回List<String>
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。