MMS项目积累

来源:互联网 发布:linux mint和ubuntu 编辑:程序博客网 时间:2024/06/14 12:29
1、mybatis1)in语句<if test="null !=status and ''!=status">    and sout.status in    <foreach item="item" index="index" collection="status" open="(" separator="," close=")">         #{item}     </foreach></if>2)动态update<update id="updateIvtBackDetail">    update inventory_back_detail    <trim prefix="set" suffixOverrides=",">        <if test="null != brandName">            brandName =#{brandName}        </if>        <if test="null != backTotal">            backTotal = #{backTotal}        </if>    </trim>    where detailId = #{detailId}</update>

2、jquery1) 去掉小数点后面多余的0    var a=23.8000    alert(parseFloat(a))  //结果:23.82) 保留两位小数    toFixed(2)3) 获取Select选择的Text    var checkText=$("#select_id").find("option:selected").text();3、jqgrid1) 重新载入jQuery(grid_selector).jqGrid('setGridParam', {    url : UrlConfig.projectList,    datatype : 'json',    postData: data,    page : 1}).trigger('reloadGrid');// 重新载入2) 获取选中的数据var ids = jQuery(grid_selector).jqGrid('getGridParam', 'selarrrow');var planResourceId = jQuery(grid_selector).jqGrid('getGridParam', 'selrow');3) 获取所有数据var obj = jQuery('#grid-pc-price').jqGrid("getRowData");var obj = jQuery(grid_selector).jqGrid("getRowData", ids[0]);4) 获取当前页数var page = $(grid_selector).getGridParam('page');5) 多选改为单选onSelectRow: function (id) {// 单选    $this = $(this);    if (ids.length<=0)        ids = $this.jqGrid('getGridParam', 'selarrrow');    if (id && ids.length > 1) {        $.each(ids, function (i,v) {            if (v != id)                $this.jqGrid('setSelection',v);        });    }    return true;}

0 0