123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- <?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="cn.ourwill.module.house.dao.dm.PaymentStatisticsDao">
- <resultMap type="cn.ourwill.module.house.entity.dm.PaymentStatistics" id="baseMap">
- <result column="grain_id" property="grainId"/>
- <result column="grain_name" property="grainName"/>
- <result column="feeType" property="feeType"/>
- <result column="fee" property="fee"/>
- <result column="feeDate" property="feeDate"/>
- </resultMap>
- <sql id="columns">
- grain_id ,
- grain_name ,
- feeType ,
- fee ,
- feeDate
- </sql>
- <sql id="joinCols">
- </sql>
- <select id="get" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_payment_statistics a
- <include refid="joinCols"/>
- WHERE a.grain_id = #{id}
- </select>
- <select id="findList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_payment_statistics a
- <include refid="joinCols"/>
- <where>
- <if test="grainId !=null">
- and grain_id = #{grainId}
- </if>
- <if test="grainName !=null">
- and grain_name = #{grainName}
- </if>
- <if test="feeType !=null">
- and feeType = #{feeType}
- </if>
- <if test="fee !=null">
- and fee = #{fee}
- </if>
- <if test="feeDate !=null">
- and feeDate = #{feeDate}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <select id="findAllList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM daily_payment_statistics a
- <include refid="joinCols"/>
- <where>
- <if test="grainId !=null">
- and grain_id = #{grainId}
- </if>
- <if test="grainName !=null">
- and grain_name = #{grainName}
- </if>
- <if test="feeType !=null">
- and feeType = #{feeType}
- </if>
- <if test="fee !=null">
- and fee = #{fee}
- </if>
- <if test="beginFeeDate !=null">
- and feeDate >= #{beginFeeDate}
- </if>
- <if test="endFeeDate !=null">
- and feeDate < #{endFeeDate}
- </if>
- </where>
- <choose>
- <when test="page !=null and page.orderBy != null and page.orderBy != ''">
- ORDER BY ${page.orderBy}
- </when>
- <otherwise>
- </otherwise>
- </choose>
- </select>
- <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
- parameterType="cn.ourwill.module.house.entity.dm.PaymentStatistics">
- INSERT INTO daily_payment_statistics
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test=" grainId != null">
- grain_id,
- </if>
- <if test=" grainName != null">
- grain_name,
- </if>
- <if test=" feeType != null">
- feeType,
- </if>
- <if test=" fee != null">
- fee,
- </if>
- <if test=" feeDate != null">
- feeDate
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test=" grainId != null">
- #{grainId}, </if>
- <if test=" grainName != null">
- #{grainName}, </if>
- <if test=" feeType != null">
- #{feeType}, </if>
- <if test=" fee != null">
- #{fee}, </if>
- <if test=" feeDate != null">
- #{feeDate} </if>
- </trim>
- </insert>
- <update id="update" parameterType="cn.ourwill.module.house.entity.dm.PaymentStatistics">
- UPDATE daily_payment_statistics <set>
- <if test="grainId != null">
- grain_id= #{grainId} ,
- </if>
- <if test="grainName != null">
- grain_name= #{grainName} ,
- </if>
- <if test="feeType != null">
- feeType= #{feeType} ,
- </if>
- <if test="fee != null">
- fee= #{fee} ,
- </if>
- <if test="feeDate != null">
- feeDate= #{feeDate}
- </if>
- </set>
- WHERE id = #{id}
- </update>
- <delete id="deleteById" parameterType="java.lang.Long">
- DELETE FROM daily_payment_statistics WHERE id = #{id}
- </delete>
- <delete id="deleteByIds" parameterType="java.util.List">
- DELETE FROM daily_payment_statistics WHERE id IN
- <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </delete>
- </mapper>
|