• 常用SQL语句写法(一)


    <resultMap id="userResult" type="com.cloudwalk.shark.model.User">
    <id property="id" column="ID" jdbcType="INTEGER"></id>
    <result property="userName" column="user_name" jdbcType="VARCHAR"></result>
    </resultMap>

    <insert id="insertUser" parameterType="com.cloudwalk.shark.model.User">
    INSERT INTO
    t_shark_user(ID,USER_NAME)
    VALUES
    (
    #{id},#{userName}
    )
    </insert>

    <select id="findUserByName" parameterType="java.lang.String" resultMap="userResult">
    select id,user_name as userName from t_shark_user
    where 1=1
    <if test=" _parameter !=null and _parameter !='' " >
    and user_name = #{name,jdbcType=VARCHAR}
    </if>
    </select>

    <select id="queryUserByName" parameterType="java.util.ArrayList" resultMap="userResult">
    select id,user_name as userName from t_shark_user
    where user_name in
    <if test=" list !=null and list.size>0 !='' " >
    <foreach collection="list" item="userName" index="index" open="(" close=")" separator=",">
    #{userName}
    </foreach>
    </if>
    </select>
  • 相关阅读:
    随机色块
    JQ命令汇总
    JQ选择器
    cookie
    tab切换
    Ajax跨域
    RocksDB介绍:一个比LevelDB更彪悍的引擎
    谷歌的诀窍:如何取消验证码
    Ruby on Rails创始人DHH谈如何进行混合移动APP开发
    SequoiaDB 架构指南
  • 原文地址:https://www.cnblogs.com/longxok/p/10834068.html
Copyright © 2020-2023  润新知