| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?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.ydtech.modules.admin.dao.SysDeptAccountHistoryMapper">
- <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.dto.SysDeptAccountHistoryDto">
- <id column="id" jdbcType="VARCHAR" property="id"/>
- <result column="dept_id" jdbcType="VARCHAR" property="deptId"/>
- <result column="name" jdbcType="VARCHAR" property="deptName"/>
- <result column="amount" jdbcType="DECIMAL" property="amount"/>
- <result column="surplus_amount" jdbcType="DECIMAL" property="surplusAmount"/>
- <result column="documentary" jdbcType="VARCHAR" property="documentary"/>
- <result column="suborder" jdbcType="VARCHAR" property="suborder"/>
- <result column="user_id" jdbcType="VARCHAR" property="userId"/>
- <result column="remark" jdbcType="VARCHAR" property="remark"/>
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
- <result property="createTimeStart" column="createTimeStart" jdbcType="VARCHAR"/>
- <result property="createTimeEnd" column="createTimeEnd" jdbcType="VARCHAR"/>
- </resultMap>
- <select id="getDeptHistory" resultMap="BaseResultMap">
- SELECT
- a.id,
- a.dept_id,
- b.NAME,
- a.amount,
- a.surplus_amount,
- a.documentary,
- a.suborder,
- a.user_id,
- a.remark,
- a.create_time
- FROM
- sys_dept_account_history a
- LEFT JOIN sys_dept b ON a.dept_id = b.id
- where
- b.del_flag = 0
- <if test="sysDeptAccountHistoryDto.deptId != null and sysDeptAccountHistoryDto.deptId != ''">
- AND a.dept_id like concat(#{sysDeptAccountHistoryDto.deptId},'%')
- </if>
- <if test="sysDeptAccountHistoryDto.deptName != null and sysDeptAccountHistoryDto.deptName != ''">
- AND b.name = #{sysDeptAccountHistoryDto.deptName}
- </if>
- <if test="sysDeptAccountHistoryDto.suborder != null and sysDeptAccountHistoryDto.suborder != ''">
- AND a.suborder = #{sysDeptAccountHistoryDto.suborder}
- </if>
- <if test="sysDeptAccountHistoryDto.documentary != null and sysDeptAccountHistoryDto.documentary != ''">
- AND a.documentary = #{sysDeptAccountHistoryDto.documentary}
- </if>
- <if test="sysDeptAccountHistoryDto.createTimeStart != null and sysDeptAccountHistoryDto.createTimeStart != ''">
- and a.create_time >= #{sysDeptAccountHistoryDto.createTimeStart}
- </if>
- <if test="sysDeptAccountHistoryDto.createTimeEnd != null and sysDeptAccountHistoryDto.createTimeEnd != ''">
- and a.create_time <= #{sysDeptAccountHistoryDto.createTimeEnd}
- </if>
- </select>
- </mapper>
|