<insert id="insertActivity" parameterType="com.aspirecn.mcp.activity.entity.Activity" flushCache="true"> <selectKey resultType="int" keyProperty="id" order="BEFORE"> SELECT SEQ_T_ACTIVITY_ID.NEXTVAL FROM DUAL </selectKey> INSERT INTO T_ACTIVITY ( ID, ACT_NAME, START_TIME, END_TIME, AREA_CODE, CREATOR, SERVICE_NUMBER, SYS_SERVICE_NUMBER, STATUS, AUDIT_STATUS, REMARKS, RESERVE, SMS_CATEGORY_ID, MMS_CATEGORY_ID ) VALUES ( #{id,jdbcType=NUMERIC}, #{activityName}, #{startTime}, #{endTime}, #{areaCode}, #{creator}, #{serviceNumber}, #{sysServiceNumber}, #{status}, #{auditStatus}, #{remarks,jdbcType=VARCHAR}, #{reserve,jdbcType=VARCHAR}, #{smsCategoryId}, #{mmsCategoryId} ) </insert>
<select id="listActivity" resultMap="activityResult" parameterType="com.aspirecn.mcp.activity.entity.Activity"> <![CDATA[ SELECT ID, ACT_NAME, START_TIME, END_TIME, AREA_CODE, CREATE_TIME, LAST_UPDATE_TIME, CREATOR, SERVICE_NUMBER, STATUS, AUDIT_STATUS, REMARKS, RESERVE, SMS_CATEGORY_ID, MMS_CATEGORY_ID FROM T_ACTIVITY ]]> <where> <if test="id!=null"> ID = #{id} </if> <if test="activityName != null and activityName !=‘‘"> AND ACT_NAME LIKE #{activityName} </if> <if test="status!=null"> AND STATUS = #{status} </if> <if test="queryType != null and queryType == 1"> AND AUDIT_STATUS IN (2,8,10) </if> <if test="auditStatus!=null"> AND AUDIT_STATUS = #{auditStatus} </if> <if test="startTime!=null"> AND START_TIME >= #{startTime} </if> <if test="endTime!=null"> AND END_TIME <= #{endTime} </if> <if test="areaCode!=null"> AND AREA_CODE = #{areaCode} </if> </where> ORDER BY ID DESC </select>
时间: 2024-10-07 13:31:13