|  |  | 
 |  |  | <mapper namespace="com.smartor.mapper.IvrLibaTargetMapper"> | 
 |  |  |  | 
 |  |  |     <resultMap type="com.smartor.domain.IvrLibaTarget" id="IvrLibaTargetResult"> | 
 |  |  |         <result property="targetID" column="targetID"/> | 
 |  |  |         <result property="id" column="id"/> | 
 |  |  |         <result property="groupid" column="groupid"/> | 
 |  |  |         <result property="targettype" column="targettype"/> | 
 |  |  |         <result property="targetname" column="targetname"/> | 
 |  |  | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |     <resultMap type="com.smartor.domain.IvrLibaTargetVO" id="IvrLibaTargetVOResult"> | 
 |  |  |         <result property="targetID" column="targetID"/> | 
 |  |  |         <result property="id" column="id"/> | 
 |  |  |         <result property="groupid" column="groupid"/> | 
 |  |  |         <result property="targettype" column="targettype"/> | 
 |  |  |         <result property="targetname" column="targetname"/> | 
 |  |  | 
 |  |  |     </resultMap> | 
 |  |  |  | 
 |  |  |     <sql id="selectIvrLibaTargetVo"> | 
 |  |  |         select targetID, | 
 |  |  |         select id, | 
 |  |  |                groupid, | 
 |  |  |                targettype, | 
 |  |  |                targetname, | 
 |  |  |                targetdesc, language, version, isenable, isabnormal, warnup, warndown, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time, orgid, pid, guid, assortid, | 
 |  |  |             isAvailable, suitDisease, suitWay,parameter | 
 |  |  |             isAvailable, suitDisease, suitWay, parameter | 
 |  |  |         from ivr_liba_target | 
 |  |  |     </sql> | 
 |  |  |  | 
 |  |  | 
 |  |  |             resultMap="IvrLibaTargetResult"> | 
 |  |  |         <include refid="selectIvrLibaTargetVo"/> | 
 |  |  |         <where> | 
 |  |  |             del_flag != 1 | 
 |  |  |             <if test="targetID != null ">and targetID = #{targetID}</if> | 
 |  |  |             del_flag =0 | 
 |  |  |             <if test="id != null ">and id = #{id}</if> | 
 |  |  |             <if test="groupid != null  and groupid != ''">and groupid = #{groupid}</if> | 
 |  |  |             <if test="targettype != null  and targettype != ''">and targettype = #{targettype}</if> | 
 |  |  |             <if test="targetname != null  and targetname != ''">and targetname like concat('%', #{targetname}, '%')</if> | 
 |  |  | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <select id="targetInfo" parameterType="com.smartor.domain.IvrLibaTarget" resultMap="IvrLibaTargetVOResult"> | 
 |  |  |         select a.targetID, | 
 |  |  |         select a.id, | 
 |  |  |         a.groupid, | 
 |  |  |         a.targettype, | 
 |  |  |         a.targetname, | 
 |  |  | 
 |  |  |         b.optiondesc | 
 |  |  |         from ivr_liba_target a | 
 |  |  |         LEFT JOIN ivr_liba_targetoption b | 
 |  |  |         on a.targetID = b.targetid | 
 |  |  |         on a.id = b.targetid | 
 |  |  |         <where> | 
 |  |  |             a.del_flag != 1 and b.del_flag != 1 | 
 |  |  |             <if test="groupid != null  and groupid != ''">and a.groupid = #{groupid}</if> | 
 |  |  | 
 |  |  |  | 
 |  |  |     <select id="selectIvrLibaTargetByTargetID" parameterType="Long" resultMap="IvrLibaTargetResult"> | 
 |  |  |         <include refid="selectIvrLibaTargetVo"/> | 
 |  |  |         where targetID = #{targetID} | 
 |  |  |         where id = #{id} | 
 |  |  |     </select> | 
 |  |  |  | 
 |  |  |     <insert id="insertIvrLibaTarget" parameterType="com.smartor.domain.IvrLibaTarget" useGeneratedKeys="true" | 
 |  |  |             keyProperty="targetID"> | 
 |  |  |             keyProperty="id"> | 
 |  |  |         insert into ivr_liba_target | 
 |  |  |         <trim prefix="(" suffix=")" suffixOverrides=","> | 
 |  |  |             <if test="groupid != null">groupid,</if> | 
 |  |  | 
 |  |  |             <if test="isAvailable != null and isAvailable != ''">isAvailable = #{isAvailable},</if> | 
 |  |  |             <if test="parameter != null and parameter != ''">parameter = #{parameter},</if> | 
 |  |  |         </trim> | 
 |  |  |         where targetID = #{targetID} | 
 |  |  |         where id = #{id} | 
 |  |  |     </update> | 
 |  |  |  | 
 |  |  |     <delete id="deleteIvrLibaTargetByTargetID" parameterType="Long"> | 
 |  |  |         delete | 
 |  |  |         from ivr_liba_target | 
 |  |  |         where targetID = #{targetID} | 
 |  |  |         where id = #{id} | 
 |  |  |     </delete> | 
 |  |  |  | 
 |  |  |     <delete id="deleteIvrLibaTargetByTargetIDs" parameterType="String"> | 
 |  |  |         delete from ivr_liba_target where targetID in | 
 |  |  |         <foreach item="targetID" collection="array" open="(" separator="," close=")"> | 
 |  |  |             #{targetID} | 
 |  |  |         delete from ivr_liba_target where id in | 
 |  |  |         <foreach item="id" collection="array" open="(" separator="," close=")"> | 
 |  |  |             #{id} | 
 |  |  |         </foreach> | 
 |  |  |     </delete> | 
 |  |  | </mapper> |