| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265 |
- <?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.izouma.awesomeadmin.dao.GenCodeMapper">
- <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.GenCode">
- <id column="id" property="id" jdbcType="INTEGER"/>
- <result column="tableName" property="tableName" jdbcType="VARCHAR"/>
- <result column="className" property="className" jdbcType="VARCHAR"/>
- <result column="remark" property="remark" jdbcType="VARCHAR"/>
- <result column="genTable" property="genTable" jdbcType="BIT"/>
- <result column="genClass" property="genClass" jdbcType="BIT"/>
- <result column="genList" property="genList" jdbcType="BIT"/>
- <result column="genForm" property="genForm" jdbcType="BIT"/>
- <result column="field_id" property="fieldId" jdbcType="VARCHAR"/>
- <result column="gen_json" property="genJson" jdbcType="VARCHAR"/>
- <result column="del_flag" property="delFlag" jdbcType="VARCHAR"/>
- <result column="type_flag" property="typeFlag" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, tableName, className, remark, genTable, genClass,
- genList, genForm, field_id, gen_json, del_flag, type_flag
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
- select
- <include refid="Base_Column_List"/>
- from sys_gen_code
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from sys_gen_code
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.GenCode" useGeneratedKeys="true"
- keyProperty="id">
- insert into sys_gen_code
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="tableName != null">
- tableName,
- </if>
- <if test="className != null">
- className,
- </if>
- <if test="remark != null">
- remark,
- </if>
- <if test="genTable != null">
- genTable,
- </if>
- <if test="genClass != null">
- genClass,
- </if>
- <if test="genList != null">
- genList,
- </if>
- <if test="genForm != null">
- genForm,
- </if>
- <if test="fieldId != null">
- field_id,
- </if>
- <if test="genJson != null">
- gen_json,
- </if>
- <if test="typeFlag != null">
- type_flag,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="tableName != null">
- #{tableName,jdbcType=VARCHAR},
- </if>
- <if test="className != null">
- #{className,jdbcType=VARCHAR},
- </if>
- <if test="remark != null">
- #{remark,jdbcType=VARCHAR},
- </if>
- <if test="genTable != null">
- #{genTable,jdbcType=BIT},
- </if>
- <if test="genClass != null">
- #{genClass,jdbcType=BIT},
- </if>
- <if test="genList != null">
- #{genList,jdbcType=BIT},
- </if>
- <if test="genForm != null">
- #{genForm,jdbcType=BIT},
- </if>
- <if test="fieldId != null">
- #{fieldId,jdbcType=VARCHAR},
- </if>
- <if test="genJson != null">
- #{genJson,jdbcType=VARCHAR},
- </if>
- <if test="typeFlag != null">
- #{typeFlag,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.GenCode">
- update sys_gen_code
- <set>
- <if test="tableName != null">
- tableName = #{tableName,jdbcType=VARCHAR},
- </if>
- <if test="className != null">
- className = #{className,jdbcType=VARCHAR},
- </if>
- <if test="remark != null">
- remark = #{remark,jdbcType=VARCHAR},
- </if>
- <if test="genTable != null">
- genTable = #{genTable,jdbcType=BIT},
- </if>
- <if test="genClass != null">
- genClass = #{genClass,jdbcType=BIT},
- </if>
- <if test="genList != null">
- genList = #{genList,jdbcType=BIT},
- </if>
- <if test="genForm != null">
- genForm = #{genForm,jdbcType=BIT},
- </if>
- <if test="fieldId != null">
- field_id = #{fieldId,jdbcType=VARCHAR},
- </if>
- <if test="genJson != null">
- gen_json = #{genJson,jdbcType=VARCHAR},
- </if>
- <if test="typeFlag != null">
- type_flag = #{typeFlag,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="queryGenCodeByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
- select
- <include refid="Base_Column_List"/>
- from sys_gen_code
- <where>
- and del_flag = 'N'
- <if test="record.id != null and !"".equals(record.id)">
- and id = #{record.id}
- </if>
- <if test="record.tableName != null and !"".equals(record.tableName)">
- and tableName = #{record.tableName}
- </if>
- <if test="record.className != null and !"".equals(record.className)">
- and className = #{record.className}
- </if>
- <if test="record.remark != null and !"".equals(record.remark)">
- and remark = #{record.remark}
- </if>
- <if test="record.genTable != null and !"".equals(record.genTable)">
- and genTable = #{record.genTable}
- </if>
- <if test="record.genClass != null and !"".equals(record.genClass)">
- and genClass = #{record.genClass}
- </if>
- <if test="record.genList != null and !"".equals(record.genList)">
- and genList = #{record.genList}
- </if>
- <if test="record.genForm != null and !"".equals(record.genForm)">
- and genForm = #{record.genForm}
- </if>
- <if test="record.fieldId != null and !"".equals(record.fieldId)">
- and field_id = #{record.fieldId}
- </if>
- <if test="record.searchKey != null and !"".equals(record.searchKey)">
- <trim prefix="and (" suffix=")" prefixOverrides="OR">
- OR tableName LIKE concat('%',#{record.searchKey},'%')
- OR className LIKE concat('%',#{record.searchKey},'%')
- OR remark LIKE concat('%',#{record.searchKey},'%')
- OR type_flag LIKE concat('%',#{record.searchKey},'%')
- </trim>
- </if>
- </where>
- order by id desc
- </select>
- <select id="queryAllGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
- select
- <include refid="Base_Column_List"/>
- from sys_gen_code
- <where>
- and del_flag = 'N'
- <if test="id != null and !"".equals(id)">
- and id = #{id}
- </if>
- <if test="tableName != null and !"".equals(tableName)">
- and tableName = #{tableName}
- </if>
- <if test="className != null and !"".equals(className)">
- and className = #{className}
- </if>
- <if test="remark != null and !"".equals(remark)">
- and remark = #{remark}
- </if>
- <if test="genTable != null and !"".equals(genTable)">
- and genTable = #{genTable}
- </if>
- <if test="genClass != null and !"".equals(genClass)">
- and genClass = #{genClass}
- </if>
- <if test="genList != null and !"".equals(genList)">
- and genList = #{genList}
- </if>
- <if test="genForm != null and !"".equals(genForm)">
- and genForm = #{genForm}
- </if>
- <if test="fieldId != null and !"".equals(fieldId)">
- and field_id = #{fieldId}
- </if>
- </where>
- order by id desc
- </select>
- <select id="queryGenCode" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.GenCode">
- select
- <include refid="Base_Column_List"/>
- from sys_gen_code
- <where>
- and del_flag = 'N'
- <if test="id != null and !"".equals(id)">
- and id = #{id}
- </if>
- <if test="tableName != null and !"".equals(tableName)">
- and tableName = #{tableName}
- </if>
- <if test="className != null and !"".equals(className)">
- and className = #{className}
- </if>
- <if test="remark != null and !"".equals(remark)">
- and remark = #{remark}
- </if>
- <if test="genTable != null and !"".equals(genTable)">
- and genTable = #{genTable}
- </if>
- <if test="genClass != null and !"".equals(genClass)">
- and genClass = #{genClass}
- </if>
- <if test="genList != null and !"".equals(genList)">
- and genList = #{genList}
- </if>
- <if test="genForm != null and !"".equals(genForm)">
- and genForm = #{genForm}
- </if>
- <if test="fieldId != null and !"".equals(fieldId)">
- and field_id = #{fieldId}
- </if>
- </where>
- LIMIT 1
- </select>
- <update id="delete">
- UPDATE sys_gen_code SET del_flag = 'Y'
- <where>
- AND id = #{id}
- </where>
- </update>
- </mapper>
|