85 lines
3.4 KiB
XML
85 lines
3.4 KiB
XML
<?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="com.dao.ShigujiluDao">
|
|
|
|
<!-- 可根据自己的需求,是否要使用 -->
|
|
<resultMap type="com.entity.ShigujiluEntity" id="shigujiluMap">
|
|
<result property="jilubianhao" column="jilubianhao"/>
|
|
<result property="chepaihao" column="chepaihao"/>
|
|
<result property="cheliangxinghao" column="cheliangxinghao"/>
|
|
<result property="fadongjihao" column="fadongjihao"/>
|
|
<result property="chejiahao" column="chejiahao"/>
|
|
<result property="shigudidian" column="shigudidian"/>
|
|
<result property="shiguzerenfang" column="shiguzerenfang"/>
|
|
<result property="shiguzhaopian" column="shiguzhaopian"/>
|
|
<result property="zhengmingcailiao" column="zhengmingcailiao"/>
|
|
<result property="shiguriqi" column="shiguriqi"/>
|
|
<result property="shiguxiangqing" column="shiguxiangqing"/>
|
|
<result property="zhanghao" column="zhanghao"/>
|
|
<result property="xingming" column="xingming"/>
|
|
<result property="jiashizhenghao" column="jiashizhenghao"/>
|
|
<result property="yuangongzhanghao" column="yuangongzhanghao"/>
|
|
<result property="yuangongxingming" column="yuangongxingming"/>
|
|
</resultMap>
|
|
|
|
<select id="selectListVO"
|
|
resultType="com.entity.vo.ShigujiluVO" >
|
|
SELECT * FROM shigujilu shigujilu
|
|
<where> 1=1 ${ew.sqlSegment}</where>
|
|
</select>
|
|
|
|
<select id="selectVO"
|
|
resultType="com.entity.vo.ShigujiluVO" >
|
|
SELECT shigujilu.* FROM shigujilu shigujilu
|
|
<where> 1=1 ${ew.sqlSegment}</where>
|
|
</select>
|
|
|
|
<select id="selectListView"
|
|
resultType="com.entity.view.ShigujiluView" >
|
|
|
|
SELECT shigujilu.* FROM shigujilu shigujilu
|
|
<where> 1=1 ${ew.sqlSegment}</where>
|
|
</select>
|
|
|
|
<select id="selectView"
|
|
resultType="com.entity.view.ShigujiluView" >
|
|
SELECT * FROM shigujilu shigujilu <where> 1=1 ${ew.sqlSegment}</where>
|
|
</select>
|
|
|
|
|
|
<select id="selectValue" resultType="map" >
|
|
SELECT ${params.xColumn}, ROUND(sum(${params.yColumn}),1) total FROM shigujilu
|
|
<where> 1=1 ${ew.sqlSegment}</where>
|
|
group by ${params.xColumn}
|
|
</select>
|
|
|
|
<select id="selectTimeStatValue" resultType="map" >
|
|
<if test = 'params.timeStatType == "日"'>
|
|
SELECT DATE_FORMAT(${params.xColumn},'%Y-%m-%d') ${params.xColumn}, sum(${params.yColumn}) total FROM shigujilu
|
|
<where> 1=1 ${ew.sqlSegment}</where>
|
|
group by DATE_FORMAT(${params.xColumn},'%Y-%m-%d')
|
|
</if>
|
|
<if test = 'params.timeStatType == "月"'>
|
|
SELECT DATE_FORMAT(${params.xColumn},'%Y-%m') ${params.xColumn}, sum(${params.yColumn}) total FROM shigujilu
|
|
<where> 1=1 ${ew.sqlSegment}</where>
|
|
group by DATE_FORMAT(${params.xColumn},'%Y-%m')
|
|
</if>
|
|
<if test = 'params.timeStatType == "年"'>
|
|
SELECT DATE_FORMAT(${params.xColumn},'%Y') ${params.xColumn}, sum(${params.yColumn}) total FROM shigujilu
|
|
<where> 1=1 ${ew.sqlSegment}</where>
|
|
group by DATE_FORMAT(${params.xColumn},'%Y')
|
|
</if>
|
|
</select>
|
|
|
|
<select id="selectGroup" resultType="map" >
|
|
SELECT ${params.column} , count(1) total FROM shigujilu
|
|
<where> 1=1 ${ew.sqlSegment}</where>
|
|
group by ${params.column}
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|