|
|
@@ -8,7 +8,17 @@
|
|
|
<result column="remark" property="remark" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List" >
|
|
|
- id, del_flag, test_name, remark </sql>
|
|
|
+ <trim suffixOverrides="," >
|
|
|
+ id,
|
|
|
+
|
|
|
+ del_flag,
|
|
|
+
|
|
|
+ test_name,
|
|
|
+
|
|
|
+ remark,
|
|
|
+
|
|
|
+ </trim>
|
|
|
+ </sql>
|
|
|
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
@@ -22,41 +32,50 @@
|
|
|
<insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestAaa" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into test_aaa
|
|
|
<trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
- <if test="delFlag!= null" >
|
|
|
+ <if test="id!= null" >
|
|
|
+ id,
|
|
|
+ </if>
|
|
|
+ <if test="delFlag!= null" >
|
|
|
del_flag,
|
|
|
</if>
|
|
|
- <if test="testName!= null" >
|
|
|
+ <if test="testName!= null" >
|
|
|
test_name,
|
|
|
</if>
|
|
|
- <if test="remark!= null" >
|
|
|
+ <if test="remark!= null" >
|
|
|
remark,
|
|
|
</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
- <if test="delFlag != null" >
|
|
|
+ <if test="id != null" >
|
|
|
+ #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null" >
|
|
|
#{delFlag,jdbcType=CHAR},
|
|
|
</if>
|
|
|
- <if test="testName != null" >
|
|
|
+ <if test="testName != null" >
|
|
|
#{testName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="remark != null" >
|
|
|
+ <if test="remark != null" >
|
|
|
#{remark,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- </trim>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.TestAaa" >
|
|
|
update test_aaa
|
|
|
<set >
|
|
|
- <if test="delFlag != null" >
|
|
|
+ <if test="id != null" >
|
|
|
+ id= #{id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="delFlag != null" >
|
|
|
del_flag= #{delFlag,jdbcType=CHAR},
|
|
|
</if>
|
|
|
- <if test="testName != null" >
|
|
|
+ <if test="testName != null" >
|
|
|
test_name= #{testName,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- <if test="remark != null" >
|
|
|
+ <if test="remark != null" >
|
|
|
remark= #{remark,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
- </set>
|
|
|
+ </set>
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
<select id="queryTestAaaByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
|
|
|
@@ -75,7 +94,13 @@
|
|
|
<if test="record.remark != null and !"".equals(record.remark)">
|
|
|
and remark = #{record.remark}
|
|
|
</if>
|
|
|
- </where>
|
|
|
+ <if test="record.searchKey != null and !"".equals(record.searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR" >
|
|
|
+ OR test_name LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ OR remark LIKE concat('%',#{record.searchKey},'%')
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
order by id desc
|
|
|
</select>
|
|
|
<select id="queryAllTestAaa" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
|
|
|
@@ -94,11 +119,17 @@
|
|
|
<if test="remark != null and !"".equals(remark)">
|
|
|
and remark = #{remark}
|
|
|
</if>
|
|
|
- </where>
|
|
|
+ <if test="searchKey != null and !"".equals(searchKey)">
|
|
|
+ <trim prefix="and (" suffix=")" prefixOverrides="OR" >
|
|
|
+ OR test_name LIKE concat('%',#{searchKey},'%')
|
|
|
+ OR remark LIKE concat('%',#{searchKey},'%')
|
|
|
+ </trim>
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
order by id desc
|
|
|
</select>
|
|
|
<select id="queryTestAaa" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
|
|
|
- select top 1 <include refid="Base_Column_List"/> from test_aaa
|
|
|
+ select <include refid="Base_Column_List"/> from test_aaa
|
|
|
<where>
|
|
|
and del_flag = 'N'
|
|
|
<if test="id != null and !"".equals(id)">
|
|
|
@@ -115,6 +146,7 @@
|
|
|
</if>
|
|
|
|
|
|
</where>
|
|
|
+ LIMIT 1
|
|
|
</select>
|
|
|
<update id="delete">
|
|
|
UPDATE test_aaa SET del_flag = 'Y'
|