123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376 |
- <?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.daily.DailyRecordHouseIncDecDao">
- <resultMap id="baseMap" type="cn.ourwill.module.house.entity.daily.DailyRecordHouseIncDec">
- <result column="id" property="id"/>
- <result column="report_organ" property="reportOrgan"/>
- <result column="grain_id" property="grainId"/>
- <result column="house_no" property="houseNo"/>
- <result column="table_no" property="tableNo"/>
- <result column="in_count" property="inCount"/>
- <result column="in_water" property="inWater"/>
- <result column="in_sub" property="inSub"/>
- <result column="in_date" property="inDate"/>
- <result column="out_count" property="outCount"/>
- <result column="out_water" property="outWater"/>
- <result column="out_sub" property="outSub"/>
- <result column="out_date" property="outDate"/>
- <result column="real_consum" property="realConsum"/>
- <result column="nature_consum" property="natureConsum"/>
- <result column="sub_consum" property="subConsum"/>
- <result column="tran_consum" property="tranConsum"/>
- <result column="deal_solu" property="dealSolu"/>
- <result column="leader_solu" property="leaderSolu"/>
- <result column="above_count" property="aboveCount"/>
- <result column="excess_quantity" property="excessQuantity"/>
- <result column="uuid" property="uuid"/>
- <result column="c_id" property="cId"/>
- <result column="c_time" property="cTime"/>
- <result column="u_id" property="uId"/>
- <result column="u_time" property="uTime"/>
- <result column="version" property="version"/>
- <result column="house_name" property="houseName"/>
- </resultMap>
- <sql id="columns">
- a.id,
- a.report_organ,
- a.house_no,
- a.grain_id,
- a.table_no,
- a.in_count,
- a.in_water,
- a.in_sub,
- a.in_date,
- a.out_count,
- a.out_water,
- a.out_sub,
- a.out_date,
- a.real_consum,
- a.nature_consum,
- a.sub_consum,
- a.tran_consum,
- a.deal_solu,
- a.leader_solu,
- above_count,
- excess_quantity,
- a.uuid,
- a.c_id,
- a.c_time,
- a.u_id,
- a.u_time,
- a.version
- </sql>
- <select id="get" resultMap="baseMap">
- SELECT b.house_name,<include refid="columns"/>
- FROM outhouse_inc_dec a LEFT JOIN house_info b ON a.house_no=b.id
- WHERE a.id=#{id}
- </select>
- <select id="getByHouseNo" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM outhouse_inc_dec a
- WHERE a.house_no=#{id}
- limit 1
- </select>
- <select id="findAllList" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM outhouse_inc_dec a
- <where>
- <if test=" id != null">
- and id = #{id}
- </if>
- <if test=" reportOrgan != null">
- and report_organ = #{reportOrgan}
- </if>
- <if test=" houseNo != null">
- and house_no = #{houseNo}
- </if>
- <if test=" grainId != null">
- and grain_id = #{grainId}
- </if>
- <if test=" tableNo != null">
- and table_no like CONCAT('%',#{tableNo},'%')
- </if>
- <if test=" inCount != null">
- and in_count = #{inCount}
- </if>
- <if test=" inWater != null">
- and in_water = #{inWater}
- </if>
- <if test=" inSub != null">
- and in_sub = #{inSub}
- </if>
- <if test=" inDate != null">
- and in_date = #{inDate}
- </if>
- <if test=" outCount != null">
- and out_count = #{outCount}
- </if>
- <if test=" outWater != null">
- and out_water = #{outWater}
- </if>
- <if test=" outSub != null">
- and out_sub = #{outSub}
- </if>
- <if test=" outDate != null">
- and out_date = #{outDate}
- </if>
- <if test=" realConsum != null">
- and real_consum = #{realConsum}
- </if>
- <if test=" natureConsum != null">
- and nature_consum = #{natureConsum}
- </if>
- <if test=" subConsum != null">
- and sub_consum = #{subConsum}
- </if>
- <if test=" tranConsum != null">
- and tran_consum = #{tranConsum}
- </if>
- <if test=" dealSolu != null">
- and deal_solu = #{dealSolu}
- </if>
- <if test=" leaderSolu != null">
- and leader_solu = #{leaderSolu}
- </if>
- <if test=" aboveCount != null">
- and above_count = #{aboveCount}
- </if>
- <if test=" excessQuantity != null">
- and excess_quantity = #{excessQuantity}
- </if>
- <if test="uuid != null">
- and uuid = #{uuid}
- </if>
- <if test="cId != null">
- and c_id = #{cId}
- </if>
- <if test="cTime != null">
- and c_time LIKE CONCAT('%',#{cTime},'%')
- </if>
- <if test="uId != null">
- and u_id = #{uId}
- </if>
- <if test="uTime != null">
- and u_time = #{uTime}
- </if>
- <if test="version !=null">
- and version = #{version}
- </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" parameterType="cn.ourwill.module.house.entity.daily.DailyRecordHouseIncDec">
- INSERT INTO outhouse_inc_dec
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test=" id != null">
- id,
- </if>
- <if test=" reportOrgan != null">
- report_organ,
- </if>
- <if test=" houseNo != null">
- house_no,
- </if>
- <if test=" grainId != null">
- grain_id,
- </if>
- <if test=" tableNo != null">
- table_no,
- </if>
- <if test=" inCount != null">
- in_count,
- </if>
- <if test=" inWater != null">
- in_water,
- </if>
- <if test=" inSub != null">
- in_sub,
- </if>
- <if test=" inDate != null">
- in_date,
- </if>
- <if test=" outCount != null">
- out_count,
- </if>
- <if test=" outWater != null">
- out_water,
- </if>
- <if test=" outSub != null">
- out_sub,
- </if>
- <if test=" outDate != null">
- out_date,
- </if>
- <if test=" realConsum != null">
- real_consum,
- </if>
- <if test=" natureConsum != null">
- nature_consum,
- </if>
- <if test=" subConsum != null">
- sub_consum,
- </if>
- <if test=" tranConsum != null">
- tran_consum,
- </if>
- <if test=" dealSolu != null">
- deal_solu,
- </if>
- <if test=" leaderSolu != null">
- leader_solu,
- </if>
- <if test=" aboveCount != null">
- above_count,
- </if>
- <if test=" excessQuantity != null">
- excess_quantity,
- </if>
- <if test="uuid != null">
- uuid,
- </if>
- <if test="cId != null">
- c_id,
- </if>
- <if test="cTime != null">
- c_time,
- </if>
- <if test="uId != null">
- u_id,
- </if>
- <if test="uTime != null">
- u_time,
- </if>
- <if test="version !=null">
- version
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test=" id != null">
- #{id},
- </if>
- <if test=" reportOrgan != null">
- #{reportOrgan},
- </if>
- <if test=" houseNo != null">
- #{houseNo},
- </if>
- <if test=" grainId != null">
- #{grainId},
- </if>
- <if test=" tableNo != null">
- #{tableNo},
- </if>
- <if test=" inCount != null">
- #{inCount},
- </if>
- <if test=" inWater != null">
- #{inWater},
- </if>
- <if test=" inSub != null">
- #{inSub},
- </if>
- <if test=" inDate != null">
- #{inDate},
- </if>
- <if test=" outCount != null">
- #{outCount},
- </if>
- <if test=" outWater != null">
- #{outWater},
- </if>
- <if test=" outSub != null">
- #{outSub},
- </if>
- <if test=" outDate != null">
- #{ outDate},
- </if>
- <if test=" realConsum != null">
- #{ realConsum},
- </if>
- <if test=" natureConsum != null">
- #{ natureConsum},
- </if>
- <if test=" subConsum != null">
- #{ subConsum},
- </if>
- <if test=" tranConsum != null">
- #{tranConsum},
- </if>
- <if test=" dealSolu != null">
- #{dealSolu},
- </if>
- <if test=" leaderSolu != null">
- #{leaderSolu},
- </if>
- <if test=" aboveCount != null">
- #{aboveCount},
- </if>
- <if test=" excessQuantity != null">
- #{excessQuantity},
- </if>
- <if test="uuid != null">
- #{uuid},
- </if>
- <if test="cId != null">
- #{cId},
- </if>
- <if test="cTime != null">
- #{cTime},
- </if>
- <if test="uId != null">
- #{uId},
- </if>
- <if test="uTime != null">
- #{uTime},
- </if>
- <if test="version !=null">
- #{version},
- </if>
- </trim>
- </insert>
- <select id="findByHouseIdNoPage" resultMap="baseMap">
- SELECT *
- FROM outhouse_inc_dec a
- where house_no=#{houseId}
- <if test="cTime != null">
- AND out_date <![CDATA[ <= ]]> #{cTime}
- </if>
- </select>
- <delete id="deleteIncDecByHouseId">
- DELETE FROM outhouse_inc_dec
- WHERE house_no = #{houseId}
- <if test="cTime != null">
- AND out_date <![CDATA[ <= ]]> #{cTime}
- </if>
- </delete>
- </mapper>
|