| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <?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.th.demo.mapping.maint.UserWareMapper" >
- <resultMap id="BaseResultMap" type="com.th.demo.model.maint.UserWare" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="user_id" property="userId" jdbcType="VARCHAR" />
- <result column="ware_id" property="wareId" jdbcType="VARCHAR" />
- <result column="add_id" property="addId" jdbcType="VARCHAR" />
- <result column="add_time" property="addTime" jdbcType="TIMESTAMP" />
- <result column="modify_id" property="modifyId" jdbcType="VARCHAR" />
- <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
- <result column="cancel_id" property="cancelId" jdbcType="VARCHAR" />
- <result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP" />
- <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
- <result column="belong_id" property="belongId" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, user_id, ware_id, add_id, add_time, modify_id, modify_time, cancel_id, cancel_time,
- cancel_flag, belong_id
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from t_maint_userware
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from t_maint_userware
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="com.th.demo.model.maint.UserWare" >
-
- <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
- SELECT REPLACE(UUID(),'-','') as id from dual
- </selectKey>
-
-
-
- insert into t_maint_userware (id, user_id, ware_id,
- add_id, add_time, modify_id,
- modify_time, cancel_id, cancel_time,
- cancel_flag, belong_id)
- values (#{id,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{wareId,jdbcType=VARCHAR},
- #{addId,jdbcType=VARCHAR}, #{addTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=VARCHAR},
- #{modifyTime,jdbcType=TIMESTAMP}, #{cancelId,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP},
- #{cancelFlag,jdbcType=VARCHAR}, #{belongId,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.th.demo.model.maint.UserWare" >
- insert into t_maint_userware
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="userId != null" >
- user_id,
- </if>
- <if test="wareId != null" >
- ware_id,
- </if>
- <if test="addId != null" >
- add_id,
- </if>
- <if test="addTime != null" >
- add_time,
- </if>
- <if test="modifyId != null" >
- modify_id,
- </if>
- <if test="modifyTime != null" >
- modify_time,
- </if>
- <if test="cancelId != null" >
- cancel_id,
- </if>
- <if test="cancelTime != null" >
- cancel_time,
- </if>
- <if test="cancelFlag != null" >
- cancel_flag,
- </if>
- <if test="belongId != null" >
- belong_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="userId != null" >
- #{userId,jdbcType=VARCHAR},
- </if>
- <if test="wareId != null" >
- #{wareId,jdbcType=VARCHAR},
- </if>
- <if test="addId != null" >
- #{addId,jdbcType=VARCHAR},
- </if>
- <if test="addTime != null" >
- #{addTime,jdbcType=TIMESTAMP},
- </if>
- <if test="modifyId != null" >
- #{modifyId,jdbcType=VARCHAR},
- </if>
- <if test="modifyTime != null" >
- #{modifyTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cancelId != null" >
- #{cancelId,jdbcType=VARCHAR},
- </if>
- <if test="cancelTime != null" >
- #{cancelTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cancelFlag != null" >
- #{cancelFlag,jdbcType=VARCHAR},
- </if>
- <if test="belongId != null" >
- #{belongId,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.th.demo.model.maint.UserWare" >
- update t_maint_userware
- <set >
- <if test="userId != null" >
- user_id = #{userId,jdbcType=VARCHAR},
- </if>
- <if test="wareId != null" >
- ware_id = #{wareId,jdbcType=VARCHAR},
- </if>
- <if test="addId != null" >
- add_id = #{addId,jdbcType=VARCHAR},
- </if>
- <if test="addTime != null" >
- add_time = #{addTime,jdbcType=TIMESTAMP},
- </if>
- <if test="modifyId != null" >
- modify_id = #{modifyId,jdbcType=VARCHAR},
- </if>
- <if test="modifyTime != null" >
- modify_time = #{modifyTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cancelId != null" >
- cancel_id = #{cancelId,jdbcType=VARCHAR},
- </if>
- <if test="cancelTime != null" >
- cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
- </if>
- <if test="cancelFlag != null" >
- cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
- </if>
- <if test="belongId != null" >
- belong_id = #{belongId,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.th.demo.model.maint.UserWare" >
- update t_maint_userware
- set user_id = #{userId,jdbcType=VARCHAR},
- ware_id = #{wareId,jdbcType=VARCHAR},
- add_id = #{addId,jdbcType=VARCHAR},
- add_time = #{addTime,jdbcType=TIMESTAMP},
- modify_id = #{modifyId,jdbcType=VARCHAR},
- modify_time = #{modifyTime,jdbcType=TIMESTAMP},
- cancel_id = #{cancelId,jdbcType=VARCHAR},
- cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
- cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
- belong_id = #{belongId,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
-
-
-
- <select id="selectByUserIdForUserWare" resultType="java.lang.String" >
- select
- ware_id
- from t_maint_userware
- where user_id = #{param1,jdbcType=VARCHAR}
- and belong_id = #{param2,jdbcType=VARCHAR}
- </select>
-
- <delete id="deleteByUserIdBelongId" parameterType="java.lang.String" >
- delete from t_maint_userware
- where user_id = #{param1,jdbcType=VARCHAR}
- and belong_id = #{param2,jdbcType=VARCHAR}
- </delete>
- </mapper>
|