mybatis 增删改查
2015-09-30 11:38
155 查看
<?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" > <insert id="insert" parameterType="com.form.baseinfo.industryinfo.tbl_bse_initfee_limit"> insert into tbl_bse_initfee_limit <trim prefix="(" suffixOverrides=","> <if test="record_id != null">record_id ,</if> <if test="mchnt_id != null">mchnt_id ,</if> <if test="card_type != null">card_type ,</if> <if test="req_date != null">req_date ,</if> <if test="req_time != null">req_time ,</if> <if test="limit_amt !=null">limit_amt ,</if> <if test="card_seq_rec_id !=null">card_seq_rec_id ,</if> <if test=" create_uid != null"> create_uid ,</if> <if test=" create_time!= null"> create_time,</if> </trim> ) values <trim prefix="(" suffixOverrides=","> <if test="record_id != null">#{record_id },</if> <if test="mchnt_id != null">#{mchnt_id},</if> <if test="card_type != null">#{card_type},</if> <if test="req_date != null">#{req_date},</if> <if test="req_time != null">#{req_time},</if> <if test="limit_amt !=null">#{limit_amt},</if> <if test="card_seq_rec_id !=null">#{card_seq_rec_id},</if> <if test=" create_uid != null">#{ create_uid },</if> <if test=" create_time!= null">#{ create_time},</if> </trim> ) </insert> <delete id="delete" parameterType="com.form.baseinfo.industryinfo.tbl_bse_initfee_limit"> delete from tbl_bse_initfee_limit where record_id=#{record_id} and mchnt_id=#{mchnt_id} </delete> <update id="update" parameterType="com.form.baseinfo.industryinfo.tbl_bse_initfee_limit"> update tbl_bse_initfee_limit <set> <if test="record_id != null">record_id=#{record_id },</if> <if test="mchnt_id != null">mchnt_id=#{mchnt_id},</if> <if test="card_type != null">card_type=#{card_type},</if> <if test="limit_amt !=null">limit_amt=#{limit_amt},</if> <if test="card_seq_rec_id !=null">card_seq_rec_id=#{card_seq_rec_id},</if> <if test="chk_st !=null">chk_st=#{chk_st},</if> <if test=" create_uid != null">create_uid=#{ create_uid },</if> <if test=" rec_upd_time != null">rec_upd_time=#{ rec_upd_time},</if> </set> where record_id=#{record_id} </update> <select id="select" parameterType="com.form.baseinfo.industryinfo.tbl_bse_initfee_limit" resultType="com.form.baseinfo.industryinfo.tbl_bse_initfee_limit"> <![CDATA[ select tt.*, d.dictvaluedesc as chk_stdesc, d1.dictvaluedesc as card_typedesc, d2.mchnt_name as mchnt_iddesc from ( ]]> select * from (select a.*,rownum as rn from ( select t.* from tbl_bse_initfee_limit t <where> <if test="record_id != null and record_id !='' "> t.record_id = #{record_id} </if> <if test="mchnt_id != null and mchnt_id !='' "> and t.mchnt_id=#{mchnt_id} </if> <if test="card_type != null and card_type !='' "> and t.card_type =#{card_type} </if> </where> ) a where #{to} >=rownum) b where b.rn >= #{from} ) tt left join dictinfotb d on tt.chk_st=d.dictvalue and d.dicttype=20010 and d.locale='zh_CN' left join dictinfotb d1 on tt.card_type=d1.dictvalue and d1.dicttype=20075 and d1.locale='zh_CN' left join tbl_bse_inf_mchnt d2 on tt.mchnt_id = d2.mchnt_id <if test="sortString != null"> order by req_date desc , req_time desc </if> </select> <!--无分页查询--> <select id="selectNoPage" parameterType="com.form.baseinfo.industryinfo.tbl_bse_initfee_limit" resultType="com.form.baseinfo.industryinfo.tbl_bse_initfee_limit"> <![CDATA[ select tt.*, d.dictvaluedesc as chk_stdesc, d1.dictvaluedesc as card_typedesc, d2.mchnt_name as mchnt_iddesc from ( ]]> select record_id, mchnt_id, card_type, (to_char(nvl(sum(limit_amt)/100,0),'fm9999999990.00')) as limit_amt, req_date, req_time, chk_st,card_seq_rec_id, create_uid,create_time,chk_uid,chk_time,rec_upd_time from tbl_bse_initfee_limit t group by record_id,mchnt_id, card_type,req_date,req_time,chk_st,card_seq_rec_id,create_uid,create_time,chk_uid,chk_time,rec_upd_time order by req_date desc,req_time desc <where> <if test="record_id != null and record_id !='' "> t.record_id = #{record_id} </if> <if test="mchnt_id != null and mchnt_id !='' "> and t.mchnt_id=#{mchnt_id} </if> <if test="card_type != null and card_type !='' "> and t.card_type =#{card_type} </if> </where> ) tt left join dictinfotb d on tt.chk_st=d.dictvalue and d.dicttype=20010 and d.locale='zh_CN' left join dictinfotb d1 on tt.card_type=d1.dictvalue and d1.dicttype=20075 and d1.locale='zh_CN' left join tbl_bse_inf_mchnt d2 on tt.mchnt_id = d2.mchnt_id </select> <select id="selectCount" parameterType="com.form.batch.tbl_bat_run_log" resultType="java.lang.Integer"> select count(1) from tbl_bat_run_log t <where> <if test="rec_id != null and rec_id !='' "> and t.rec_id=#{rec_id} </if> <if test="settleDateStart !=null and settleDateStart !='' "> <![CDATA[and settle_Date>=#{settleDateStart}]]> </if> <if test="settleDateEnd !=null and settleDateEnd !='' "> <![CDATA[and settle_Date<=#{settleDateEnd}]]> </if> <if test="run_result != null and run_result !='' "> and t.run_result=#{run_result} </if> </where> </select>
相关文章推荐
- 激励机制之餐饮业
- 代码规范工具-Checkstyle使用手册
- linux命令eval
- LNMP笔记:更改网站文件和MySQL数据库的存放目录
- sqlServer 取每组的前几条数据
- 动态规划——最长公共子序列
- hdu 5481||bestcoder #57 div 2 C Desiderium ()
- Python中列表、元组、字典的异同
- spring集成redis cluster
- mysql命令行查看表结构,字段等信息 [mysql]
- 分库分表实践
- FindBugs插件的安装与使用
- 收集整理ASP.NET中17种常用正则表达式
- UGUI基本概念 (待续)
- C# HTTP状态码
- Binary Tree Postorder Traversal
- 数组相关的处理方法
- MVP模式学习
- 算法导论 文章12章 二叉搜索树
- 个人博客作业Week3(微软必应词典客户端的案例分析)