92 lines
3.8 KiB
XML
92 lines
3.8 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.adc.da.report.dao.mysql.PowerApplyDao">
|
|
|
|
<!-- 通用查询映射结果 -->
|
|
<resultMap id="BaseResultMap" type="com.adc.da.report.eo.PowerApply">
|
|
<result column="id" property="id" />
|
|
<result column="data_id" property="dataId" />
|
|
<result column="report_id" property="reportId" />
|
|
<result column="user_id" property="userId" />
|
|
<result column="create_user_id" property="createUserId" />
|
|
<result column="create_date" property="createDate" />
|
|
<result column="update_date" property="updateDate" />
|
|
<result column="update_user_id" property="updateUserId" />
|
|
<result column="del_flag" property="delFlag" />
|
|
<result column="power" property="power" />
|
|
<result column="apply_reason" property="applyReason" />
|
|
</resultMap>
|
|
|
|
<!--表名信息-->
|
|
<sql id="TableName">
|
|
power_apply_act
|
|
</sql>
|
|
|
|
<!-- 通用查询结果列 -->
|
|
<sql id="BaseColumnList">
|
|
id,data_id, report_id, power, apply_reason, user_id, create_user_id, create_date, update_date, update_user_id, del_flag
|
|
</sql>
|
|
|
|
<!-- 查询条件 -->
|
|
<sql id="BaseQuerySql">
|
|
<where>
|
|
AND del = '${@com.adc.da.sys.constant.YesOrNoEnum@NO.value}'
|
|
<if test="pageVO != null">
|
|
<if test="pageVO.dataId !=null and pageVO.dataId !=''">
|
|
AND data_id LIKE CONCAT(CONCAT('%',#{pageVO.dataId}),'%')
|
|
</if>
|
|
<if test="pageVO.reportId !=null and pageVO.reportId !=''">
|
|
AND report_id LIKE CONCAT(CONCAT('%',#{pageVO.reportId}),'%')
|
|
</if>
|
|
<if test="pageVO.userId !=null and pageVO.userId !=''">
|
|
AND user_id LIKE CONCAT(CONCAT('%',#{pageVO.userId}),'%')
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</sql>
|
|
<insert id="saveBatch">
|
|
insert into power_apply (id,data_id, report_id, power, apply_reason, user_id, create_user_id, create_date, update_date, update_user_id, del_flag)
|
|
values
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.id}, #{item.dataId}, #{item.reportId}, #{item.power}, #{item.applyReason}, #{item.userId}, #{item.createUserId}, #{item.createDate}, #{item.updateDate}, #{item.updateUserId}, #{item.delFlag})
|
|
</foreach>
|
|
</insert>
|
|
<insert id="savePowerAct">
|
|
insert into power_apply (id,data_id, report_id, power, apply_reason, user_id, create_user_id, create_date, update_date, update_user_id, del_flag)
|
|
values
|
|
(#{item.id}, #{item.dataId}, #{item.reportId}, #{item.power}, #{item.applyReason}, #{item.userId}, #{item.createUserId}, #{item.createDate}, #{item.updateDate}, #{item.updateUserId}, #{item.delFlag})
|
|
</insert>
|
|
|
|
|
|
<!-- 根据查询VO进行分页查询 -->
|
|
<select id="selectPage" resultMap="BaseResultMap">
|
|
SELECT
|
|
<include refid="BaseColumnList"/>
|
|
FROM <include refid="TableName"/>
|
|
<include refid="BaseQuerySql"/>
|
|
ORDER BY create_time DESC
|
|
</select>
|
|
|
|
|
|
<!-- 根据查询VO进行分页查询总数 -->
|
|
<select id="selectPageCount" resultType="java.lang.Long">
|
|
SELECT
|
|
COUNT(1)
|
|
FROM (
|
|
SELECT
|
|
<include refid="BaseColumnList"/>
|
|
FROM <include refid="TableName"/>
|
|
<include refid="BaseQuerySql"/>
|
|
)a
|
|
</select>
|
|
|
|
<!-- 根据查询VO进行列表查询 -->
|
|
<select id="queryList" resultMap="BaseResultMap">
|
|
SELECT
|
|
<include refid="BaseColumnList"/>
|
|
FROM <include refid="TableName"/>
|
|
<include refid="BaseQuerySql"/>
|
|
ORDER BY create_time DESC
|
|
</select>
|
|
</mapper>
|