jsp,xml中el表达式等占位符中的数据操作

jsp,xml中el表达式等占位符中的数据操作

表达式中可以用传入参数对象具备的一切属性,函数

 

.xml中

@Column(name="ROLES_KEY")表示也map当前结果集对应的

private String rolesKey;

 

@Transient,表示不需要结果集中有

 

 

在mapper.xml中的表达式中可以用传入参数对象具备的一切属性函数

 

 

 

<select id="getCustomerBankMap1" parameterType="map" resultMap="accountMap">

SELECT T.*,B.BANK_NAME,B.BANK_LOGO

FROM TB_CUS_ACC_INFO T,TB_CUS_BANK B

WHERE T.SIGN_ACCOUNT_BANK=B.BANK_CODE

<if test="customerKey!=null and customerKey!=''">

AND T.CUSTOMER_KEY=#{customerKey}

</if>

<if test="noMarketMark!=null and noMarketMark=='true'.toString()">

AND T.SIGN_ACCOUNT_BANK<![CDATA[<>]]>'000'

</if>

<if test="sign_account_banklist_in!=null and sign_account_banklist_in.size>0">

AND T.SIGN_ACCOUNT_BANK in(

<foreach collection="sign_account_banklist_in" item="item" separator=",">

#{item}

</foreach>

)

</if>

<if test="bankCode!=null and bankCode!=''">

AND T.SIGN_ACCOUNT_BANK =#{bankCode}

</if>

<if test="customerSonKey!=null">

AND T.CUSTOMER_SON_KEY=#{customerSonKey}

</if>

ORDER BY T.ACCOUNT_ID

</select>

 

在jsp中需要引入jstl函数

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 

不仅仅是jstl标签

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

 

${fn:length(item.man)>8} fn:length()就是一个函数

 

<c:forEach items="${list}" var="item">

   <tr>

      <td class="cblue pr5 pl5">

      <a href="javascript:void(0);" οnclick="window.location.href='${path}/operateUserAction!view.do?key=${item.cusUserKey}'">${item.cusUserId}</a>

      </td>

      <td class="pr5 pl5" title="${item.man}">

           <c:choose>

             <c:when test="${fn:length(item.man)>8}">

               ${item.man.substring(0,1)}

             </c:when>

             <c:otherwise>

                ${item.man}

             </c:otherwise>

           </c:choose>

      </td>

      <td class="pr5 pl5">

          ${item.phoneCountryCode}  ${item.tel} 

  </td>

  <td class="pl5">

     ${item.email}

  </td>

      <td class="cred pr5">

      <c:if test="${item.cusUserStatus=='B'}">冻结</c:if>

      <c:if test="${item.cusUserStatus=='A'}">正常</c:if>

  </td>

      <td style="width: 50%;">

      <a class="cblue" href="operateUserAction!editUI.do?key=${item.cusUserKey}">编辑</a>

      <c:if test="${item.cusUserStatus=='A'}">

      <a class="cblue" href="javascript:updateStatus('${item.cusUserKey}','B','${item.cusUserId}');">冻结</a>

      </c:if>

      <c:if test="${item.cusUserStatus=='B'}">

      <a class="cblue" href="javascript:updateStatus('${item.cusUserKey}','A','${item.cusUserId}');">解冻</a>

      </c:if>

      <a class="cblue" href="operateUserAction!editOperateUserPwdUI.do?key=${item.cusUserKey}">修改密码</a>

      </td>

    </tr>

   </c:forEach>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值