AttendanceGroupMapper.xml 19.5 KB
Newer Older
yuquan.zhu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
<?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.timer.api.dao.kqgl.AttendanceGroupMapper" >
  <resultMap id="BaseResultMap" type="cn.timer.api.bean.kqgl.AttendanceGroup" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="name" property="name" jdbcType="VARCHAR" />
    <result column="kqbz" property="kqbz" jdbcType="VARCHAR" />
    <result column="pbfs" property="pbfs" jdbcType="INTEGER" />
    <result column="qyid" property="qyid" jdbcType="INTEGER" />
    <result column="is_fdjjr" property="isFdjjr" jdbcType="INTEGER" />
    <result column="kqkssj_time" property="kqkssjTime" jdbcType="VARCHAR" />
    
    <result column="zsgzsc" property="zsgzsc" jdbcType="VARCHAR" />
    <result column="zcgzsc" property="zcgzsc" jdbcType="VARCHAR" />
    <result column="jbzdsc" property="jbzdsc" jdbcType="VARCHAR" />
    
    <result column="is_dqtx" property="isDqtx" jdbcType="INTEGER" />
    <result column="txry" property="txry" jdbcType="VARCHAR" />
    <result column="txfs" property="txfs" jdbcType="INTEGER" />
    <result column="txxhts" property="txxhts" jdbcType="INTEGER" />
    <result column="txsj_time" property="txsjTime" jdbcType="VARCHAR" />
    <result column="tsfs" property="tsfs" jdbcType="VARCHAR" />
    <result column="is_wpbsdk" property="isWpbsdk" jdbcType="INTEGER" />
    <result column="sybc" property="sybc" jdbcType="VARCHAR" />
    <result column="is_xzbcdk" property="isXzbcdk" jdbcType="INTEGER" />
    
    <result column="kqznum" property="kqznum" jdbcType="INTEGER" />
    <result column="pbfsnm" property="pbfsnm" jdbcType="VARCHAR" />
    <result column="dkfs" property="dkfs" jdbcType="VARCHAR" />
    <result column="kqjid" property="kqjid" jdbcType="INTEGER" />
    <result column="is_wq" property="isWq" jdbcType="INTEGER" />
lal committed
32
    <result column="overtime_rules_id" property="overtimeRulesId" />
yuquan.zhu committed
33
    
lal committed
34 35
    <result column="overtimeRulesName" property="overtimeRulesName" />
    
ilal committed
36 37
    <result column="restdayclock" property="restdayclock" />
    
yuquan.zhu committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
    <collection property="kqzdkfslist" ofType="cn.timer.api.bean.kqgl.AttGroupBinPunchMode">
   		<result column="kqzId" property="kqzId" jdbcType="INTEGER" />
   		<result column="type" property="type" jdbcType="INTEGER" />
    </collection>
    
  </resultMap>
  
  <resultMap id="YgglEmpInfoMap" type="cn.timer.api.bean.yggl.YgglMainEmp" >
        	<id column="id" property="id" />
                <id column="id" property="id" />
                <result column="emp_num" property="empNum" />
                <result column="phone" property="phone" />
                <result column="password" property="password" />
                <result column="head_url" property="headUrl" />
                <result column="name" property="name" />
                <result column="english_name" property="englishName" />
                <result column="sex" property="sex" />
                <result column="zj_type" property="zjType" />
                <result column="zj_num" property="zjNum" />
                <result column="sfzyx_time" property="sfzyxTime" />
                <result column="birthday" property="birthday" />
                <result column="age" property="age" />
                <result column="is_married" property="isMarried" />
                <result column="is_pregnant" property="isPregnant" />
                <result column="area" property="area" />
                <result column="mz" property="mz" />
                <result column="zzmm" property="zzmm" />
                <result column="jg" property="jg" />
                <result column="city" property="city" />
                <result column="hk_type" property="hkType" />
                <result column="hk_address" property="hkAddress" />
                <result column="qq" property="qq" />
                <result column="wechat" property="wechat" />
lal committed
71
                <!-- <result column="email" property="email" /> -->
