|
|
@ -3,29 +3,17 @@ |
|
|
<mapper namespace="com.xm.core.entity.XmTestCase"> |
|
|
<mapper namespace="com.xm.core.entity.XmTestCase"> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--开始 自定sql函数区域 --> |
|
|
|
|
|
<!--请在此区域添加自定义函数--> |
|
|
|
|
|
|
|
|
<!--开始 自定sql函数区域 请在此区域添加自定义函数,其它区域尽量不要动,因为代码随时重新生成 --> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--结束 自定义sql函数区域--> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
|
|
|
|
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
|
|
|
|
select * from xm_test_case res |
|
|
|
|
|
<where> |
|
|
|
|
|
<if test="ids != null"> and |
|
|
|
|
|
id in |
|
|
|
|
|
|
|
|
<sql id="whereForMap"> |
|
|
|
|
|
<if test=" ids != null"> and (res.id) in |
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
#{item} |
|
|
|
|
|
|
|
|
( #{item}) |
|
|
</foreach> |
|
|
</foreach> |
|
|
</if> |
|
|
</if> |
|
|
|
|
|
|
|
|
<if test=" ctimeStart !=null "> and res.ctime > #{ctimeStart} </if> |
|
|
<if test=" ctimeStart !=null "> and res.ctime > #{ctimeStart} </if> |
|
|
<if test=" ctimeTimeEnd !=null "> and res.ctime < #{ctimeTimeEnd} </if> |
|
|
<if test=" ctimeTimeEnd !=null "> and res.ctime < #{ctimeTimeEnd} </if> |
|
|
<include refid="where"/> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" myUserid!=null and myUserid!='' "> and (res.luserid=#{myUserid} or res.cuserid=#{myUserid})</if> |
|
|
<if test=" myUserid!=null and myUserid!='' "> and (res.luserid=#{myUserid} or res.cuserid=#{myUserid})</if> |
|
|
<if test=" compete!=null and compete!='' "> and (res.luserid=#{compete} or res.cuserid=#{compete})</if> |
|
|
<if test=" compete!=null and compete!='' "> and (res.luserid=#{compete} or res.cuserid=#{compete})</if> |
|
|
<if test="menuIds != null"> and |
|
|
<if test="menuIds != null"> and |
|
|
@ -41,6 +29,19 @@ |
|
|
) |
|
|
) |
|
|
</if> |
|
|
</if> |
|
|
<if test="key != null and key !='' "> and res.case_name like #{key} </if> |
|
|
<if test="key != null and key !='' "> and res.case_name like #{key} </if> |
|
|
|
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--结束 自定义sql函数区域--> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 通过条件查询获取数据列表 返回list<map> --> |
|
|
|
|
|
<select id="selectListMapByWhere" parameterType="HashMap" resultType="HashMap"> |
|
|
|
|
|
select * from xm_test_case res |
|
|
|
|
|
<where> |
|
|
|
|
|
<include refid="whereForMap"/> |
|
|
|
|
|
<include refid="where"/> |
|
|
</where> |
|
|
</where> |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
@ -58,7 +59,13 @@ |
|
|
where |
|
|
where |
|
|
res.id = #{id} |
|
|
res.id = #{id} |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectListByIds" parameterType="List" resultType="com.xm.core.entity.XmTestCase"> |
|
|
|
|
|
select * from xm_test_case res |
|
|
|
|
|
where (res.id) in |
|
|
|
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
( #{item}) |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</select> |
|
|
<!-- 通过主键查询获取数据对象 返回map--> |
|
|
<!-- 通过主键查询获取数据对象 返回map--> |
|
|
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
|
<select id="selectOneMap" parameterType="HashMap" resultType="HashMap"> |
|
|
select * from xm_test_case res |
|
|
select * from xm_test_case res |
|
|
@ -67,7 +74,7 @@ |
|
|
</select> |
|
|
</select> |
|
|
<!-- 获取数据条目 返回long --> |
|
|
<!-- 获取数据条目 返回long --> |
|
|
<select id="countByWhere" parameterType="com.xm.core.entity.XmTestCase" resultType="long"> |
|
|
<select id="countByWhere" parameterType="com.xm.core.entity.XmTestCase" resultType="long"> |
|
|
select count(1) from xm_test_case res |
|
|
|
|
|
|
|
|
select count(*) from xm_test_case res |
|
|
<where> |
|
|
<where> |
|
|
<include refid="where"/> |
|
|
<include refid="where"/> |
|
|
</where> |
|
|
</where> |
|
|
@ -77,7 +84,7 @@ |
|
|
insert into xm_test_case( |
|
|
insert into xm_test_case( |
|
|
<include refid="columns"/> |
|
|
<include refid="columns"/> |
|
|
) values ( |
|
|
) values ( |
|
|
#{id},#{caseName},#{caseRemark},#{testStep},#{expectResult},#{menuId},#{menuName},#{ctime},#{ltime},#{luserid},#{lusername},#{cbranchId},#{moduleId},#{moduleName},#{caseStatus} |
|
|
|
|
|
|
|
|
#{id},#{caseName},#{caseRemark},#{testStep},#{expectResult},#{menuId},#{menuName},#{ctime},#{ltime},#{luserid},#{lusername},#{cbranchId},#{moduleId},#{moduleName},#{caseStatus},#{cuserid},#{cusername},#{productId},#{verNum},#{casedbId},#{casedbName} |
|
|
) |
|
|
) |
|
|
</insert> |
|
|
</insert> |
|
|
|
|
|
|
|
|
@ -127,19 +134,32 @@ |
|
|
where id = #{item.id} |
|
|
where id = #{item.id} |
|
|
</foreach> |
|
|
</foreach> |
|
|
</update> |
|
|
</update> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 批量修改某几个字段 --> |
|
|
|
|
|
<delete id="editSomeFields" parameterType="HashMap"> |
|
|
|
|
|
update xm_test_case |
|
|
|
|
|
<set> |
|
|
|
|
|
<include refid="someFieldSet"/> |
|
|
|
|
|
</set> |
|
|
|
|
|
where (id) in |
|
|
|
|
|
<foreach collection="ids" item="item" index="index" open="(" separator="," close=")" > |
|
|
|
|
|
( #{item}) |
|
|
|
|
|
</foreach> |
|
|
|
|
|
</delete> |
|
|
<!-- 批量删除 --> |
|
|
<!-- 批量删除 --> |
|
|
<delete id="batchDelete" parameterType="List"> |
|
|
<delete id="batchDelete" parameterType="List"> |
|
|
delete from xm_test_case |
|
|
delete from xm_test_case |
|
|
where id in |
|
|
|
|
|
|
|
|
where |
|
|
|
|
|
(id) in |
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
<foreach collection="list" item="item" index="index" open="(" separator="," close=")" > |
|
|
#{item.id } |
|
|
|
|
|
|
|
|
( #{item.id} ) |
|
|
</foreach> |
|
|
</foreach> |
|
|
</delete> |
|
|
</delete> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--sql片段 列--> |
|
|
<!--sql片段 列--> |
|
|
<sql id="columns"> |
|
|
<sql id="columns"> |
|
|
id,case_name,case_remark,test_step,expect_result,menu_id,menu_name,ctime,ltime,luserid,lusername,cbranch_id,module_id,module_name,case_status |
|
|
|
|
|
|
|
|
id,case_name,case_remark,test_step,expect_result,menu_id,menu_name,ctime,ltime,luserid,lusername,cbranch_id,module_id,module_name,case_status,cuserid,cusername,product_id,ver_num,casedb_id,casedb_name |
|
|
</sql> |
|
|
</sql> |
|
|
|
|
|
|
|
|
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
<!--sql片段 动态条件 YYYY-MM-DD HH24:MI:SS--> |
|
|
@ -151,14 +171,20 @@ |
|
|
<if test="expectResult != null and expectResult != ''"> and res.expect_result = #{expectResult} </if> |
|
|
<if test="expectResult != null and expectResult != ''"> and res.expect_result = #{expectResult} </if> |
|
|
<if test="menuId != null and menuId != ''"> and res.menu_id = #{menuId} </if> |
|
|
<if test="menuId != null and menuId != ''"> and res.menu_id = #{menuId} </if> |
|
|
<if test="menuName != null and menuName != ''"> and res.menu_name = #{menuName} </if> |
|
|
<if test="menuName != null and menuName != ''"> and res.menu_name = #{menuName} </if> |
|
|
<if test="ctime != null"> and TO_CHAR(res.ctime,'YYYY-MM-DD') = TO_CHAR(#{ctime},'YYYY-MM-DD') </if> |
|
|
|
|
|
<if test="ltime != null"> and TO_CHAR(res.ltime,'YYYY-MM-DD') = TO_CHAR(#{ltime},'YYYY-MM-DD') </if> |
|
|
|
|
|
|
|
|
<if test="ctime != null"> and date_format(res.ctime,'%Y-%m-%d') = date_format(#{ctime},'%Y-%m-%d') </if> |
|
|
|
|
|
<if test="ltime != null"> and date_format(res.ltime,'%Y-%m-%d') = date_format(#{ltime},'%Y-%m-%d') </if> |
|
|
<if test="luserid != null and luserid != ''"> and res.luserid = #{luserid} </if> |
|
|
<if test="luserid != null and luserid != ''"> and res.luserid = #{luserid} </if> |
|
|
<if test="lusername != null and lusername != ''"> and res.lusername = #{lusername} </if> |
|
|
<if test="lusername != null and lusername != ''"> and res.lusername = #{lusername} </if> |
|
|
<if test="cbranchId != null and cbranchId != ''"> and res.cbranch_id = #{cbranchId} </if> |
|
|
<if test="cbranchId != null and cbranchId != ''"> and res.cbranch_id = #{cbranchId} </if> |
|
|
<if test="moduleId != null and moduleId != ''"> and res.module_id = #{moduleId} </if> |
|
|
<if test="moduleId != null and moduleId != ''"> and res.module_id = #{moduleId} </if> |
|
|
<if test="moduleName != null and moduleName != ''"> and res.module_name = #{moduleName} </if> |
|
|
<if test="moduleName != null and moduleName != ''"> and res.module_name = #{moduleName} </if> |
|
|
<if test="caseStatus != null and caseStatus != ''"> and res.case_status = #{caseStatus} </if> |
|
|
<if test="caseStatus != null and caseStatus != ''"> and res.case_status = #{caseStatus} </if> |
|
|
|
|
|
<if test="cuserid != null and cuserid != ''"> and res.cuserid = #{cuserid} </if> |
|
|
|
|
|
<if test="cusername != null and cusername != ''"> and res.cusername = #{cusername} </if> |
|
|
|
|
|
<if test="productId != null and productId != ''"> and res.product_id = #{productId} </if> |
|
|
|
|
|
<if test="verNum != null and verNum != ''"> and res.ver_num = #{verNum} </if> |
|
|
|
|
|
<if test="casedbId != null and casedbId != ''"> and res.casedb_id = #{casedbId} </if> |
|
|
|
|
|
<if test="casedbName != null and casedbName != ''"> and res.casedb_name = #{casedbName} </if> |
|
|
</sql> |
|
|
</sql> |
|
|
<!--sql片段 更新字段 --> |
|
|
<!--sql片段 更新字段 --> |
|
|
<sql id="set"> |
|
|
<sql id="set"> |
|
|
@ -175,7 +201,13 @@ |
|
|
cbranch_id = #{cbranchId}, |
|
|
cbranch_id = #{cbranchId}, |
|
|
module_id = #{moduleId}, |
|
|
module_id = #{moduleId}, |
|
|
module_name = #{moduleName}, |
|
|
module_name = #{moduleName}, |
|
|
case_status = #{caseStatus} |
|
|
|
|
|
|
|
|
case_status = #{caseStatus}, |
|
|
|
|
|
cuserid = #{cuserid}, |
|
|
|
|
|
cusername = #{cusername}, |
|
|
|
|
|
product_id = #{productId}, |
|
|
|
|
|
ver_num = #{verNum}, |
|
|
|
|
|
casedb_id = #{casedbId}, |
|
|
|
|
|
casedb_name = #{casedbName} |
|
|
</sql> |
|
|
</sql> |
|
|
<sql id="someFieldSet"> |
|
|
<sql id="someFieldSet"> |
|
|
<if test="caseName != null and caseName != ''"> case_name = #{caseName}, </if> |
|
|
<if test="caseName != null and caseName != ''"> case_name = #{caseName}, </if> |
|
|
@ -192,6 +224,12 @@ |
|
|
<if test="moduleId != null and moduleId != ''"> module_id = #{moduleId}, </if> |
|
|
<if test="moduleId != null and moduleId != ''"> module_id = #{moduleId}, </if> |
|
|
<if test="moduleName != null and moduleName != ''"> module_name = #{moduleName}, </if> |
|
|
<if test="moduleName != null and moduleName != ''"> module_name = #{moduleName}, </if> |
|
|
<if test="caseStatus != null and caseStatus != ''"> case_status = #{caseStatus}, </if> |
|
|
<if test="caseStatus != null and caseStatus != ''"> case_status = #{caseStatus}, </if> |
|
|
|
|
|
<if test="cuserid != null and cuserid != ''"> cuserid = #{cuserid}, </if> |
|
|
|
|
|
<if test="cusername != null and cusername != ''"> cusername = #{cusername}, </if> |
|
|
|
|
|
<if test="productId != null and productId != ''"> product_id = #{productId}, </if> |
|
|
|
|
|
<if test="verNum != null and verNum != ''"> ver_num = #{verNum}, </if> |
|
|
|
|
|
<if test="casedbId != null and casedbId != ''"> casedb_id = #{casedbId}, </if> |
|
|
|
|
|
<if test="casedbName != null and casedbName != ''"> casedb_name = #{casedbName}, </if> |
|
|
</sql> |
|
|
</sql> |
|
|
<!--sql片段 批量更新 --> |
|
|
<!--sql片段 批量更新 --> |
|
|
<sql id="batchSet"> |
|
|
<sql id="batchSet"> |
|
|
@ -208,6 +246,12 @@ |
|
|
cbranch_id = #{item.cbranchId}, |
|
|
cbranch_id = #{item.cbranchId}, |
|
|
module_id = #{item.moduleId}, |
|
|
module_id = #{item.moduleId}, |
|
|
module_name = #{item.moduleName}, |
|
|
module_name = #{item.moduleName}, |
|
|
case_status = #{item.caseStatus} |
|
|
|
|
|
|
|
|
case_status = #{item.caseStatus}, |
|
|
|
|
|
cuserid = #{item.cuserid}, |
|
|
|
|
|
cusername = #{item.cusername}, |
|
|
|
|
|
product_id = #{item.productId}, |
|
|
|
|
|
ver_num = #{item.verNum}, |
|
|
|
|
|
casedb_id = #{item.casedbId}, |
|
|
|
|
|
casedb_name = #{item.casedbName} |
|
|
</sql> |
|
|
</sql> |
|
|
</mapper> |
|
|
</mapper> |