zoukankan      html  css  js  c++  java
  • 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>


  • 相关阅读:
    jQuery之$().each和$.each的区别(转)
    js获取非行间样式--有bug,忧伤
    js之数组方法
    js之检测对象类型
    for-in枚举对象属性
    jq 处理select 下拉框
    阿里大鱼短信发送服务应用实例(PHP SDK)
    php RSA 非对称加解密实例
    JS HTML table 生成 Excel文件
    php RSA 加解密实例
  • 原文地址:https://www.cnblogs.com/alamps/p/6442493.html
Copyright © 2011-2022 走看看