yuquan.zhu committed
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
                <result column="blood_type" property="bloodType" />
                <result column="language" property="language" />
                <result column="edu" property="edu" />
                <result column="zy" property="zy" />
                <result column="zz_remark" property="zzRemark" />
                <result column="job_type" property="jobType" />
                <result column="job_status" property="jobStatus" />
                <result column="rz_time" property="rzTime" />
                <result column="syq" property="syq" />
                <result column="zz_time" property="zzTime" />
                <result column="sjzz_time" property="sjzzTime" />
                <result column="is_jrkq" property="isJrkq" />
                <result column="job_num" property="jobNum" />
                <result column="work_address" property="workAddress" />
                <result column="work_phone" property="workPhone" />
                <result column="work_email" property="workEmail" />
                <result column="zpqd" property="zpqd" />
                <result column="bmgw_id" property="bmgwId" />
                <result column="org_code" property="orgCode" />
                <result column="unionid" property="unionid" />
                <result column="openid" property="openid" />
                <result column="mpopenid" property="mpopenid" />
                <result column="appopenid" property="appopenid" />
    </resultMap>
  
  
  <sql id="Base_Column_List" >
    id, name, kqbz, pbfs, qyid, is_fdjjr, kqkssj_time, zsgzsc, zcgzsc, jbzdsc, is_dqtx, 
ilal committed
100
    txry, txfs, txxhts, txsj_time, tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,overtime_rules_id,restdayclock
yuquan.zhu committed
101 102
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
lal committed
103 104 105 106
    select  kqz.*,
	(select bc.`name` from kqgl_asso_bcsz bc where bc.id = kqz.overtime_rules_id) as overtimeRulesName
    from kqgl_main_kqz kqz
    where kqz.id = #{id,jdbcType=INTEGER}
yuquan.zhu committed
107 108 109 110 111 112 113 114 115 116 117
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from kqgl_main_kqz
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="cn.timer.api.bean.kqgl.AttendanceGroup" useGeneratedKeys="true" keyProperty="id">
    insert into kqgl_main_kqz (name, kqbz, 
      pbfs, qyid, is_fdjjr, 
      kqkssj_time, zsgzsc, zcgzsc, 
      jbzdsc, is_dqtx, txry, 
      txfs, txxhts, txsj_time, 
ilal committed
118
      tsfs, is_wpbsdk,sybc,is_xzbcdk,is_wq,restdayclock)
yuquan.zhu committed
119 120 121 122 123 124
    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{kqbz,jdbcType=VARCHAR}, 
      #{pbfs,jdbcType=INTEGER}, #{qyid,jdbcType=INTEGER}, #{isFdjjr,jdbcType=INTEGER}, 
      #{kqkssjTime,jdbcType=VARCHAR}, #{zsgzsc,jdbcType=VARCHAR}, #{zcgzsc,jdbcType=VARCHAR}, 
      #{jbzdsc,jdbcType=VARCHAR}, #{isDqtx,jdbcType=INTEGER}, #{txry,jdbcType=VARCHAR}, 
      #{txfs,jdbcType=INTEGER}, #{txxhts,jdbcType=INTEGER}, #{txsjTime,jdbcType=VARCHAR}, 
      #{tsfs,jdbcType=VARCHAR}, #{isWpbsdk,jdbcType=INTEGER}, #{sybc,jdbcType=VARCHAR},
ilal committed
125
      #{isXzbcdk,jdbcType=INTEGER},#{isWq,jdbcType=INTEGER},#{restdayclock,jdbcType=INTEGER})
