maven +springmvc +mybatis +easyui的管理系统界面设计

来源:互联网 发布:mysql inner join on 编辑:程序博客网 时间:2024/05/07 17:28

这里写图片描述

左侧是一个菜单树
这里写图片描述
系统管理:

模块管理:
这里写图片描述

字典管理:
这里写图片描述

角色管理:
这里写图片描述
系统日志管理
这里写图片描述
基础数据维护>>基础数据
包括机构、商户、商户服务费、黑名单等表的增删改查,导出excel
这里写图片描述

查询(多条件):
这里写图片描述
添加:
这里写图片描述
修改:
这里写图片描述
导出(能支持更加查询条件进行导出,导出的excel样式和查询的一样,不加分页,支持2007,1997-2003)

二、部分数据库表的设计
用户管理设计:
这里写图片描述

数据字典表:
这里写图片描述
角色管理表(roleinfotb):
这里写图片描述
角色模块对应关系表(rolemoduletb):
这里写图片描述
模块管理表(moduleinfotb):
这里写图片描述
用户管理表(userinfotb):
这里写图片描述
用户角色对应关系表(userroletb):
这里写图片描述

统计报表设计:

交易统计报表:
这里写图片描述
支持日期段查询,交易类型,商户号,机构代码
这里写图片描述
这里写图片描述
这里写图片描述
不要提问我关于交易类型的业务,我不懂,

总之,这个系统90%以上都是增删改查,本人一个人开发了一个月,修复很多bug,比如下标的页数与实际的页数不同,页面的布局,对比打包的jar是否和本地一样多,主要是防止漏打包现象,对比上传的war的大小和本地是否相等,使用vpn连接西安那边的测试服务器(当时那叫一个慢,足足半小时以上,war包才30M多点)最多的是sql的问题,被老大说了很多次,通过这个项目熟练编写mybatis的sql,到使用FileZilla Client来上传到测试服务器,备份以前的,删除再部署,再测试,真是一个繁琐的劳动。
三、贴一下个人感觉比较难点的sql,当时也被“坑”了很多次
这里写图片描述

使用maven 开发的,所有的配置文件都放到了src/main/resources下面
我们将每一个模块的sql语句单独写在对应的模块名文件夹里面,方面查找,

