首页 > 学院 > 开发设计 > 正文

关于Sql语句硬编码的问题(求助)

2019-11-08 01:17:11
字体:
来源:转载
供稿:网友

举个例子

 <resultMap='result' namespace="cn.test.UserMapper" >

<select  id="queryAllUserById" resultMap='result''  parameterType="cn.test.User">

<id column="ID" PRoperty="id" jdbcType="NUMERIC" />    <result column="USERNAME" property="username" jdbcType="VARCHAR" />    <result column="PASSWord" property="password" jdbcType="VARCHAR" />

   <result column="IS_DELETED" property="isDeleted" jdbcType="VARCHAR" />

     select

    <if test="distinct" >      distinct    </if>    <include refid="List" />

    from USER        <if test="valid" >      and is_deleted = 'n'    </if>

就是这边sql中 and is_deleted = 'n'中写死了,有什么办法可以解决


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表