yuquan.zhu committed
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
  </insert>
  <insert id="insertSelective" parameterType="cn.timer.api.bean.kqgl.AttendanceGroup" useGeneratedKeys="true" keyProperty="id">
    insert into kqgl_main_kqz
    <trim prefix="(" suffix=")" suffixOverrides="," >
      
      <if test="name != null" >
        name,
      </if>
      <if test="kqbz != null" >
        kqbz,
      </if>
      <if test="pbfs != null" >
        pbfs,
      </if>
      <if test="qyid != null" >
        qyid,
      </if>
      <if test="isFdjjr != null" >
        is_fdjjr,
      </if>
      <if test="kqkssjTime != null" >
        kqkssj_time,
      </if>
      <if test="zsgzsc != null" >
        zsgzsc,
      </if>
      <if test="zcgzsc != null" >
        zcgzsc,
      </if>
      <if test="jbzdsc != null" >
        jbzdsc,
      </if>
      <if test="isDqtx != null" >
        is_dqtx,
      </if>
      <if test="txry != null" >
        txry,
      </if>
      <if test="txfs != null" >
        txfs,
      </if>
      <if test="txxhts != null" >
        txxhts,
      </if>
      <if test="txsjTime != null" >
        txsj_time,
      </if>
      <if test="tsfs != null" >
        tsfs,
      </if>
      <if test="isWpbsdk != null" >
        is_wpbsdk,
      </if>
      <if test="sybc != null" >
        sybc,
      </if>
      <if test="isXzbcdk != null" >
        is_xzbcdk,
      </if>
      <if test="isWq != null" >
        is_wq,
      </if>
lal committed
188 189 190
      <if test="overtimeRulesId != null" >
        overtime_rules_id,
      </if>
ilal committed
191 192 193
      <if test="restdayclock != null" >
        restdayclock,
      </if>
yuquan.zhu committed
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      
      <if test="name != null" >
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="kqbz != null" >
        #{kqbz,jdbcType=VARCHAR},
      </if>
      <if test="pbfs != null" >
        #{pbfs,jdbcType=INTEGER},
      </if>
      <if test="qyid != null" >
        #{qyid,jdbcType=INTEGER},
      </if>
      <if test="isFdjjr != null" >
        #{isFdjjr,jdbcType=INTEGER},
      </if>
      <if test="kqkssjTime != null" >
        #{kqkssjTime,jdbcType=VARCHAR},
      </if>
      <if test="zsgzsc != null" >
        #{zsgzsc,jdbcType=VARCHAR},
      </if>
      <if test="zcgzsc != null" >
        #{zcgzsc,jdbcType=VARCHAR},
      </if>
      <if test="jbzdsc != null" >
        #{jbzdsc,jdbcType=VARCHAR},
      </if>
      <if test="isDqtx != null" >
        #{isDqtx,jdbcType=INTEGER},
      </if>
      <if test="txry != null" >
        #{txry,jdbcType=VARCHAR},
      </if>
      <if test="txfs != null" >
        #{txfs,jdbcType=INTEGER},
      </if>
      <if test="txxhts != null" >
        #{txxhts,jdbcType=INTEGER},
      </if>
      <if test="txsjTime != null" >
        #{txsjTime,jdbcType=VARCHAR},
      </if>
      <if test="tsfs != null" >
        #{tsfs,jdbcType=VARCHAR},
      </if>
      <if test="isWpbsdk != null" >
        #{isWpbsdk,jdbcType=INTEGER},
      </if>
      <if test="sybc != null" >
        #{sybc,jdbcType=VARCHAR},
      </if>
      <if test="isXzbcdk != null" >
        #{isXzbcdk,jdbcType=INTEGER},
      </if>
      <if test="isWq != null" >
        #{isWq,jdbcType=INTEGER},
      </if>
lal committed
254 255 256
      <if test="overtimeRulesId != null" >
        #{overtimeRulesId,jdbcType=INTEGER},
      </if>
ilal committed
257 258 259
      <if test="restdayclock != null" >
        #{restdayclock,jdbcType=INTEGER},
      </if>
