123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396 |
- <?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.new_dao.DeviceCheckMonthNewDao" >
- <resultMap id="baseMap" type="cn.ourwill.module.house.entity.new_entity.DeviceCheckMonthNew" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="grain_id" property="grainId" jdbcType="INTEGER" />
- <result column="check_date" property="checkDate" jdbcType="VARCHAR" />
- <result column="join_user" property="joinUser" jdbcType="VARCHAR" />
- <result column="check_item" property="checkItem" jdbcType="VARCHAR" />
- <result column="conclusion" property="conclusion" jdbcType="VARCHAR" />
- <result column="charge_user" property="chargeUser" jdbcType="VARCHAR" />
- <result column="charge_sign" property="chargeSign" jdbcType="VARCHAR" />
- <result column="sign_date" property="signDate" jdbcType="VARCHAR" />
- <result column="charge_state" property="chargeState" jdbcType="VARCHAR" />
- <result column="state" property="state" jdbcType="VARCHAR" />
- <result column="charge_idea" property="chargeIdea" jdbcType="VARCHAR" />
- <result column="uuid" property="uuid" jdbcType="VARCHAR" />
- <result column="c_id" property="cId" jdbcType="INTEGER" />
- <result column="c_time" property="cTime" jdbcType="TIMESTAMP" />
- <result column="u_id" property="uId" jdbcType="INTEGER" />
- <result column="u_time" property="uTime" jdbcType="TIMESTAMP" />
- </resultMap>
- <sql id="columns">
- a.id, a.grain_id, a.check_date, a.join_user, a.check_item, a.conclusion, a.charge_user, a.charge_sign,
- a.sign_date, a.charge_state, a.state, a.charge_idea, a.c_id, a.c_time, a.u_id, a.u_time
- </sql>
- <sql id = "columsOfFindd">
- sg.name AS grainName,
- /*ddm.device_name,
- ddm.device_model,
- ddm.device_manager ,
- ddm.collator,*/
- </sql>
- <sql id = "columsOfFi">
- dd.device_no,
- dd.asset_number,
- dd.place_of_origin,
- dd.device_unit,
- dd.price,
- dd.voucher_type,
- dd.voucher_number,
- dd.bookkeeper,
- dd.handler,
- </sql>
- <sql id="joinCols">
- </sql>
- <select id="get" resultMap="baseMap">
- SELECT
- <include refid="columsOfFindd"/>
- <include refid="columns"/>
- FROM device_check_month_new a
- LEFT JOIN sys_grain sg ON sg.id = a.grain_id
- <include refid="joinCols"/>
- WHERE a.id = #{id}
- </select>
- <insert id="insertss" parameterType="cn.ourwill.module.house.entity.new_entity.DeviceCheckMonthNew" >
- insert into device_check_month_new (id, grain_id, check_date,
- join_user, check_item, conclusion,
- charge_user, charge_sign, sign_date,
- charge_state, state, charge_idea,
- c_id, c_time, u_id,
- u_time)
- values (#{id,jdbcType=INTEGER}, #{grainId,jdbcType=INTEGER}, #{checkDate,jdbcType=VARCHAR},
- #{joinUser,jdbcType=VARCHAR}, #{checkItem,jdbcType=VARCHAR}, #{conclusion,jdbcType=VARCHAR},
- #{chargeUser,jdbcType=VARCHAR}, #{chargeSign,jdbcType=VARCHAR}, #{signDate,jdbcType=VARCHAR},
- #{chargeState,jdbcType=VARCHAR}, #{state,jdbcType=VARCHAR}, #{chargeIdea,jdbcType=VARCHAR},
- #{cId,jdbcType=INTEGER}, #{cTime,jdbcType=TIMESTAMP}, #{uId,jdbcType=INTEGER},
- #{uTime,jdbcType=TIMESTAMP})
- </insert>
- <select id="findList" resultMap="baseMap">
- SELECT
- <include refid="columsOfFindd"/>
- <include refid="columns"/>
- FROM device_check_month_new a
- LEFT JOIN sys_grain sg ON sg.id = a.grain_id
- <include refid="joinCols"/>
- <where>
- <if test="id !=null">
- id = #{id}
- </if>
- <if test="grainId !=null">
- and a.grain_id = #{grainId}
- </if>
- <if test="grainName !=null">
- and sg.name = #{grainName}
- </if>
- <if test="checkDate !=null">
- and a.check_date = #{checkDate}
- </if>
- <if test="joinUser !=null">
- and a.join_user = #{joinUser}
- </if>
- <if test="checkItem !=null">
- and a.check_item = #{checkItem}
- </if>
- <if test="conclusion !=null">
- and a.conclusion = #{conclusion}
- </if>
- <if test="chargeUser !=null">
- and a.charge_user = #{chargeUser}
- </if>
- <if test="chargeSign !=null">
- and a.charge_sign = #{chargeSign}
- </if>
- <if test="signDate !=null">
- and a.sign_date = #{signDate}
- </if>
- <if test="chargeState !=null">
- and a.charge_state = #{chargeState}
- </if>
- <if test="state !=null">
- and a.state = #{state}
- </if>
- <if test="chargeIdea !=null">
- and a.charge_idea = #{chargeIdea}
- </if>
- <if test="uuid !=null">
- and a.uuid = #{uuid}
- </if>
- <if test="cId !=null">
- and a.c_id = #{cId}
- </if>
- <if test="cTime !=null">
- and a.c_time = #{cTime}
- </if>
- <if test="uId !=null">
- and a.u_id = #{uId}
- </if>
- <if test="uTime !=null">
- and a.u_time = #{uTime}
- </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.new_entity.DeviceMachineUseNew">
- INSERT INTO device_check_month_new
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test=" id != null">
- id,
- </if>
- <if test="grainId !=null">
- grain_id ,
- </if>
- <if test="checkDate !=null">
- check_date,
- </if>
- <if test="joinUser !=null">
- join_user ,
- </if>
- <if test="checkItem !=null">
- check_item ,
- </if>
- <if test="conclusion !=null">
- conclusion ,
- </if>
- <if test="chargeUser !=null">
- charge_user ,
- </if>
- <if test="chargeSign !=null">
- charge_sign ,
- </if>
- <if test="signDate !=null">
- sign_date ,
- </if>
- <if test="chargeState !=null">
- charge_state ,
- </if>
- <if test="state !=null">
- state,
- </if>
- <if test="chargeIdea !=null">
- charge_idea ,
- </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>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test=" id != null">
- #{id}, </if>
- <if test="grainId !=null">
- #{grainId},
- </if>
- <if test="checkDate !=null">
- #{checkDate},
- </if>
- <if test="joinUser !=null">
- #{joinUser},
- </if>
- <if test="checkItem !=null">
- #{checkItem},
- </if>
- <if test="conclusion !=null">
- #{conclusion},
- </if>
- <if test="chargeUser !=null">
- #{chargeUser},
- </if>
- <if test="chargeSign !=null">
- #{chargeSign},
- </if>
- <if test="signDate !=null">
- #{signDate},
- </if>
- <if test="chargeState !=null">
- #{chargeState},
- </if>
- <if test="state !=null">
- #{state},
- </if>
- <if test="chargeIdea !=null">
- #{chargeIdea},
- </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>
- </trim>
- </insert>
- <update id="update" parameterType="cn.ourwill.module.house.entity.new_entity.DeviceMachineUseNew">
- UPDATE device_check_month_new <set>
- <if test="id != null">
- id= #{id} ,
- </if>
- <if test="grainId !=null">
- grain_id = #{grainId},
- </if>
- <if test="checkDate !=null">
- check_date = #{checkDate},
- </if>
- <if test="joinUser !=null">
- join_user = #{joinUser},
- </if>
- <if test="checkItem !=null">
- check_item = #{checkItem},
- </if>
- <if test="conclusion !=null">
- conclusion = #{conclusion},
- </if>
- <if test="chargeUser !=null">
- charge_user = #{chargeUser},
- </if>
- <if test="chargeSign !=null">
- charge_sign = #{chargeSign},
- </if>
- <if test="signDate !=null">
- sign_date = #{signDate},
- </if>
- <if test="chargeState !=null">
- charge_state = #{chargeState},
- </if>
- <if test="state !=null">
- state = #{state},
- </if>
- <if test="chargeIdea !=null">
- charge_idea = #{chargeIdea},
- </if>
- <if test="uuid !=null">
- uuid = #{uuid},
- </if>
- <if test="cId !=null">
- c_id = #{cId},
- </if>
- <if test="cTime !=null">
- c_time = #{cTime},
- </if>
- <if test="uId !=null">
- u_id = #{uId},
- </if>
- <if test="uTime !=null">
- u_time = #{uTime}
- </if>
- </set>
- WHERE id = #{id}
- </update>
- <delete id="deleteById" parameterType="java.lang.Long">
- DELETE FROM device_check_month_new WHERE id = #{id}
- </delete>
- <delete id="deleteByIds" parameterType="java.util.List">
- DELETE FROM device_check_month_new WHERE id IN
- <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
- #{item}
- </foreach>
- </delete>
- <sql id="Example_Where_Clause" >
- <where >
- <foreach collection="oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Update_By_Example_Where_Clause" >
- <where >
- <foreach collection="example.oredCriteria" item="criteria" separator="or" >
- <if test="criteria.valid" >
- <trim prefix="(" suffix=")" prefixOverrides="and" >
- <foreach collection="criteria.criteria" item="criterion" >
- <choose >
- <when test="criterion.noValue" >
- and ${criterion.condition}
- </when>
- <when test="criterion.singleValue" >
- and ${criterion.condition} #{criterion.value}
- </when>
- <when test="criterion.betweenValue" >
- and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
- </when>
- <when test="criterion.listValue" >
- and ${criterion.condition}
- <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
- #{listItem}
- </foreach>
- </when>
- </choose>
- </foreach>
- </trim>
- </if>
- </foreach>
- </where>
- </sql>
- <sql id="Base_Column_List" >
- id, grain_id, check_date, join_user, check_item, conclusion, charge_user, charge_sign,
- sign_date, charge_state, state, charge_idea, c_id, c_time, u_id, u_time
- </sql>
- </mapper>
|