| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <?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.ym.mec.biz.dal.dao.SysUserCashAccountLogDao">
- <resultMap type="com.ym.mec.biz.dal.entity.SysUserCashAccountLog" id="SysUserCashAccountLog">
- <result column="id_" property="id"/>
- <result column="user_id_" property="userId"/>
- <result column="username_" property="username"/>
- <result column="trans_no_" property="transNo"/>
- <result column="return_fee_type_" property="returnFeeType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
- <result column="group_type_" property="groupType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
- <result column="amount_" property="amount"/>
- <result column="comment_" property="comment"/>
- <result column="create_time_" property="createTime"/>
- <result column="update_time_" property="updateTime"/>
- <result column="organ_name_" property="organName"/>
- <result column="group_id_" property="groupId"/>
- <result column="group_name_" property="groupName"/>
- <result column="pay_time_" property="payTime"/>
- </resultMap>
- <!-- 根据主键查询一条记录 -->
- <select id="get" resultMap="SysUserCashAccountLog">
- SELECT * FROM sys_user_cash_account_log WHERE id_ = #{id}
- </select>
- <!-- 全查询 -->
- <select id="findAll" resultMap="SysUserCashAccountLog">
- SELECT *
- FROM sys_user_cash_account_log
- ORDER BY id_
- </select>
- <!-- 向数据库增加一条记录 -->
- <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysUserCashAccountLog" useGeneratedKeys="true"
- keyColumn="id" keyProperty="id">
- INSERT INTO sys_user_cash_account_log (user_id_,organ_id_,trans_no_,return_fee_type_,group_type_,
- group_id_,amount_,comment_,pay_time_,create_time_,update_time_)
- VALUES(#{userId},#{organId},#{transNo},#{returnFeeType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
- #{groupType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{groupId},#{amount},
- #{comment},#{payTime},NOW(),NOW())
- </insert>
- <!-- 根据主键查询一条记录 -->
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.SysUserCashAccountLog">
- UPDATE sys_user_cash_account_log
- <set>
- <if test="comment != null">comment_ = #{comment},</if>
- <if test="transNo != null">trans_no_ = #{transNo},</if>
- <if test="payTime != null">pay_time_ = #{payTime},</if>
- update_time_ = NOW()
- </set>
- WHERE id_ = #{id}
- </update>
- <!-- 根据主键删除一条记录 -->
- <delete id="delete">
- DELETE FROM sys_user_cash_account_log WHERE id_ = #{id}
- </delete>
- <!-- 分页查询 -->
- <select id="queryPage" resultMap="SysUserCashAccountLog" parameterType="map">
- SELECT cal.*,su.username_,o.name_ organ_name_ FROM sys_user_cash_account_log cal
- LEFT JOIN sys_user su ON su.id_ = cal.user_id_
- LEFT JOIN organization o ON o.id_ = cal.organ_id_
- <include refid="queryPageSql"/>
- ORDER BY id_ DESC
- <include refid="global.limit"/>
- </select>
- <!-- 查询当前表的总记录数 -->
- <select id="queryCount" resultType="int">
- SELECT COUNT(cal.id_) FROM sys_user_cash_account_log cal
- LEFT JOIN sys_user su ON su.id_ = cal.user_id_
- <include refid="queryPageSql"/>
- </select>
- <sql id="queryPageSql">
- <where>
- <if test="createStartTime != null">
- AND DATE_FORMAT(cal.create_time_,'%Y%m%d') >= #{createStartTime}
- </if>
- <if test="createEndTime != null">
- AND DATE_FORMAT(cal.create_time_,'%Y%m%d') <= #{createEndTime}
- </if>
- <if test="payStartTime != null">
- AND DATE_FORMAT(cal.pay_time_,'%Y%m%d') >= #{payStartTime}
- </if>
- <if test="payEndTime != null">
- AND DATE_FORMAT(cal.pay_time_,'%Y%m%d') <= #{payEndTime}
- </if>
- <if test="groupType != null and groupType != ''">
- AND cal.group_type_ = #{groupType}
- </if>
- <if test="returnFeeType != null and returnFeeType != ''">
- AND cal.return_fee_type_ = #{returnFeeType}
- </if>
- <if test="organId != null and organId != ''">
- AND FIND_IN_SET(cal.organ_id_,#{organId})
- </if>
- <if test="search != null and search != ''">
- AND (cal.user_id_ = #{search} OR cal.group_id_ = #{search} OR su.username_ LIKE CONCAT('%',#{search},'%') OR cal.trans_no_ LIKE CONCAT('%',#{search},'%'))
- </if>
- </where>
- </sql>
- </mapper>
|