yuquan.zhu committed
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="cn.timer.api.bean.kqgl.AttendanceGroup" >
    update kqgl_main_kqz
    <set >
      <if test="name != null" >
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="kqbz != null" >
        kqbz = #{kqbz,jdbcType=VARCHAR},
      </if>
      <if test="pbfs != null" >
        pbfs = #{pbfs,jdbcType=INTEGER},
      </if>
      <if test="qyid != null" >
        qyid = #{qyid,jdbcType=INTEGER},
      </if>
      <if test="isFdjjr != null" >
        is_fdjjr = #{isFdjjr,jdbcType=INTEGER},
      </if>
      <if test="kqkssjTime != null" >
        kqkssj_time = #{kqkssjTime,jdbcType=VARCHAR},
      </if>
      <if test="zsgzsc != null" >
        zsgzsc = #{zsgzsc,jdbcType=VARCHAR},
      </if>
      <if test="zcgzsc != null" >
        zcgzsc = #{zcgzsc,jdbcType=VARCHAR},
      </if>
      <if test="jbzdsc != null" >
        jbzdsc = #{jbzdsc,jdbcType=VARCHAR},
      </if>
      <if test="isDqtx != null" >
        is_dqtx = #{isDqtx,jdbcType=INTEGER},
      </if>
      <if test="txry != null" >
        txry = #{txry,jdbcType=VARCHAR},
      </if>
      <if test="txfs != null" >
        txfs = #{txfs,jdbcType=INTEGER},
      </if>
      <if test="txxhts != null" >
        txxhts = #{txxhts,jdbcType=INTEGER},
      </if>
      <if test="txsjTime != null" >
        txsj_time = #{txsjTime,jdbcType=VARCHAR},
      </if>
      <if test="tsfs != null" >
        tsfs = #{tsfs,jdbcType=VARCHAR},
      </if>
      <if test="isWpbsdk != null" >
        is_wpbsdk = #{isWpbsdk,jdbcType=INTEGER},
      </if>
      <if test="sybc != null" >
        sybc = #{sybc,jdbcType=VARCHAR},
      </if>
      <if test="isXzbcdk != null" >
        is_xzbcdk = #{isXzbcdk,jdbcType=INTEGER},
      </if>
      <if test="isWq != null" >
        is_wq = #{isWq,jdbcType=INTEGER},
      </if>
lal committed
322 323 324
      <if test="overtimeRulesId != null" >
        overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER},
      </if>
ilal committed
325 326 327
      <if test="restdayclock != null" >
        restdayclock = #{restdayclock,jdbcType=INTEGER},
      </if>
yuquan.zhu committed
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.timer.api.bean.kqgl.AttendanceGroup" >
    update kqgl_main_kqz
    set name = #{name,jdbcType=VARCHAR},
      kqbz = #{kqbz,jdbcType=VARCHAR},
      pbfs = #{pbfs,jdbcType=INTEGER},
      qyid = #{qyid,jdbcType=INTEGER},
      is_fdjjr = #{isFdjjr,jdbcType=INTEGER},
      kqkssj_time = #{kqkssjTime,jdbcType=VARCHAR},
      zsgzsc = #{zsgzsc,jdbcType=VARCHAR},
      zcgzsc = #{zcgzsc,jdbcType=VARCHAR},
      jbzdsc = #{jbzdsc,jdbcType=VARCHAR},
      is_dqtx = #{isDqtx,jdbcType=INTEGER},
      txry = #{txry,jdbcType=VARCHAR},
      txfs = #{txfs,jdbcType=INTEGER},
      txxhts = #{txxhts,jdbcType=INTEGER},
      txsj_time = #{txsjTime,jdbcType=VARCHAR},
      tsfs = #{tsfs,jdbcType=VARCHAR},
      is_wpbsdk = #{isWpbsdk,jdbcType=INTEGER},
      sybc = #{sybc,jdbcType=VARCHAR},
      is_xzbcdk = #{isXzbcdk,jdbcType=INTEGER},
lal committed
351
      is_wq = #{isWq,jdbcType=INTEGER},
ilal committed
352 353
      overtime_rules_id = #{overtimeRulesId,jdbcType=INTEGER},
      restdayclock = #{restdayclock,jdbcType=INTEGER}
