123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- <?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.DailyRecordTransferFileDao">
- <resultMap type="cn.ourwill.module.house.entity.daily.DailyRecordTransferFile" id="baseMap">
- <result column="id" property="id"/>
- <result column="house_name" property="houseName"/>
- <result column="house_id" property="houseId"/>
- <result column="house_property" property="houseProperty"/>
- <result column="grain_name" property="grainName"/>
- <result column="trans_time" property="transTime"/>
- <result column="trans_user" property="transUser"/>
- <result column="receive_user" property="receiveUser"/>
- <result column="superior_user" property="superiorUser"/>
- <result column="type" property="type"/>
- <result column="count" property="count"/>
- <result column="quality" property="quality"/>
- <result column="condition" property="condition"/>
- <result column="responsible_user" property="responsibleUser"/>
- <result column="remark" property="remark"/>
- <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="pic" property="pic"/>
- <result column="location" property="location"/>
- <result column="run_time" property="runTime"/>
- <result column="receive_remark" property="receiveRemark"/>
- <result column="keeper" property="keeper"/>
- <result column="receive_num" property="receiveNum"/>
- <result column="file_uuid" property="fileUuid"/>
- </resultMap>
- <sql id="dailyRecordTransferColumns">
- id ,
- house_name ,
- house_id,
- house_property,
- grain_name ,
- trans_time ,
- trans_user ,
- receive_user ,
- superior_user ,
- `type`,
- `count`,
- quality ,
- `condition` ,
- responsible_user ,
- remark ,
- c_id ,
- c_time ,
- u_id ,
- u_time ,
- version ,
- pic,
- location,
- run_time,
- receive_remark,
- keeper,
- receive_num,
- file_uuid
- </sql>
- <sql id="dailyRecordTransferJoins">
- </sql>
- <select id="get" resultMap="baseMap" parameterType="java.lang.Long">
- SELECT
- <include refid="dailyRecordTransferColumns"/>
- FROM daily_record_transfer_file
- <!--<include refid="dailyRecordTransferJoins"/>-->
- WHERE id = #{id}
- </select>
- <select id="findList" resultMap="baseMap">
- SELECT
- <include refid="dailyRecordTransferColumns"/>
- FROM daily_record_transfer_file a
- <include refid="dailyRecordTransferJoins"/>
- <where>
- <if test="id !=null">
- and id = #{id}
- </if>
- <if test="houseName !=null">
- and house_name = #{houseName}
- </if>
- <if test="houseId !=null">
- and house_id = #{houseId}
- </if>
- <if test="houseName !=null">
- and house_property = #{houseProperty}
- </if>
- <if test="grainName !=null">
- and grain_name = #{grainName}
- </if>
- <if test="transTime !=null">
- and trans_time = #{transTime}
- </if>
- <if test="searchStartDate !=null">
- and STR_TO_DATE(trans_time, '%Y-%m-%d') <![CDATA[ >= ]]> #{searchStartDate}
- </if>
- <if test="searchEndDate !=null">
- and STR_TO_DATE(trans_time, '%Y-%m-%d') <= #{searchEndDate}
- </if>
- <if test="transUser !=null">
- and trans_user = #{transUser}
- </if>
- <if test="receiveUser !=null">
- and receive_user = #{receiveUser}
- </if>
- <if test="superiorUser !=null">
- and superior_user = #{superiorUser}
- </if>
- <if test="type !=null">
- and type = #{type}
- </if>
- <if test="count !=null">
- and count = #{count}
- </if>
- <if test="quality !=null">
- and quality = #{quality}
- </if>
- <if test="condition !=null">
- and condition = #{condition}
- </if>
- <if test="responsibleUser !=null">
- and responsible_user = #{responsibleUser}
- </if>
- <if test="remark !=null">
- and remark = #{remark}
- </if>
- <!--<if test="searchStartDate!=null and searchEndDate !=null ">-->
- <!--and trans_time BETWEEN #{searchStartDate} AND #{searchEndDate}-->
- <!--</if>-->
- <if test="searchStartDate !=null ">
- and trans_time >= #{searchStartDate}
- </if>
- <if test=" searchEndDate !=null ">
- and trans_time <= #{searchEndDate}
- </if>
- <if test=" fileUuid !=null ">
- and file_uuid <= #{fileUuid}
- </if>
- </where>
- order by id desc
- </select>
- <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true">
- INSERT INTO daily_record_transfer_file
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <!-- <if test=" id != null">
- id,
- </if>-->
- <if test=" uuid != null">
- uuid,
- </if>
- <if test=" houseName != null">
- house_name,
- </if>
- <if test=" houseId != null">
- house_id,
- </if>
- <if test=" houseProperty != null">
- house_property,
- </if>
- <if test=" grainName != null">
- grain_name,
- </if>
- <if test=" transTime != null">
- trans_time,
- </if>
- <if test=" transUser != null">
- trans_user,
- </if>
- <if test=" receiveUser != null">
- receive_user,
- </if>
- <if test=" superiorUser != null">
- superior_user,
- </if>
- <if test=" type != null">
- `type`,
- </if>
- <if test=" count != null">
- `count`,
- </if>
- <if test=" quality != null">
- quality,
- </if>
- <if test=" condition != null">
- `condition`,
- </if>
- <if test=" responsibleUser != null">
- responsible_user,
- </if>
- <if test=" remark != null">
- remark,
- </if>
- <if test=" cId != null">
- c_id,
- </if>
- c_time,
- <if test=" uId != null">
- u_id,
- </if>
- <if test=" uTime != null">
- u_time,
- </if>
- <if test=" version != null">
- version,
- </if>
- <if test=" pic != null">
- pic,
- </if>
- <if test=" location != null">
- location,
- </if>
- <if test=" runTime != null">
- run_time,
- </if>
- <if test=" receiveRemark != null">
- receive_remark,
- </if>
- <if test=" keeper != null">
- keeper,
- </if>
- <if test=" receiveNum != null">
- receive_num,
- </if>
- <if test=" fileUuid != null">
- file_uuid
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <!--<if test="id !=null">
- #{id},
- </if>-->
- <if test=" uuid != null">
- #{uuid},
- </if>
- <if test=" houseName != null">
- #{houseName},
- </if>
- <if test=" houseId != null">
- #{houseId},
- </if>
- <if test=" houseProperty != null">
- #{houseProperty},
- </if>
- <if test=" grainName != null">
- #{grainName},
- </if>
- <if test=" transTime != null">
- #{transTime},
- </if>
- <if test=" transUser != null">
- #{transUser},
- </if>
- <if test=" receiveUser != null">
- #{receiveUser},
- </if>
- <if test=" superiorUser != null">
- #{superiorUser},
- </if>
- <if test=" type != null">
- #{type},
- </if>
- <if test=" count != null">
- #{count},
- </if>
- <if test=" quality != null">
- #{quality},
- </if>
- <if test=" condition != null">
- #{condition},
- </if>
- <if test=" responsibleUser != null">
- #{responsibleUser},
- </if>
- <if test=" remark != null">
- #{remark},
- </if>
- <if test=" cId != null">
- #{cId},
- </if>
- now(),
- <if test=" uId != null">
- #{uId},
- </if>
- <if test=" uTime != null">
- #{uTime},
- </if>
- <if test=" version != null">
- #{version},
- </if>
- <if test=" pic != null">
- #{pic},
- </if>
- <if test=" location != null">
- #{location},
- </if>
- <if test=" runTime != null">
- #{runTime},
- </if>
- <if test=" receiveRemark != null">
- #{receiveRemark},
- </if>
- <if test=" keeper != null">
- #{keeper},
- </if>
- <if test=" receiveNum != null">
- #{receiveNum},
- </if>
- <if test=" fileUuid != null">
- #{fileUuid},
- </if>
- </trim>
- </insert>
- </mapper>
|