<?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" ><mapper namespace="mngmoduleinfotb">    <select id="selectAllModulesForTreeNavigation" parameterType="com.form.privilige.mngmoduleinfotb"        resultType="com.form.privilige.mngmoduleinfotb">        select m.*        ,decode(m.initstate,0,'closed',1,'','') as state        from mngmoduleinfotb m        where m.menutype!=0<!--        and m.systemid=#{systemid} -->        and  m.menutype!=3        <if test="userid != null">            and m.id in(select r.moduleid from mngrolemoduletb r where r.roleid in(select u.roleid from mnguserroletb u where u.userid=#{userid}))        </if>        start with m.parentid='-1'        connect by m.parentid = prior m.id         order siblings by m.menutype desc,m.moduleorder desc    </select>    <!--  查询角色所属的模块,用于重新分配角色-->    <select id="selectAllModulesForRoleModule" parameterType="com.form.privilige.mngrolemoduletb"        resultType="com.form.privilige.mngmoduleinfotb">        select m.*,(case when r.moduleid is null or r.indeterminate=0 then 0 else 1 end) checked        from mngmoduleinfotb m        left join mngrolemoduletb r on m.id=r.moduleid and r.roleid=#{roleid}        where 1=1         <if test="userid != null">            and m.id in(select r.moduleid from mngrolemoduletb r where r.roleid in(select u.roleid from mnguserroletb u where u.userid=#{userid}))        </if>        start with m.parentid='-1'        connect by m.parentid = prior m.id         order siblings by m.menutype desc,m.moduleorder desc    </select>    <select id="selectAllModulesForPage" parameterType="com.form.privilige.mngmoduleinfotb"        resultType="com.form.privilige.mngmoduleinfotb">        select m.*,d.dictvaluedesc as menutypedesc,d1.dictvaluedesc as initstatedesc,d2.dictvaluedesc as logflagdesc from mngmoduleinfotb m        left join dictinfotb d on m.menutype=d.dictvalue and d.dicttype=10001 and d.locale='zh_CN'        left join dictinfotb d1 on m.initstate=d1.dictvalue and d1.dicttype=10002 and d1.locale='zh_CN'        left join dictinfotb d2 on m.logflag=d2.dictvalue and d2.dicttype=10006 and d2.locale='zh_CN'        where 1=1<!--            and systemid=#{systemid} -->        start with m.parentid='-1'        connect by m.parentid = prior m.id         order siblings by m.menutype,m.moduleorder    </select>    <select id="selectMngmoduleinfotbByCondition" parameterType="com.form.privilige.mngmoduleinfotb"        resultType="com.form.privilige.mngmoduleinfotb">        select m.*        from mngmoduleinfotb m        <where>            <if test="control != null">                m.control = #{control}            </if>        </where>    </select>    <insert id="insert" parameterType="com.form.privilige.mngmoduleinfotb">        insert into mngmoduleinfotb        <trim prefix="(" suffixOverrides=",">            <if test="id != null">id,</if>            <if test="text != null">text,</if>            <if test="parentid != null">parentid,</if>            <if test="menutype != null">menutype,</if>            <if test="control != null">control,</if>            <if test="moduleorder != null">moduleorder,</if>            <if test="modulelevel != null">modulelevel,</if>            <if test="logflag != null">logflag,</if>            <if test="htmldesc != null">htmldesc,</if>            <if test="initstate != null">initstate</if>        </trim>        )        values        <trim prefix="(" suffixOverrides=",">            <if test="id != null">#{id},</if>            <if test="text != null">#{text},</if>            <if test="parentid != null">#{parentid},</if>            <if test="menutype != null">#{menutype},</if>            <if test="control != null">#{control},</if>            <if test="moduleorder != null">#{moduleorder},</if>            <if test="modulelevel != null">#{modulelevel},</if>            <if test="logflag != null">#{logflag},</if>            <if test="htmldesc != null">#{htmldesc},</if>            <if test="initstate != null">#{initstate}</if>        </trim>        )    </insert>    <update id="update" parameterType="com.form.privilige.mngmoduleinfotb">        update mngmoduleinfotb        <set>            <if test="text != null">text=#{text},</if>            <if test="parentid != null">parentid=#{parentid},</if>            <if test="menutype != null">menutype=#{menutype},</if>            <if test="control != null">control=#{control},</if>            <if test="moduleorder != null">moduleorder=#{moduleorder},</if>            <if test="modulelevel != null">modulelevel=#{modulelevel},</if>            <if test="logflag != null">logflag=#{logflag},</if>            <if test="htmldesc != null">htmldesc=#{htmldesc},</if>            <if test="initstate != null">initstate=#{initstate}</if>        </set>        where id=#{id}    </update>    <delete id="delete" parameterType="com.form.privilige.mngmoduleinfotb">        delete from mngmoduleinfotb        where id=#{id}    </delete>    <select id="initPriviligeBtns"  parameterType="com.form.privilige.mngmoduleinfotb"        resultType="com.form.privilige.mngmoduleinfotb">        select * from mngmoduleinfotb t        where t.parentid in(select t1.id from mngmoduleinfotb t1 where t1.control=#{control})        <if test="userid != null">            and t.id in(select r.moduleid from mngrolemoduletb r where r.roleid in(select u.roleid from mnguserroletb u where u.userid=#{userid}))        </if>        order by t.moduleorder    </select></mapper>
<?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" ><!--namespace的作用是为这张表取一个名字,好在 impl类中进行访问 --><mapper namespace="mngroleinfotb">    <select id="selectCount" parameterType="com.form.privilige.mngroleinfotb"        resultType="java.lang.Integer">        select count(1) from mngroleinfotb t        <where>            <if test="roleid != null">                roleid = #{roleid}            </if>            <if test="rolename != null">                AND rolename like '%'||#{rolename}||'%'            </if>            <if test="unitid != null and unitid !=''">                AND t.unitid=#{unitid}            </if>         </where>    </select>    <select id="select" parameterType="com.form.privilige.mngroleinfotb"        resultType="com.form.privilige.mngroleinfotb">        <![CDATA[        SELECT tt.*            FROM (        ]]>        SELECT * FROM (SELECT a.*,ROWNUM AS rn FROM (           select t.* from mngroleinfotb t            <where>                <if test="roleid != null">                    roleid = #{roleid}                </if>                <if test="rolename != null">                    AND rolename like '%'||#{rolename}||'%'                </if>                <if test="unitid != null and unitid !=''">                    AND t.unitid=#{unitid}                </if>             </where>            <if test="sortString != null">                order by ${sortString}            </if>            ) a WHERE #{to} >=ROWNUM) b WHERE b.rn >= #{from}        ) tt        <if test="sortString != null">            order by rn        </if>    </select>    <insert id="insert" parameterType="com.form.privilige.mngroleinfotb">        insert into mngroleinfotb        <trim prefix="(" suffixOverrides=",">            <if test="roleid != null">roleid,</if>            <if test="rolename != null">rolename,</if>            <if test="unitid != null">unitid,</if>            <if test="roledesc != null">roledesc,</if>            <if test="enabled != null">enabled,</if>        </trim>        )        values        <trim prefix="(" suffixOverrides=",">            <if test="roleid != null">#{roleid},</if>            <if test="rolename != null">#{rolename},</if>            <if test="unitid != null">#{unitid},</if>            <if test="roledesc != null">#{roledesc},</if>            <if test="enabled != null">#{enabled},</if>        </trim>        )    </insert>    <update id="update" parameterType="com.form.privilige.mngroleinfotb">        update mngroleinfotb        <set>            <if test="rolename != null">rolename=#{rolename},</if>            <if test="unitid != null">unitid=#{unitid},</if>            <if test="roledesc != null">roledesc=#{roledesc},</if>            <if test="enabled != null">enabled=#{enabled}</if>        </set>        where roleid=#{roleid}    </update>    <delete id="delete" parameterType="com.form.privilige.mngroleinfotb">        delete from mngroleinfotb        where roleid=#{roleid}    </delete>    <select id="selectForUserRole" parameterType="com.form.privilige.mnguserroletb"        resultType="com.form.privilige.mngroleinfotb">        select t.*,        (case when m.userid is null then 0 else 1 end) checked from mngroleinfotb t        left join mnguserroletb m on t.roleid=m.roleid and userid = #{userid}        <where>            <if test="unitid != null and unitid !=''">                AND t.unitid=#{unitid}            </if>         </where>    </select></mapper>
<select id="selectCount" parameterType="com.form.reconciliation.tbl_rec_job"        resultType="java.lang.Integer">        select count(1) from tbl_rec_job t            left join tbl_bse_inf_mchnt d2 on t.mchnt_id = d2.mchnt_id            left join tbl_bse_info_inst d3 on t.inst_id = d3.inst_id        <where>            <if test="msg_id != null and msg_id !='' ">                and t.msg_id = #{msg_id}            </if>            <if test="rec_job_state != null and rec_job_state !='' ">                and t.rec_job_state = #{rec_job_state}            </if>            <if test="mchnt_id != null and mchnt_id != '' ">                and d2.mchnt_id= #{mchnt_id}            </if>            <if test="inst_id != null and inst_id != '' ">                and d3.inst_id= #{inst_id}            </if>        </where>    </select>    <select id="select" parameterType="com.form.reconciliation.tbl_rec_job"        resultType="com.form.reconciliation.tbl_rec_job">        select * from (select a.*,rownum as rn from (            select t.*,            d.dictvaluedesc as rec_job_statedesc,            d2.mchnt_name as mchnt_iddesc,            d3.inst_name as inst_iddesc            from tbl_rec_job t          left join dictinfotb d on t.rec_job_state=d.dictvalue and d.dicttype=20067 and d.locale='zh_CN'          left join tbl_bse_inf_mchnt d2 on t.mchnt_id = d2.mchnt_id          left join tbl_bse_info_inst d3 on t.inst_id = d3.inst_id        <where>            <if test="msg_id != null and msg_id !='' ">                t.msg_id = #{msg_id}            </if>            <if test="rec_job_state != null and rec_job_state !='' ">                and t.rec_job_state=#{rec_job_state}            </if>            <if test="mchnt_id != null and mchnt_id != '' ">                and d2.mchnt_id= #{mchnt_id}            </if>            <if test="inst_id != null and inst_id != '' ">                and d3.inst_id= #{inst_id}            </if>        </where>        <if test="sortString != null">            order by rec_date desc        </if>        ) a WHERE #{to} >=ROWNUM) b WHERE b.rn >= #{from}    </select>    <select id="selectNoPage" parameterType="com.form.reconciliation.tbl_rec_job"        resultType="com.form.reconciliation.tbl_rec_job">        SELECT t.*,            d.dictvaluedesc as rec_job_statedesc,            d2.mchnt_name as mchnt_iddesc,            d3.inst_name as inst_iddesc                from tbl_rec_job t              left join dictinfotb d on t.rec_job_state=d.dictvalue and d.dicttype=20067 and d.locale='zh_CN'              left join tbl_bse_inf_mchnt d2 on t.mchnt_id = d2.mchnt_id              left join tbl_bse_info_inst d3 on t.inst_id = d3.inst_id        <where>            <if test="msg_id != null and msg_id !='' ">                t.msg_id = #{msg_id}            </if>            <if test="rec_job_state != null and rec_job_state !='' ">                and t.rec_job_state=#{rec_job_state}            </if>            <if test="mchnt_id != null and mchnt_id != '' ">                and d2.mchnt_id= #{mchnt_id}            </if>            <if test="inst_id != null and inst_id != '' ">                and d3.inst_id= #{inst_id}            </if>        </where>        <if test="sortString != null">            order by rec_date desc        </if>    </select>    <update id="update" parameterType="com.form.reconciliation.tbl_rec_job">         update tbl_rec_job        <set>            <if test="rec_job_state != null and rec_job_state !='' ">                rec_job_state =#{rec_job_state },            </if>             <if test="rec_upd_time  != null and rec_upd_time !='' ">                rec_upd_time  =#{rec_upd_time  },            </if>         </set>        where msg_id = #{msg_id}     </update>
<select id="select" parameterType="com.form.statistics.tbl_bat_fee_limit"        resultType="com.form.statistics.tbl_bat_fee_limit">        <![CDATA[        SELECT tt.*            FROM (        ]]>        SELECT * FROM (SELECT a.*,ROWNUM AS rn FROM (           select settle_date,                  mchnt_id,                  mchnt_desc,                  card_type,                  nvl(c.dictvaluedesc,'') AS card_typedesc,                  (to_char(nvl(sum(base_fee)/100,0),'FM9999999990.00')) as base_fee,                  (to_char(nvl(sum(total_amt)/100,0),'FM9999999990.00')) as total_amt,                  sum(total_num) as total_num,                  sum(use_num) as use_num,                  (to_char(nvl(sum(use_amt)/100,0),'FM9999999990.00')) as use_amt,                  sum(left_num) as left_num,                  (to_char(nvl(sum(left_amt)/100,0),'FM9999999990.00')) as left_amt           from tbl_bat_fee_limit t           left join dictinfotb c on (t.card_type = c.dictvalue and c.dicttype='20075' and c.locale='zh_CN')            <where>                <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="mchnt_id !=null and mchnt_id !='' ">                    and mchnt_id=#{mchnt_id}                </if>                <if test="card_type !=null and card_type !='' ">                    and card_type=#{card_type}                </if>            </where>            group by settle_date,mchnt_id,mchnt_desc,card_type,c.dictvaluedesc            order by settle_date desc            ) a WHERE #{to} >=ROWNUM) b WHERE b.rn >= #{from}        ) tt        <if test="sortString != null">            order by tt.settle_date desc        </if>    </select>
<select id="select" parameterType="com.form.statistics.tbl_bat_recharge"        resultType="com.form.statistics.tbl_bat_recharge">        SELECT * FROM (SELECT a.*,ROWNUM AS rn FROM (           SELECT settle_date,                 inst_desc,                 mchnt_desc,                 card_type,                 nvl(c.dictvaluedesc,'') AS card_typedesc,                 nvl(err_code_desc, '总计') as err_code_desc,                 kq_fee_type,                 nvl(c1.dictvaluedesc,'') as kq_fee_typedesc,                 (to_char(kq_fee_amt/100,'FM9999999990.00')) as kq_fee_amt,                 kq_fee_percent as kq_fee_percent,                 sum(txn_num) as txn_num,                 (to_char(nvl(sum(TXN_AMT)/100,0),'FM9999999990.00')) as TXN_AMT,                 (to_char(nvl(sum(TXN_FEE)/100,0),'FM9999999990.00000000')) as TXN_FEE            from tbl_bat_recharge t             left join dictinfotb c on (t.card_type = c.dictvalue and c.dicttype='20075' and c.locale='zh_CN')             left join dictinfotb c1 on t.kq_fee_type=c1.dictvalue and c1.dicttype=20077 and c1.locale='zh_CN'            <where>                <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="inst_id !=null and inst_id !='' ">                    and inst_id=#{inst_id}                </if>                <if test="mchnt_id !=null and mchnt_id !='' ">                    and mchnt_id=#{mchnt_id}                </if>                <if test="card_type !=null and card_type !='' ">                    and card_type=#{card_type}                </if>                <if test="err_code !=null and err_code !=''">                    and err_code=#{err_code}                </if>                <if test="err_code_err !=null and err_code_err !=''">                    and err_code != '0000'                </if>            </where>            group BY ROLLUP ((settle_date,inst_desc,mchnt_desc,err_code_desc,card_type,err_code_desc,kq_fee_type,kq_fee_amt,kq_fee_percent,c.dictvaluedesc,c1.dictvaluedesc))            order by settle_date ,inst_desc,mchnt_desc,err_code_desc,card_type,err_code_desc,kq_fee_type,kq_fee_amt,kq_fee_percent            ) a WHERE #{to} >=ROWNUM) b WHERE b.rn >= #{from}    </select>
0 1