yuquan.zhu committed
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444
    where id = #{id,jdbcType=INTEGER}
  </update>
  
  <select id="selectByPrimaryAttOwn" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select kqz.*
    from kqgl_main_kqz kqz
    LEFT JOIN kqgl_asso_kqzdkfs as zp on zp.kqz_id = kqz.id
	LEFT JOIN kqgl_asso_kqj as kqj on kqj.id = zp.dkfsid
	where zp.type = 1
	and kqz.qyid = #{qyid}
	and kqj.id = #{id}
  </select>
  
  <select id="selectByPrimaryAttAddressOwn" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select kqz.*
    from kqgl_main_kqz kqz
    LEFT JOIN kqgl_asso_kqzdkfs as zp on zp.kqz_id = kqz.id
	LEFT JOIN kqgl_asso_dkdz as dkdz on dkdz.id = zp.dkfsid
	where zp.type = 2
	and kqz.qyid = #{qyid,jdbcType=INTEGER}
	and dkdz.id = #{id,jdbcType=INTEGER}
  </select>
  
  <select id="selectByPrimaryAttWIFIOwn" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select kqz.*
    from kqgl_main_kqz kqz
    LEFT JOIN kqgl_asso_kqzdkfs as zp on zp.kqz_id = kqz.id
	LEFT JOIN kqgl_asso_dkwx as dkwx on dkwx.id = zp.dkfsid
	where zp.type = 3
	and kqz.qyid = #{qyid}
	and dkwx.id = #{id}
  </select>
  
  <select id="selectAttGroupListByQyid" resultMap="BaseResultMap">
    select kqz.*,
    	case kqz.pbfs 
		WHEN  '1' then '固定排班' 
		WHEN  '2' then '排班制' 
		else '自由工时'  
		end as pbfsnm,
		znm.kqznum,
		dkfs.type
		from kqgl_main_kqz kqz
	LEFT JOIN (select count(yhkqz.kqzid) as kqznum,
					yhkqz.kqzid as kqzid 
				from kqgl_asso_yhkqz yhkqz 
				where yhkqz.qyid = #{qyid}
				GROUP BY yhkqz.kqzid) as znm on znm.kqzid = kqz.id
	LEFT JOIN (select kqzdkfs.kqz_id as kqzId,kqzdkfs.type as type from kqgl_asso_kqzdkfs kqzdkfs 
			where kqzdkfs.qyid = #{qyid,jdbcType=INTEGER}) as dkfs on dkfs.kqzId = kqz.id
		where 1=1
		and kqz.qyid = #{qyid}
		
  </select>
  
  <select id="selectKqglMainKqzByQuery" resultMap="BaseResultMap" parameterType="cn.timer.api.bean.kqgl.KqzAttendanceGroupSearch">
  select kqz.*,
    	case kqz.pbfs 
		WHEN  '1' then '固定排班' 
		WHEN  '2' then '排班制' 
		else '自由工时'  
		end as pbfsnm,
		znm.kqznum,
		dkfs.type
		from kqgl_main_kqz kqz
	LEFT JOIN (select count(yhkqz.kqzid) as kqznum,
					yhkqz.kqzid as kqzid 
				from kqgl_asso_yhkqz yhkqz 
				where yhkqz.qyid = #{qyid,jdbcType=INTEGER}
				GROUP BY yhkqz.kqzid) as znm on znm.kqzid = kqz.id
	LEFT JOIN (select kqzdkfs.kqz_id as kqzId,kqzdkfs.type as type from kqgl_asso_kqzdkfs kqzdkfs 
			where kqzdkfs.qyid = #{qyid,jdbcType=INTEGER}) as dkfs on dkfs.kqzId = kqz.id
		where 1=1
		and kqz.qyid = #{qyid}
		<if test="overall != null" >
	    	and kqz.name like CONCAT('%',#{overall,jdbcType=VARCHAR},'%')
	    </if>
  </select>
  
  <select id="selectAttGroupMachineByQyid" resultMap="BaseResultMap">
	select kqz.*,
		 kqzdkfs.dkfsid as kqjid 
	 from kqgl_main_kqz kqz
	 LEFT JOIN kqgl_asso_kqzdkfs as kqzdkfs on kqzdkfs.kqz_id = kqz.id and kqzdkfs.type = 1 and kqzdkfs.state = 1
	 where kqz.qyid = #{qyid,jdbcType=INTEGER}
  </select>
  
  
  <select id="getAttendanceGroupInformationByUserid" resultMap="BaseResultMap">
  	select * from kqgl_main_kqz kqz
		where kqz.id = (select yhkqz.kqzid from kqgl_asso_yhkqz yhkqz
Yl123 committed
445
		where yhkqz.userid = #{userid,jdbcType=INTEGER} and yhkqz.qyid = #{qyid,jdbcType=INTEGER})
yuquan.zhu committed
446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464
  </select>
  
  
  <select id="selectAttendanceOfficer" resultMap="YgglEmpInfoMap">
    select * from yggl_main_emp info
    where org_code = #{orgCode,jdbcType=VARCHAR}
	<if test="text != ''" >
		and (info.`name` like CONCAT('%',#{text,jdbcType=VARCHAR},'%') or info.emp_num = #{text,jdbcType=VARCHAR})
	</if>
  </select>
  
  
  
  <select id="EmployeeListByorgCode" resultMap="YgglEmpInfoMap">
    select * from yggl_main_emp
    where org_code = #{orgCode,jdbcType=VARCHAR}
  </select>
  
  <select id="selectByPrimaryByempNum" resultMap="YgglEmpInfoMap" parameterType="java.lang.Integer" >
lal committed
465 466
    select * from yggl_main_emp emp
    where emp.emp_num = #{empNum,jdbcType=VARCHAR} and emp.org_code = #{orgCode,jdbcType=INTEGER}
yuquan.zhu committed
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
  </select>
  
  
  
  
  <delete id="deleteTBlFkcmdTransCmdParamByTransId" parameterType="java.lang.String">
		delete from kqjg_fkcmd_trans_cmd_param where trans_id = #{transId}
	</delete>
	
	<insert id="insertTBlFkcmdTransCmdParam" parameterType="cn.timer.api.bean.kqgl.TBlFkcmdTransCmdParam" >
		insert into kqjg_fkcmd_trans_cmd_param
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="transId != null">
				trans_id,
			</if>
			<if test="deviceId != null">
				device_id,
			</if>
			<if test="cmdParam != null">
				cmd_param,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="transId != null">
				#{transId,jdbcType=VARCHAR},
			</if>
			<if test="deviceId != null">
				#{deviceId,jdbcType=VARCHAR},
			</if>
			<if test="cmdParam != null">
				#{cmdParam,jdbcType=VARBINARY},
			</if>
		</trim>
	</insert>
	
	<delete id="deleteTBlFkcmdTransCmdResultByTransId" parameterType="java.lang.String">
		delete from kqjg_fkcmd_trans_cmd_result where trans_id = #{transId}
	</delete>
	
	
	<insert id="insertTBlFkcmdTrans" parameterType="cn.timer.api.bean.kqgl.TBlFkcmdTrans" >
		insert into kqjg_fkcmd_trans
		<trim prefix="(" suffix=")" suffixOverrides=",">
			<if test="transId != null">
				trans_id,
			</if>
			<if test="deviceId != null">
				device_id,
			</if>
			<if test="cmdCode != null">
				cmd_code,
			</if>
			<if test="returnCode != null">
				return_code,
			</if>
			<if test="status != null">
				status,
			</if>
			<if test="updateTime != null">
				update_time,
			</if>
		</trim>
		<trim prefix="values (" suffix=")" suffixOverrides=",">
			<if test="transId != null">
				#{transId,jdbcType=VARCHAR},
			</if>
			<if test="deviceId != null">
				#{deviceId,jdbcType=VARCHAR},
			</if>
			<if test="cmdCode != null">
				#{cmdCode,jdbcType=VARCHAR},
			</if>
			<if test="returnCode != null">
				#{returnCode,jdbcType=VARCHAR},
			</if>
			<if test="status != null">
				#{status,jdbcType=VARCHAR},
			</if>
			<if test="updateTime != null">
				#{updateTime,jdbcType=VARCHAR},
			</if>
		</trim>
	</insert>
	
	<select id="selectTBlFkcmdTransNum" resultType="java.lang.String" >
		select max(trans_id) as trans_id from kqjg_fkcmd_trans
	</select>
  
</mapper>